예제 #1
0
        public void HandleSelected(ByteReader data)
        {
            bool reset = data.ReadBool();

            var writer = new ByteWriter();

            writer.WriteInt32(Player.id);
            writer.WriteBool(reset);
            writer.WritePrefixedInts(data.ReadPrefixedInts(200));
            writer.WritePrefixedInts(data.ReadPrefixedInts(200));

            Server.SendToAll(Packets.Server_Selected, writer.ToArray(), excluding: Player);
        }
예제 #2
0
        public byte[] SerializePlayerInfo()
        {
            var writer = new ByteWriter();

            writer.WriteInt32(id);
            writer.WriteString(Username);
            writer.WriteInt32(Latency);
            writer.WriteByte((byte)type);
            writer.WriteByte((byte)status);
            writer.WriteULong(steamId);
            writer.WriteString(steamPersonaName);
            writer.WriteInt32(ticksBehind);
            writer.WriteBool(simulating);
            writer.WriteByte(color.r);
            writer.WriteByte(color.g);
            writer.WriteByte(color.b);

            return(writer.ToArray());
        }
예제 #3
0
 public void WriteLatencyUpdate(ByteWriter writer)
 {
     writer.WriteInt32(Latency);
     writer.WriteInt32(ticksBehind);
     writer.WriteBool(simulating);
 }