Beispiel #1
0
        static public byte[] Serialize(ClientConnectResponce state)
        {
            byte[] bytes = new byte[OneObjectSize];

            Array.Copy(BitConverter.GetBytes(state.playerId), 0, bytes, 0, 8);

            return(bytes);
        }
Beispiel #2
0
        static public ClientConnectResponce Deserialize(byte[] bytes)
        {
            if (bytes.Length != OneObjectSize)
            {
                throw new ApplicationException("Wrong byte[] size in static public ClientConnectResponce Deserialize(byte[] bytes);");
            }

            ClientConnectResponce rez = new ClientConnectResponce {
                playerId = (ulong)BitConverter.ToInt64(bytes, 0)
            };

            return(rez);
        }