Ejemplo n.º 1
0
        /// <summary>
        /// Adds server with this name, if it doesn't exist already,
        /// and returns the new or existing server info for it.
        /// </summary>
        /// <param name="serverName"></param>
        /// <returns></returns>
        public ServerInfo Add(string serverName)
        {
            if (!this.Has(serverName))
            {
                var result = new ServerInfo(serverName);
                _servers.Add(serverName, result);
                return result;
            }

            return this.GetServer(serverName);
        }
Ejemplo n.º 2
0
		/// <summary>
		/// Sends GetChannelList to client.
		/// </summary>
		/// <param name="client"></param>
		/// <param name="server"></param>
		public static void GetChannelListR(ChannelClient client, ServerInfo server)
		{
			var packet = new Packet(Op.GetChannelListR, MabiId.Channel);
			packet.AddServerInfo(server, ServerInfoType.Client);

			client.Send(packet);
		}
Ejemplo n.º 3
0
Archivo: Send.cs Proyecto: pie3467/aura
        /// <summary>
        /// Adds server and channel information to packet.
        /// </summary>
        /// <param name="packet"></param>
        /// <param name="server"></param>
        private static void Add(this Packet packet, ServerInfo server)
        {
            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)
            {
                var state = channel.State;
                if ((DateTime.Now - channel.LastUpdate).TotalSeconds > 90)
                    state = ChannelState.Maintenance;

                packet.PutString(channel.Name);
                packet.PutInt((int)state);
                packet.PutInt((int)channel.Events);
                packet.PutInt(0); // 1 for Housing? Hidden?
                packet.PutShort(channel.Stress);
            }
        }