Example #1
0
        public override async Task RunImpl()
        {
            await Task.Run(() =>
            {
                L2Server server = LoginServer.ServiceProvider.GetService <ServerThreadPool>().Servers.FirstOrDefault(srv => srv.Code == _code);

                if (server == null)
                {
                    Log.Error($"Code '{_code}' for server was not found. Closing");
                    _thread.Close(ServerLoginFail.ToPacket("Code Error"));
                    return;
                }

                server.Thread     = _thread;
                _thread.Id        = server.Id;
                _thread.Info      = _info;
                _thread.Wan       = _host;
                _thread.Port      = _port;
                _thread.Maxp      = _maxp;
                _thread.GmOnly    = _gmonly == 1;
                _thread.TestMode  = _test == 1;
                _thread.Connected = true;
                _thread.Send(ServerLoginOk.ToPacket());

                Log.Info($"Server #{server.Id} connected");
            });
        }
Example #2
0
        public override async Task RunImpl()
        {
            L2Server server = LoginServer.ServiceProvider.GetService <ServerThreadPool>()
                              .Servers.FirstOrDefault(x => x.ServerKey == _serverKey);

            if (server == null)
            {
                Log.Error($"Server with id '{_serverKey}' was not found. Closing");
                _thread.Close(ServerLoginFail.ToPacket("ServerId Error"));
                return;
            }

            server.Thread      = _thread;
            _thread.ServerId   = server.ServerId;
            _thread.Info       = _info;
            _thread.Wan        = _host;
            _thread.Port       = _port;
            _thread.MaxPlayers = _maxPlayers;
            _thread.GmOnly     = _gmonly == 1;
            _thread.TestMode   = _test == 1;
            _thread.Connected  = true;
            _thread.Send(ServerLoginOk.ToPacket());

            Log.Info($"Server #{server.ServerId} connected");
        }
Example #3
0
        public override void RunImpl()
        {
            L2Server server = ServerThreadPool.Instance.Servers.FirstOrDefault(srv => srv.Code == _code);

            if (server == null)
            {
                Log.Error($"Code '{_code}' for server was not found. Closing");
                _thread.Close(ServerLoginFail.ToPacket("Code Error"));
                return;
            }

            server.Thread     = _thread;
            _thread.Id        = server.Id;
            _thread.Info      = _info;
            _thread.Wan       = _host;
            _thread.Port      = _port;
            _thread.Maxp      = _maxp;
            _thread.GmOnly    = _gmonly == 1;
            _thread.TestMode  = _test == 1;
            _thread.Connected = true;
            _thread.Send(ServerLoginOk.ToPacket());

            Log.Info($"AuthThread: Server #{server.Id} connected");
        }