コード例 #1
0
        public void NotifyClients(uint sessionId, ServerInfoBase info)
        {
            var serverName = "";

            if (info is WorldServerInfo)
                serverName = "WorldServer";
            else if (info is WorldNodeInfo)
                serverName = "NodeServer";

            if (info == null)
            {
                if (Servers.TryRemove(sessionId, out info))
                    Log.Message($"{serverName} (Realm: {info.RealmId}, Host: {info.IPAddress}, Port: {info.Port}) disconnected.");
            }
            else
            {
                var status = "connected";

                if (Servers.ContainsKey(sessionId))
                    status = "updated";

                Servers.AddOrUpdate(sessionId, info, (k, v) => info);

                Log.Message($"{serverName} (Host: {info.IPAddress}, Port: {info.Port}, Connections: {info.ActiveConnections}) {status}.");
            }
        }
コード例 #2
0
 public bool Compare(ServerInfoBase info)
 {
     return RealmId == info.RealmId && IPAddress == info.IPAddress && Port == info.Port;
 }
コード例 #3
0
 public void Register(ServerInfoBase info)
 {
     proxy.Register(info);
 }
コード例 #4
0
 public void Update(ServerInfoBase info)
 {
     proxy.Update(info);
 }
コード例 #5
0
 public bool Compare(ServerInfoBase info)
 {
     return(RealmId == info.RealmId && IPAddress == info.IPAddress && Port == info.Port);
 }