mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
Address feedback
This commit is contained in:
1 parent
3065e8df48
commit
a1dac9f8b7
3 files changed
+9
-7
No files matched your search
@@ -4,6 +4,8 @@ namespace Impostor.Api.Net.Messages.C2S
|
||||
{
|
||||
public static class HandshakeC2S
|
||||
{
|
||||
private static readonly int ExtendedHandshakeMinVersion = GameVersion.GetVersion(2021, 6, 30);
|
||||
|
||||
public static void Deserialize(IMessageReader reader, out int clientVersion, out string name, out uint lastNonceReceived, out Language language, out QuickChatModes chatMode)
|
||||
{
|
||||
clientVersion = reader.ReadInt32();
|
||||
@@ -12,7 +14,7 @@ namespace Impostor.Api.Net.Messages.C2S
|
||||
|
||||
// Version 2021.6.30 (aka 50537300) is the first version that includes language and chat modes
|
||||
// In case the game is older than that, stop reading here.
|
||||
if (clientVersion >= 50537300)
|
||||
if (clientVersion >= ExtendedHandshakeMinVersion)
|
||||
{
|
||||
language = (Language)reader.ReadUInt32();
|
||||
chatMode = (QuickChatModes)reader.ReadByte();
|
||||
|
||||
@@ -6,20 +6,20 @@ namespace Impostor.Api.Net.Messages.Rpcs
|
||||
{
|
||||
public static class Rpc35UpdateSystem
|
||||
{
|
||||
public static void Serialize(IMessageWriter writer, SystemTypes systemType, IInnerPlayerControl playerControl, ushort sid, byte state, byte ventId)
|
||||
public static void Serialize(IMessageWriter writer, SystemTypes systemType, IInnerPlayerControl playerControl, ushort sequenceId, byte state, byte ventId)
|
||||
{
|
||||
writer.Write((byte)systemType);
|
||||
writer.Write(playerControl.NetId);
|
||||
writer.Write(sid);
|
||||
writer.Write(sequenceId);
|
||||
writer.Write(state);
|
||||
writer.Write(ventId);
|
||||
}
|
||||
|
||||
public static void Deserialize(IMessageReader reader, IGame game, out SystemTypes systemType, out IInnerPlayerControl? playerControl, out ushort sId, out byte state, out byte ventId)
|
||||
public static void Deserialize(IMessageReader reader, IGame game, out SystemTypes systemType, out IInnerPlayerControl? playerControl, out ushort sequenceId, out byte state, out byte ventId)
|
||||
{
|
||||
systemType = (SystemTypes)reader.ReadByte();
|
||||
playerControl = reader.ReadNetObject<IInnerPlayerControl>(game);
|
||||
sId = reader.ReadUInt16();
|
||||
sequenceId = reader.ReadUInt16();
|
||||
state = reader.ReadByte();
|
||||
ventId = reader.ReadByte();
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Numerics;
|
||||
@@ -107,7 +107,7 @@ namespace Impostor.Server.Net.Inner.Objects.ShipStatus
|
||||
|
||||
case RpcCalls.UpdateSystem:
|
||||
{
|
||||
Rpc35UpdateSystem.Deserialize(reader, Game, out var systemType, out var playerControl, out var sId, out var state, out var ventId);
|
||||
Rpc35UpdateSystem.Deserialize(reader, Game, out var systemType, out var playerControl, out var sequenceId, out var state, out var ventId);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user