Exemple #1
0
        public static byte[] Serialize(object x)
        {
            RpPlayerData rpData = (RpPlayerData)x;

            byte[] res   = new byte[4 + 2 + rpData.PlayerName.Length + 1];
            int    index = 0;

            SerializeUtils.WriteInt(res, ref index, rpData.PlayerId);
            SerializeUtils.WriteString(res, ref index, rpData.PlayerName);
            SerializeUtils.WriteBool(res, ref index, rpData.IsReady);
            return(res);
        }