diff --git a/include/network.hrl b/include/network.hrl index de96360..054c97b 100644 --- a/include/network.hrl +++ b/include/network.hrl @@ -27,5 +27,6 @@ -define(LOGIN_PORT_US, 12230). -define(LOGIN_LISTEN_OPTIONS, [binary, {active, false}, {certfile, "ssl/servercert.pem"}, {keyfile, "ssl/serverkey.pem"}, {password, "alpha"}]). +-define(GAME_IP, << 192, 168, 1, 13 >>). -define(GAME_PORT, 12061). -define(GAME_LISTEN_OPTIONS, [binary, {active, false}, {certfile, "ssl/servercert.pem"}, {keyfile, "ssl/serverkey.pem"}, {password, "alpha"}]). diff --git a/src/egs_login.erl b/src/egs_login.erl index 3ad0766..b3efdff 100644 --- a/src/egs_login.erl +++ b/src/egs_login.erl @@ -84,7 +84,7 @@ loop(CSocket, SessionID) -> handle(16#0217, CSocket, SessionID, _) -> log(SessionID, "send game server info"), - egs_proto:send_game_server_info(CSocket, SessionID, ?GAME_PORT), + egs_proto:send_game_server_info(CSocket, SessionID, ?GAME_IP, ?GAME_PORT), ssl:close(CSocket), closed; diff --git a/src/egs_proto.erl b/src/egs_proto.erl index b2815e4..33f2d2e 100644 --- a/src/egs_proto.erl +++ b/src/egs_proto.erl @@ -233,8 +233,8 @@ send_flags(CSocket, GID) -> %% @doc Send the IP and port of the game server the player is sent to. -send_game_server_info(CSocket, GID, Port) -> - Packet = << 16#0216:16, 0:208, GID:32/little-unsigned-integer, 0:64, << 192, 168, 1, 13 >>/binary, Port:32/little-unsigned-integer >>, +send_game_server_info(CSocket, GID, IP, Port) -> + Packet = << 16#0216:16, 0:208, GID:32/little-unsigned-integer, 0:64, IP/binary, Port:32/little-unsigned-integer >>, packet_send(CSocket, Packet). %% @doc Say hello. Used by the game server where a temporary session ID isn't needed.