psu_game: Fix various LID issues.
This commit is contained in:
parent
ad9dede8bc
commit
3ac88d6d81
@ -339,12 +339,12 @@ area_load(AreaType, IsStart, SetID, OldUser, User, QuestFile, ZoneFile, AreaName
|
|||||||
true -> ignore
|
true -> ignore
|
||||||
end,
|
end,
|
||||||
if IsStart =:= true ->
|
if IsStart =:= true ->
|
||||||
psu_proto:send_0215(User, 16#ffffffff);
|
psu_proto:send_0215(User#egs_user_model{lid=0}, 16#ffffffff);
|
||||||
true -> ignore
|
true -> ignore
|
||||||
end,
|
end,
|
||||||
if ZoneChange =:= true ->
|
if ZoneChange =:= true ->
|
||||||
% load new zone
|
% load new zone
|
||||||
psu_proto:send_0a05(User),
|
psu_proto:send_0a05(User#egs_user_model{lid=0}),
|
||||||
if AreaType =:= lobby ->
|
if AreaType =:= lobby ->
|
||||||
send_0111(6, 0);
|
send_0111(6, 0);
|
||||||
true -> ignore
|
true -> ignore
|
||||||
@ -354,12 +354,12 @@ area_load(AreaType, IsStart, SetID, OldUser, User, QuestFile, ZoneFile, AreaName
|
|||||||
send_020f(ZoneFile, SetID, SeasonID);
|
send_020f(ZoneFile, SetID, SeasonID);
|
||||||
true -> ignore
|
true -> ignore
|
||||||
end,
|
end,
|
||||||
psu_proto:send_0205(User, IsSeasonal),
|
psu_proto:send_0205(User#egs_user_model{lid=0}, IsSeasonal),
|
||||||
send_100e(QuestID, ZoneID, (User#egs_user_model.area)#psu_area.mapid, AreaName, 16#ffffffff),
|
send_100e(QuestID, ZoneID, (User#egs_user_model.area)#psu_area.mapid, AreaName, 16#ffffffff),
|
||||||
if AreaType =:= mission ->
|
if AreaType =:= mission ->
|
||||||
psu_proto:send_0215(User, 0),
|
psu_proto:send_0215(User#egs_user_model{lid=0}, 0),
|
||||||
if IsStart =:= true ->
|
if IsStart =:= true ->
|
||||||
psu_proto:send_0215(User, 0),
|
psu_proto:send_0215(User#egs_user_model{lid=0}, 0),
|
||||||
send_0c09();
|
send_0c09();
|
||||||
true -> ignore
|
true -> ignore
|
||||||
end;
|
end;
|
||||||
@ -1248,17 +1248,19 @@ send_0208() ->
|
|||||||
send_020f(Filename, SetID, SeasonID) ->
|
send_020f(Filename, SetID, SeasonID) ->
|
||||||
{ok, File} = file:read_file(Filename),
|
{ok, File} = file:read_file(Filename),
|
||||||
Size = byte_size(File),
|
Size = byte_size(File),
|
||||||
send(<< 16#020f0300:32, 0:288, SetID, SeasonID, 0:16, Size:32/little-unsigned-integer, File/binary >>).
|
send(<< 16#020f0300:32, 16#ffff:16, 0:272, SetID, SeasonID, 0:16, Size:32/little-unsigned-integer, File/binary >>).
|
||||||
|
|
||||||
%% @doc Send the current UNIX time.
|
%% @doc Send the current UNIX time.
|
||||||
send_0210() ->
|
send_0210() ->
|
||||||
|
GID = get(gid),
|
||||||
CurrentTime = calendar:datetime_to_gregorian_seconds(calendar:now_to_universal_time(now()))
|
CurrentTime = calendar:datetime_to_gregorian_seconds(calendar:now_to_universal_time(now()))
|
||||||
- calendar:datetime_to_gregorian_seconds({{1970, 1, 1}, {0, 0, 0}}),
|
- calendar:datetime_to_gregorian_seconds({{1970, 1, 1}, {0, 0, 0}}),
|
||||||
send(<< (header(16#0210))/binary, 0:32, CurrentTime:32/little-unsigned-integer >>).
|
send(<< 16#02100300:32, 16#ffff:16, 0:144, 16#00011300:32, GID:32/little, 0:96, CurrentTime:32/little-unsigned-integer >>).
|
||||||
|
|
||||||
%% @todo End of character loading. Just send it.
|
%% @todo End of character loading. Just send it.
|
||||||
send_021b() ->
|
send_021b() ->
|
||||||
send(header(16#021b)).
|
GID = get(gid),
|
||||||
|
send(<< 16#021b0300:32, 16#ffff:16, 0:144, 16#00011300:32, GID:32/little, 0:64 >>).
|
||||||
|
|
||||||
%% @doc Send the list of available universes.
|
%% @doc Send the list of available universes.
|
||||||
send_021e() ->
|
send_021e() ->
|
||||||
@ -1472,9 +1474,10 @@ send_1006(EventID, PartyPos) ->
|
|||||||
|
|
||||||
%% @doc Send the player's current location.
|
%% @doc Send the player's current location.
|
||||||
send_100e(QuestID, ZoneID, MapID, Location, CounterID) ->
|
send_100e(QuestID, ZoneID, MapID, Location, CounterID) ->
|
||||||
|
GID = get(gid),
|
||||||
UCS2Location = << << X:8, 0:8 >> || X <- Location >>,
|
UCS2Location = << << X:8, 0:8 >> || X <- Location >>,
|
||||||
Packet = << (header(16#100e))/binary, 1:32/little-unsigned-integer, MapID:16/little-unsigned-integer,
|
Packet = << 16#100e0300:32, 16#ffffffbf:32, 0:128, 16#00011300:32, GID:32/little, 0:64,
|
||||||
ZoneID:16/little-unsigned-integer, QuestID:32/little-unsigned-integer, UCS2Location/binary >>,
|
1:32/little, MapID:16/little, ZoneID:16/little, QuestID:32/little, UCS2Location/binary >>,
|
||||||
PaddingSize = (128 - byte_size(Packet) - 8) * 8,
|
PaddingSize = (128 - byte_size(Packet) - 8) * 8,
|
||||||
case CounterID of
|
case CounterID of
|
||||||
16#ffffffff ->
|
16#ffffffff ->
|
||||||
@ -1590,11 +1593,13 @@ send_1500(User) ->
|
|||||||
|
|
||||||
%% @todo Send an empty partner card list.
|
%% @todo Send an empty partner card list.
|
||||||
send_1501() ->
|
send_1501() ->
|
||||||
send(<< (header(16#1501))/binary, 0:32 >>).
|
GID = get(gid),
|
||||||
|
send(<< 16#15010300:32, 16#ffff:16, 0:144, 16#00011300:32, GID:32/little, 0:96 >>).
|
||||||
|
|
||||||
%% @todo Send an empty blacklist.
|
%% @todo Send an empty blacklist.
|
||||||
send_1512() ->
|
send_1512() ->
|
||||||
send(<< (header(16#1512))/binary, 0:46080 >>).
|
GID = get(gid),
|
||||||
|
send(<< 16#15120300:32, 16#ffff:16, 0:144, 16#00011300:32, GID:32/little, 0:46144 >>).
|
||||||
|
|
||||||
%% @todo NPC related packet, sent when there's an NPC in the area.
|
%% @todo NPC related packet, sent when there's an NPC in the area.
|
||||||
send_1601(PartyPos) ->
|
send_1601(PartyPos) ->
|
||||||
@ -1610,7 +1615,8 @@ send_1602() ->
|
|||||||
PMName = "My PM",
|
PMName = "My PM",
|
||||||
UCS2PMName = << << X:8, 0:8 >> || X <- PMName >>,
|
UCS2PMName = << << X:8, 0:8 >> || X <- PMName >>,
|
||||||
EndPaddingSize = 8 * (64 - byte_size(UCS2PMName)),
|
EndPaddingSize = 8 * (64 - byte_size(UCS2PMName)),
|
||||||
send(<< (header(16#1602))/binary, 0:32, Bin/binary, 0:MiddlePaddingSize, NbNPC, 0:24, UCS2PMName/binary, 0:EndPaddingSize >>).
|
GID = get(gid),
|
||||||
|
send(<< 16#16020300:32, 16#ffff:16, 0:144, 16#00011300:32, GID:32/little, 0:96, Bin/binary, 0:MiddlePaddingSize, NbNPC, 0:24, UCS2PMName/binary, 0:EndPaddingSize, 0:32 >>).
|
||||||
|
|
||||||
%% @doc Party information.
|
%% @doc Party information.
|
||||||
%% @todo Handle existing parties.
|
%% @todo Handle existing parties.
|
||||||
|
Loading…
Reference in New Issue
Block a user