Esempio n. 1
0
        /// <summary>
        /// Adds server and channel information to packet.
        /// </summary>
        /// <param name="packet"></param>
        /// <param name="server"></param>
        /// <param name="type"></param>
        public static void AddServerInfo(this Packet packet, ServerInfo server, ServerInfoType type)
        {
            packet.PutString(server.Name);
            packet.PutShort(0);             // Server type?
            packet.PutShort(0);
            packet.PutByte(1);

            // Channels
            packet.PutInt((int)server.Channels.Count);
            foreach (var channel in server.Channels.Values)
            {
                packet.AddChannelInfo(channel, type);
            }
        }