From d5ae007d1c0af4cc883fb6a64810bbac6680ea07 Mon Sep 17 00:00:00 2001 From: miniduikboot <5243971+miniduikboot@users.noreply.github.com> Date: Fri, 2 Apr 2021 00:41:19 +0200 Subject: [PATCH] implement rpc 31: climb ladder --- .../Net/Messages/Rpcs/Rpc31ClimbLadder.cs | 17 +++++++++++++++++ .../Objects/Components/InnerPlayerPhysics.cs | 4 ++++ 2 files changed, 21 insertions(+) create mode 100644 src/Impostor.Api/Net/Messages/Rpcs/Rpc31ClimbLadder.cs diff --git a/src/Impostor.Api/Net/Messages/Rpcs/Rpc31ClimbLadder.cs b/src/Impostor.Api/Net/Messages/Rpcs/Rpc31ClimbLadder.cs new file mode 100644 index 000000000..a31522167 --- /dev/null +++ b/src/Impostor.Api/Net/Messages/Rpcs/Rpc31ClimbLadder.cs @@ -0,0 +1,17 @@ +namespace Impostor.Api.Net.Messages.Rpcs +{ + public static class Rpc31ClimbLadder + { + public static void Serialize(IMessageWriter writer, byte ladderId, byte lastClimbLadderSid) + { + writer.Write(ladderId); + writer.Write(lastClimbLadderSid); + } + + public static void Deserialize(IMessageReader reader, out byte ladderId, out byte lastClimbLadderSid) + { + ladderId = reader.ReadByte(); + lastClimbLadderSid = reader.ReadByte(); + } + } +} diff --git a/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs b/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs index 14e8690c7..19d4dd504 100644 --- a/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs +++ b/src/Impostor.Server/Net/Inner/Objects/Components/InnerPlayerPhysics.cs @@ -55,6 +55,10 @@ public override async ValueTask HandleRpcAsync(ClientPlayer sender, Client Rpc19EnterVent.Deserialize(reader, out ventId); break; + case RpcCalls.ClimbLadder: + Rpc31ClimbLadder.Deserialize(reader, out byte ladderId, out byte lastClimbLadderSid); + return true; + default: return await UnregisteredCall(call, sender); }