public void AddReconnectionToken(InternalConnection connection, byte gsId, uint accountId, uint token) { if (!_tokens.ContainsKey(gsId)) { _tokens.Add(gsId, new Dictionary <uint, uint>()); } _tokens[gsId].Add(token, accountId); connection.SendPacket(new LGPlayerReconnectPacket(token)); }
public void Add(byte gsId, string ip, ushort port, InternalConnection connection) { if (!_gameServers.ContainsKey(gsId)) { connection.SendPacket(new LGRegisterGameServerPacket(GSRegisterResult.Error)); return; } var gameServer = _gameServers[gsId]; gameServer.Ip = ip; gameServer.Port = port; gameServer.Connection = connection; connection.GameServer = gameServer; connection.AddAttribute("gsId", gameServer.Id); gameServer.SendPacket(new LGRegisterGameServerPacket(GSRegisterResult.Success)); _log.Info("Registered GameServer {0}", gameServer.Id); }
public void Add(byte gsId, List <byte> mirrorsId, InternalConnection connection) { if (!_gameServers.ContainsKey(gsId)) { connection.SendPacket(new LGRegisterGameServerPacket(GSRegisterResult.Error)); return; } var gameServer = _gameServers[gsId]; gameServer.Connection = connection; gameServer.MirrorsId.AddRange(mirrorsId); connection.GameServer = gameServer; connection.AddAttribute("gsId", gameServer.Id); gameServer.SendPacket(new LGRegisterGameServerPacket(GSRegisterResult.Success)); foreach (var mirrorId in mirrorsId) { _gameServers[mirrorId].Connection = connection; _mirrorsId.Add(mirrorId, gsId); } _log.Info("Registered GameServer {0}", gameServer.Id); }