psu_proto: Review send_0202 and move it to psu_proto.
This commit is contained in:
parent
4e39ebefae
commit
1447048dd9
@ -84,7 +84,7 @@ accept(LSocket, MPid) ->
|
|||||||
process_init(CSocket, MPid) ->
|
process_init(CSocket, MPid) ->
|
||||||
link(MPid),
|
link(MPid),
|
||||||
put(socket, CSocket),
|
put(socket, CSocket),
|
||||||
send_0202(),
|
psu_proto:send_0202(CSocket, 0),
|
||||||
timer:send_interval(5000, {psu_keepalive}),
|
timer:send_interval(5000, {psu_keepalive}),
|
||||||
process().
|
process().
|
||||||
|
|
||||||
@ -1184,10 +1184,6 @@ send_0200(ZoneType) ->
|
|||||||
end,
|
end,
|
||||||
send(<< (header(16#0200))/binary, 0:32, 16#01000000:32, 16#ffffffff:32, Var/binary, 16#ffffffff:32, 16#ffffffff:32 >>).
|
send(<< (header(16#0200))/binary, 0:32, 16#01000000:32, 16#ffffffff:32, Var/binary, 16#ffffffff:32, 16#ffffffff:32 >>).
|
||||||
|
|
||||||
%% @doc Hello packet, always sent on client connection.
|
|
||||||
send_0202() ->
|
|
||||||
send(<< 16#02020300:32, 0:352 >>).
|
|
||||||
|
|
||||||
%% @todo Not sure. Used for unspawning, and more.
|
%% @todo Not sure. Used for unspawning, and more.
|
||||||
send_0204(DestUser, TargetUser, Action) ->
|
send_0204(DestUser, TargetUser, Action) ->
|
||||||
DestGID = DestUser#egs_user_model.id,
|
DestGID = DestUser#egs_user_model.id,
|
||||||
|
@ -59,7 +59,7 @@ accept(LSocket, SessionID) ->
|
|||||||
%% @doc Process the new connections. Send an hello packet and start the loop.
|
%% @doc Process the new connections. Send an hello packet and start the loop.
|
||||||
process(CSocket, SessionID) ->
|
process(CSocket, SessionID) ->
|
||||||
log(SessionID, "hello"),
|
log(SessionID, "hello"),
|
||||||
psu_proto:packet_send(CSocket, << 16#02020300:32, 0:288, SessionID:32/little-unsigned-integer >>),
|
psu_proto:send_0202(CSocket, SessionID),
|
||||||
?MODULE:loop(CSocket, SessionID).
|
?MODULE:loop(CSocket, SessionID).
|
||||||
|
|
||||||
%% @spec loop(CSocket, SessionID) -> ok
|
%% @spec loop(CSocket, SessionID) -> ok
|
||||||
|
@ -993,6 +993,11 @@ send_0201(DestUser, CharUser) ->
|
|||||||
packet_send(DestUser#egs_user_model.socket, << 16#02010300:32, 0:32, CharTypeID:32, CharGID:32/little-unsigned-integer,
|
packet_send(DestUser#egs_user_model.socket, << 16#02010300:32, 0:32, CharTypeID:32, CharGID:32/little-unsigned-integer,
|
||||||
0:64, 16#00011300:32, DestGID:32/little-unsigned-integer, 0:64, CharBin/binary, IsGM:8, 0:8, OnlineStatus:8, GameVersion:8, 0:608 >>).
|
0:64, 16#00011300:32, DestGID:32/little-unsigned-integer, 0:64, CharBin/binary, IsGM:8, 0:8, OnlineStatus:8, GameVersion:8, 0:608 >>).
|
||||||
|
|
||||||
|
%% @doc Hello command. Sent when a client connects to the game or login server.
|
||||||
|
%% @todo Can contain an error message if 0:1024 is setup similar to this: 0:32, 3:32/little, 0:48, Len:16/little, Error/binary, 0:Padding.
|
||||||
|
send_0202(DestSocket, SessionID) ->
|
||||||
|
packet_send(DestSocket, << 16#020203bf:32, 16#ffff:16, 0:272, SessionID:32/little, 0:1024 >>).
|
||||||
|
|
||||||
%% @doc Make the client load a new map.
|
%% @doc Make the client load a new map.
|
||||||
%% @todo We set a value of 1 and not 0 after EntryID because this value is never found to be 0.
|
%% @todo We set a value of 1 and not 0 after EntryID because this value is never found to be 0.
|
||||||
send_0205(DestUser, IsSeasonal) ->
|
send_0205(DestUser, IsSeasonal) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user