From 652ee58c136fcf1be706ab2602c636a2526e5732 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 3 Jun 2010 20:25:52 +0200 Subject: [PATCH] proto: Remove send_hello, do it inline. --- src/egs_game.erl | 4 ++-- src/egs_login.erl | 2 +- src/egs_proto.erl | 11 ----------- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/egs_game.erl b/src/egs_game.erl index 1fb924a..0cae8e7 100644 --- a/src/egs_game.erl +++ b/src/egs_game.erl @@ -45,7 +45,7 @@ accept(LSocket) -> ssl:ssl_accept(CSocket), try log(0, "hello (new connection)"), - egs_proto:send_hello(CSocket), + egs_proto:packet_send(CSocket, << 16#02020300:32, 0:352 >>), Pid = spawn_link(?MODULE, process, [CSocket, 0]), ssl:controlling_process(CSocket, Pid) catch @@ -626,7 +626,7 @@ handle(16#0b05, _, _, _, _) -> %% @doc Start mission handler. Packet contains the selected mission number. %% @todo Load more than one mission. -handle(16#0c01, CSocket, GID, _, Orig) -> +handle(16#0c01, CSocket, GID, _, _) -> Packet = << 16#0c020300:32, 0:160, 16#00011300:32, GID:32/little-unsigned-integer, 0:96 >>, egs_proto:packet_send(CSocket, Packet), mission_load(CSocket, GID, 1000013, 0, 1121, 0); % load test mission! diff --git a/src/egs_login.erl b/src/egs_login.erl index 58cb704..b19cd0e 100644 --- a/src/egs_login.erl +++ b/src/egs_login.erl @@ -58,7 +58,7 @@ accept(LSocket, SessionID) -> process(CSocket, SessionID) -> log(SessionID, "hello"), - egs_proto:send_hello(CSocket, SessionID), + egs_proto:packet_send(CSocket, << 16#02020300:32, 0:288, SessionID:32/little-unsigned-integer >>), ?MODULE:loop(CSocket, SessionID). %% @doc Main loop for the login server. diff --git a/src/egs_proto.erl b/src/egs_proto.erl index d6ca2cb..5d7a0fd 100644 --- a/src/egs_proto.erl +++ b/src/egs_proto.erl @@ -277,17 +277,6 @@ send_global(CSocket, Type, Message, Duration) -> ignore end. -%% @doc Say hello. Used by the game server where a temporary session ID isn't needed. - -send_hello(CSocket) -> - send_hello(CSocket, 0). - -%% @doc Say hello and send a temporary session ID to the client. Used by the login server. - -send_hello(CSocket, SessionID) -> - Packet = << 16#0202:16, 0:304, SessionID:32/little-unsigned-integer >>, - packet_send(CSocket, Packet). - %% @doc Init quest. send_init_quest(CSocket, GID, QuestID) ->