Beispiel #1
0
        public byte[] Pack()
        {
            var bytes = new List <byte>()
            {
                Id, Accepted
            };

            bytes.AddRange(StringPacker.PackString(ReasonForDecline));
            bytes.AddRange(StringPacker.PackString(MotD));
            bytes.AddRange(StringPacker.PackString(WelcomeMessage));
            bytes.AddRange(StringPacker.PackList(ActiveUsers));

            return(bytes.ToArray());
        }
        public byte[] Pack()
        {
            var result = new List <byte>()
            {
                Id
            };

            result.AddRange(StringPacker.PackList(ActiveUsers));

            var chatList = new List <string>();

            foreach (var chat in NewChats)
            {
                chatList.Add(chat.Username);
                chatList.Add(chat.Message);
            }

            result.AddRange(StringPacker.PackList(chatList));

            return(result.ToArray());
        }