Example #1
0
        public void RegistryHandler(CSSession session, CRegistryReq message)
        {
            ServerManager.Instance.Register(session, (byte)message.Index, message.Address, message.Port, message.Show != 0, message.Token, message.Name, message.Type);
            var arg = new CServerList();

            Program.server.Clients.ToList().ForEach(x => ServerListHandler(x, arg));
        }
Example #2
0
        public void ServerListHandler(CSSession session, CServerList message)
        {
            var servers = ServerManager.Instance.Servers.Where(x => x.Visible).Select(x => new ServerDto {
                Index = x.Index, Load = x.Load, Padding = 0x77
            }).ToArray();

            //Logger.Information("Sending Server list {0} servers", servers.Length);
            session.SendAsync(new SServerList(servers));
        }