Parameterize the game server IP.

Ready for an initial buggy public test.
This commit is contained in:
Loïc Hoguin 2010-05-15 01:58:25 +02:00
parent ddf13edfc7
commit 9ad0e2d771
3 changed files with 4 additions and 3 deletions

View File

@ -27,5 +27,6 @@
-define(LOGIN_PORT_US, 12230). -define(LOGIN_PORT_US, 12230).
-define(LOGIN_LISTEN_OPTIONS, [binary, {active, false}, {certfile, "ssl/servercert.pem"}, {keyfile, "ssl/serverkey.pem"}, {password, "alpha"}]). -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_PORT, 12061).
-define(GAME_LISTEN_OPTIONS, [binary, {active, false}, {certfile, "ssl/servercert.pem"}, {keyfile, "ssl/serverkey.pem"}, {password, "alpha"}]). -define(GAME_LISTEN_OPTIONS, [binary, {active, false}, {certfile, "ssl/servercert.pem"}, {keyfile, "ssl/serverkey.pem"}, {password, "alpha"}]).

View File

@ -84,7 +84,7 @@ loop(CSocket, SessionID) ->
handle(16#0217, CSocket, SessionID, _) -> handle(16#0217, CSocket, SessionID, _) ->
log(SessionID, "send game server info"), 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), ssl:close(CSocket),
closed; closed;

View File

@ -233,8 +233,8 @@ send_flags(CSocket, GID) ->
%% @doc Send the IP and port of the game server the player is sent to. %% @doc Send the IP and port of the game server the player is sent to.
send_game_server_info(CSocket, GID, Port) -> send_game_server_info(CSocket, GID, IP, Port) ->
Packet = << 16#0216:16, 0:208, GID:32/little-unsigned-integer, 0:64, << 192, 168, 1, 13 >>/binary, Port:32/little-unsigned-integer >>, Packet = << 16#0216:16, 0:208, GID:32/little-unsigned-integer, 0:64, IP/binary, Port:32/little-unsigned-integer >>,
packet_send(CSocket, Packet). packet_send(CSocket, Packet).
%% @doc Say hello. Used by the game server where a temporary session ID isn't needed. %% @doc Say hello. Used by the game server where a temporary session ID isn't needed.