diff --git a/src/egs_login.erl b/src/egs_login.erl index 30255de..ccebaf2 100644 --- a/src/egs_login.erl +++ b/src/egs_login.erl @@ -71,10 +71,7 @@ event({system_client_version_info, _Entrance, _Language, _Platform, Version}, #s %% Game server info request handler. %% @todo Remove the dependency on network.hrl through configuration files. event(system_game_server_request, #state{socket=Socket, gid=GID}) -> - IP = ?GAME_IP, - Port = ?GAME_PORT, - Packet = << 16#02160300:32, 0:192, GID:32/little-unsigned-integer, 0:64, IP/binary, Port:32/little-unsigned-integer >>, - psu_proto:packet_send(Socket, Packet), + psu_proto:send_0216(Socket, GID, ?GAME_IP, ?GAME_PORT), ssl:close(Socket), closed; diff --git a/src/psu/psu_proto.erl b/src/psu/psu_proto.erl index 67c7d1f..1db4e74 100644 --- a/src/psu/psu_proto.erl +++ b/src/psu/psu_proto.erl @@ -1220,6 +1220,10 @@ send_0215(DestUser, UnknownValue) -> #egs_user_model{socket=CSocket, id=GID, lid=LID} = DestUser, packet_send(CSocket, << 16#02150300:32, LID:16/little, 0:144, 16#00011300:32, GID:32/little, 0:64, UnknownValue:32/little >>). +%% @doc Send the game server's IP and port that the client requested. +send_0216(DestSocket, SessionID, IP, Port) -> + packet_send(DestSocket, << 16#02160300:32, 16#ffff:16, 0:144, 16#00000f00:32, SessionID:32/little, 0:64, IP/binary, Port:16/little, 0:16 >>). + %% @todo Inventory related. Doesn't seem to do anything. send_0a05(DestUser) -> #egs_user_model{socket=CSocket, id=GID, lid=LID} = DestUser,