コード例 #1
0
        protected override void Decode(ByteList bytes)
        {
            Log.Debug("Decode a AnswerMessage");

            if (bytes == null || !bytes.IsMore)
            {
                return;
            }
            ActiveGameCount = bytes.GetInt();
            Log.Debug($"Decoded ActiveGameCount = {ActiveGameCount}");

            int studentCount = bytes.GetInt();

            Log.Debug($"Decoded StudentCount = {studentCount}");

            for (var i = 0; i < studentCount; i++)
            {
                PlayerInfo s = new PlayerInfo();
                s.Decode(bytes);
                Log.Debug($"Decoded Student: {s}");
                Students.Add(s);
            }
        }
コード例 #2
0
            public void Decode(ByteList bytes)
            {
                Id             = bytes.GetInt();
                Alias          = bytes.GetString();
                GameCount      = bytes.GetInt();
                GuessCount     = bytes.GetInt();
                HintCount      = bytes.GetInt();
                ExitCount      = bytes.GetInt();
                HeartbeatCount = bytes.GetInt();
                HighScore      = bytes.GetInt();
                LastMessage    = DateTime.FromBinary(bytes.GetLong());

                Log.Debug($"Decoded Player = {ToString()}");
            }