mirror of
https://github.com/Impostor/Impostor.git
synced 2026-10-20 01:46:11 +00:00
Add NetId to SetName and SetColor
This commit is contained in:
1 parent
264ed110a5
commit
a072d5234a
4 files changed
+11
-7
No files matched your search
@@ -2,13 +2,15 @@ namespace Impostor.Api.Net.Messages.Rpcs
|
||||
{
|
||||
public static class Rpc06SetName
|
||||
{
|
||||
public static void Serialize(IMessageWriter writer, string name)
|
||||
public static void Serialize(IMessageWriter writer, uint netId, string name)
|
||||
{
|
||||
writer.Write(netId);
|
||||
writer.Write(name);
|
||||
}
|
||||
|
||||
public static void Deserialize(IMessageReader reader, out string name)
|
||||
public static void Deserialize(IMessageReader reader, out uint netId, out string name)
|
||||
{
|
||||
netId = reader.ReadUInt32();
|
||||
name = reader.ReadString();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4,13 +4,15 @@ namespace Impostor.Api.Net.Messages.Rpcs
|
||||
{
|
||||
public static class Rpc08SetColor
|
||||
{
|
||||
public static void Serialize(IMessageWriter writer, ColorType color)
|
||||
public static void Serialize(IMessageWriter writer, uint netId, ColorType color)
|
||||
{
|
||||
writer.Write(netId);
|
||||
writer.Write((byte)color);
|
||||
}
|
||||
|
||||
public static void Deserialize(IMessageReader reader, out ColorType color)
|
||||
public static void Deserialize(IMessageReader reader, out uint netId, out ColorType color)
|
||||
{
|
||||
netId = reader.ReadUInt32();
|
||||
color = (ColorType)reader.ReadByte();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace Impostor.Server.Net.Inner.Objects
|
||||
PlayerInfo.CurrentOutfit.Color = color;
|
||||
|
||||
using var writer = Game.StartRpc(NetId, RpcCalls.SetColor);
|
||||
Rpc08SetColor.Serialize(writer, color);
|
||||
Rpc08SetColor.Serialize(writer, PlayerInfo.NetId, color);
|
||||
await Game.FinishRpcAsync(writer);
|
||||
}
|
||||
|
||||
|
||||
@@ -167,7 +167,7 @@ namespace Impostor.Server.Net.Inner.Objects
|
||||
return false;
|
||||
}
|
||||
|
||||
Rpc06SetName.Deserialize(reader, out var name);
|
||||
Rpc06SetName.Deserialize(reader, out var _, out var name);
|
||||
return await HandleSetName(sender, name);
|
||||
}
|
||||
|
||||
@@ -191,7 +191,7 @@ namespace Impostor.Server.Net.Inner.Objects
|
||||
return false;
|
||||
}
|
||||
|
||||
Rpc08SetColor.Deserialize(reader, out var color);
|
||||
Rpc08SetColor.Deserialize(reader, out var _, out var color);
|
||||
return await HandleSetColor(sender, color);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user