public int HandlePacket(ClientBase client, GamePacket packet) { string account = packet.ReadUTF(); ValidateLoginPacket pkg = new ValidateLoginPacket(); pkg.ClientID = ((GatewayClient)client).ClientID; pkg.Account = account; GatewayGlobal.Send2CacheServer(pkg); return(0); }
public int HandlePacket(ServerConnector connector, GamePacket packet) { uint id = packet.ReadUnsignedInt(); if (GatewayGlobal.ContainsBattleServer(id)) { return(0); } string ip = packet.ReadUTF(); int port = packet.ReadInt(); new BattleServerConnector(id, ip, port); return(0); }
public int HandlePacket(ClientBase client, GamePacket packet) { GatewayClient gc = client as GatewayClient; if (gc.Account.IsNullOrEmpty()) { return(0); } RegisteServerPacket pkg = new RegisteServerPacket(); pkg.ClientID = gc.ClientID; pkg.Account = gc.Account; pkg.NickName = packet.ReadUTF(); GatewayGlobal.Send2Center(pkg, client); return(0); }
public int HandlePacket(ClientBase client, GamePacket packet) { GatewayClient gc = client as GatewayClient; gc.LogicServer = GatewayGlobal.GetFreeLogicServer(gc); if (gc.LogicServer == null) { return(0); } string account = packet.ReadUTF(); gc.Account = account; ValidateLoginPacket pkg = new ValidateLoginPacket(); pkg.ClientID = gc.ClientID; pkg.Account = account; GatewayGlobal.Send2Center(pkg, client); return(0); }
public int HandlePacket(ServerConnector connector, GamePacket packet) { GatewayGlobal.Send2Center(packet, null); return(0); }