Get rid of psu_area; use a normal tuple instead (for now).
This commit is contained in:
parent
05149483c8
commit
098ad5243a
@ -23,6 +23,12 @@
|
||||
|
||||
%% EGS types.
|
||||
|
||||
-type questid() :: 0..16#ffffffff. %% @todo What's the real max?
|
||||
-type zoneid() :: 0..16#ffff. %% @todo What's the real max?
|
||||
-type mapid() :: 0..9999.
|
||||
-type entryid() :: 0..16#ffff. %% @todo What's the real max?
|
||||
|
||||
-type area() :: {questid(), zoneid(), mapid()}.
|
||||
-type position() :: {X :: float(), Y :: float(), Z :: float(), Dir :: float()}.
|
||||
|
||||
%% Records.
|
||||
@ -46,10 +52,6 @@
|
||||
auth_state :: undefined | {wait_for_authentication, binary(), any()}
|
||||
}).
|
||||
|
||||
%% @doc Character area location data structure.
|
||||
%% @todo Review.
|
||||
-record(psu_area, {questid, zoneid, mapid}).
|
||||
|
||||
%% @doc Table containing the users currently logged in.
|
||||
%% @todo Probably can use a "param" or "extra" field to store the game-specific information (for things that don't need to be queried).
|
||||
-record(users, {
|
||||
@ -64,12 +66,12 @@
|
||||
instancepid :: pid(),
|
||||
partypid :: pid(),
|
||||
areatype :: counter | mission | lobby | myroom | spaceport,
|
||||
area :: {psu_area, 0..16#ffffffff, 0..16#ffff, 0..9999},
|
||||
entryid :: 0..16#ffff,
|
||||
area :: area(),
|
||||
entryid :: entryid(),
|
||||
pos = {0.0, 0.0, 0.0, 0.0} :: position(),
|
||||
shopid :: integer(),
|
||||
prev_area = #psu_area{questid=0, zoneid=0, mapid=0} :: {psu_area, 0..16#ffffffff, 0..16#ffff, 0..9999},
|
||||
prev_entryid = 0 :: 0..16#ffff,
|
||||
prev_area = {0, 0, 0} :: area(),
|
||||
prev_entryid = 0 :: entryid(),
|
||||
%% To be moved or deleted later on.
|
||||
setid = 0 :: non_neg_integer() %% @todo Current area's set number. Move that to psu_instance probably.
|
||||
}).
|
||||
|
@ -78,7 +78,7 @@ event({char_select_enter, Slot, _BackToPreviousField}, State=#state{gid=GID}) ->
|
||||
Character = #characters{slot=Slot, name=Name, race=Race, gender=Gender, class=Class, appearance=Appearance, options=Options}, % TODO: temporary set the slot here, won't be needed later
|
||||
UniID = egs_universes:defaultid(),
|
||||
egs_universes:enter(UniID),
|
||||
User2 = User#users{uni=UniID, character=Character, area=#psu_area{questid=1100000, zoneid=0, mapid=4}, entryid=0},
|
||||
User2 = User#users{uni=UniID, character=Character, area={1100000, 0, 4}, entryid=0},
|
||||
egs_users:write(User2),
|
||||
egs_users:item_add(GID, 16#11010000, #psu_special_item_variables{}),
|
||||
egs_users:item_add(GID, 16#11020000, #psu_special_item_variables{}),
|
||||
|
@ -64,7 +64,7 @@ cast(16#0503, Data, State=#state{gid=GID}) ->
|
||||
QuestID:32/little-unsigned-integer, ZoneID:32/little-unsigned-integer, MapID:32/little-unsigned-integer, EntryID:32/little-unsigned-integer, _:32 >> = Data,
|
||||
FloatDir = Dir / 46603.375,
|
||||
{ok, User} = egs_users:read(GID),
|
||||
NewUser = User#users{pos={X, Y, Z, FloatDir}, area=#psu_area{questid=QuestID, zoneid=ZoneID, mapid=MapID}, entryid=EntryID},
|
||||
NewUser = User#users{pos={X, Y, Z, FloatDir}, area={QuestID, ZoneID, MapID}, entryid=EntryID},
|
||||
egs_users:write(NewUser),
|
||||
cast(valid, Data, State);
|
||||
|
||||
@ -75,7 +75,7 @@ cast(16#0514, Data, State=#state{gid=GID}) ->
|
||||
MapID:32/little-unsigned-integer, EntryID:32/little-unsigned-integer, _/bits >> = Data,
|
||||
FloatDir = Dir / 46603.375,
|
||||
{ok, User} = egs_users:read(GID),
|
||||
NewUser = User#users{pos={X, Y, Z, FloatDir}, area=#psu_area{questid=QuestID, zoneid=ZoneID, mapid=MapID}, entryid=EntryID},
|
||||
NewUser = User#users{pos={X, Y, Z, FloatDir}, area={QuestID, ZoneID, MapID}, entryid=EntryID},
|
||||
egs_users:write(NewUser),
|
||||
cast(valid, Data, State);
|
||||
|
||||
@ -114,7 +114,7 @@ raw(16#0402, << _:352, Data/bits >>, #state{gid=GID}) ->
|
||||
7 -> % spawn cleared @todo 1201 sent back with same values apparently, but not always
|
||||
log("cleared spawn ~b", [SpawnID]),
|
||||
{ok, User} = egs_users:read(GID),
|
||||
{BlockID, EventID} = psu_instance:spawn_cleared_event(User#users.instancepid, (User#users.area)#psu_area.zoneid, SpawnID),
|
||||
{BlockID, EventID} = psu_instance:spawn_cleared_event(User#users.instancepid, element(2, User#users.area), SpawnID),
|
||||
if EventID =:= false -> ignore;
|
||||
true -> psu_game:send_1205(EventID, BlockID, 0)
|
||||
end;
|
||||
@ -216,9 +216,8 @@ event({area_change, QuestID, ZoneID, MapID, EntryID, PartyPos}, State) ->
|
||||
%% @todo The area_load function should probably not change the user's values.
|
||||
%% @todo Remove that ugly code when the above is done.
|
||||
event(char_load_complete, State=#state{gid=GID}) ->
|
||||
{ok, User=#users{area=#psu_area{questid=QuestID, zoneid=ZoneID, mapid=MapID},
|
||||
entryid=EntryID}} = egs_users:read(GID),
|
||||
egs_users:write(User#users{area=#psu_area{questid=0, zoneid=0, mapid=0}, entryid=0}),
|
||||
{ok, User=#users{area={QuestID, ZoneID, MapID}, entryid=EntryID}} = egs_users:read(GID),
|
||||
egs_users:write(User#users{area={0, 0, 0}, entryid=0}),
|
||||
event({area_change, QuestID, ZoneID, MapID, EntryID}, State);
|
||||
|
||||
%% @doc Chat broadcast handler. Dispatch the message to everyone (for now).
|
||||
@ -257,9 +256,8 @@ event(counter_background_locations_request, _State) ->
|
||||
event({counter_enter, CounterID, FromZoneID, FromMapID, FromEntryID}, State=#state{gid=GID}) ->
|
||||
log("counter load ~b", [CounterID]),
|
||||
{ok, OldUser} = egs_users:read(GID),
|
||||
OldArea = OldUser#users.area,
|
||||
FromArea = {psu_area, OldArea#psu_area.questid, FromZoneID, FromMapID},
|
||||
User = OldUser#users{areatype=counter, area={psu_area, 16#7fffffff, 0, 0}, entryid=0, prev_area=FromArea, prev_entryid=FromEntryID},
|
||||
FromArea = {element(1, OldUser#users.area), FromZoneID, FromMapID},
|
||||
User = OldUser#users{areatype=counter, area={16#7fffffff, 0, 0}, entryid=0, prev_area=FromArea, prev_entryid=FromEntryID},
|
||||
egs_users:write(User),
|
||||
QuestData = egs_quests_db:quest(0),
|
||||
{ok, ZoneData} = file:read_file("data/lobby/counter.zone.nbl"),
|
||||
@ -303,7 +301,7 @@ event(counter_join_party_request, State) ->
|
||||
event(counter_leave, State=#state{gid=GID}) ->
|
||||
{ok, User} = egs_users:read(GID),
|
||||
PrevArea = User#users.prev_area,
|
||||
event({area_change, PrevArea#psu_area.questid, PrevArea#psu_area.zoneid, PrevArea#psu_area.mapid, User#users.prev_entryid}, State);
|
||||
event({area_change, element(1, PrevArea), element(2, PrevArea), element(3, PrevArea), User#users.prev_entryid}, State);
|
||||
|
||||
%% @doc Send the code for the background image to use. But there's more that should be sent though.
|
||||
%% @todo Apparently background values 1 2 3 are never used on official servers. Find out why.
|
||||
@ -455,7 +453,7 @@ event(mission_abort, State=#state{gid=GID}) ->
|
||||
%% map change
|
||||
if User#users.areatype =:= mission ->
|
||||
PrevArea = User#users.prev_area,
|
||||
event({area_change, PrevArea#psu_area.questid, PrevArea#psu_area.zoneid, PrevArea#psu_area.mapid, User#users.prev_entryid}, State);
|
||||
event({area_change, element(1, PrevArea), element(2, PrevArea), element(3, PrevArea), User#users.prev_entryid}, State);
|
||||
true -> ignore
|
||||
end;
|
||||
|
||||
@ -627,7 +625,7 @@ event({object_event_trigger, BlockID, EventID}, _State) ->
|
||||
|
||||
event({object_goggle_target_activate, ObjectID}, #state{gid=GID}) ->
|
||||
{ok, User} = egs_users:read(GID),
|
||||
{BlockID, EventID} = psu_instance:std_event(User#users.instancepid, (User#users.area)#psu_area.zoneid, ObjectID),
|
||||
{BlockID, EventID} = psu_instance:std_event(User#users.instancepid, element(2, User#users.area), ObjectID),
|
||||
psu_game:send_1205(EventID, BlockID, 0),
|
||||
psu_game:send_1213(ObjectID, 8);
|
||||
|
||||
@ -647,38 +645,38 @@ event({object_healing_pad_tick, [_PartyPos]}, State=#state{gid=GID}) ->
|
||||
|
||||
event({object_key_console_enable, ObjectID}, #state{gid=GID}) ->
|
||||
{ok, User} = egs_users:read(GID),
|
||||
{BlockID, [EventID|_]} = psu_instance:std_event(User#users.instancepid, (User#users.area)#psu_area.zoneid, ObjectID),
|
||||
{BlockID, [EventID|_]} = psu_instance:std_event(User#users.instancepid, element(2, User#users.area), ObjectID),
|
||||
psu_game:send_1205(EventID, BlockID, 0),
|
||||
psu_game:send_1213(ObjectID, 1);
|
||||
|
||||
event({object_key_console_init, ObjectID}, #state{gid=GID}) ->
|
||||
{ok, User} = egs_users:read(GID),
|
||||
{BlockID, [_, EventID, _]} = psu_instance:std_event(User#users.instancepid, (User#users.area)#psu_area.zoneid, ObjectID),
|
||||
{BlockID, [_, EventID, _]} = psu_instance:std_event(User#users.instancepid, element(2, User#users.area), ObjectID),
|
||||
psu_game:send_1205(EventID, BlockID, 0);
|
||||
|
||||
event({object_key_console_open_gate, ObjectID}, #state{gid=GID}) ->
|
||||
{ok, User} = egs_users:read(GID),
|
||||
{BlockID, [_, _, EventID]} = psu_instance:std_event(User#users.instancepid, (User#users.area)#psu_area.zoneid, ObjectID),
|
||||
{BlockID, [_, _, EventID]} = psu_instance:std_event(User#users.instancepid, element(2, User#users.area), ObjectID),
|
||||
psu_game:send_1205(EventID, BlockID, 0),
|
||||
psu_game:send_1213(ObjectID, 1);
|
||||
|
||||
%% @todo Now that it's separate from object_key_console_enable, handle it better than that, don't need a list of events.
|
||||
event({object_key_enable, ObjectID}, #state{gid=GID}) ->
|
||||
{ok, User} = egs_users:read(GID),
|
||||
{BlockID, [EventID|_]} = psu_instance:std_event(User#users.instancepid, (User#users.area)#psu_area.zoneid, ObjectID),
|
||||
{BlockID, [EventID|_]} = psu_instance:std_event(User#users.instancepid, element(2, User#users.area), ObjectID),
|
||||
psu_game:send_1205(EventID, BlockID, 0),
|
||||
psu_game:send_1213(ObjectID, 1);
|
||||
|
||||
%% @todo Some switch objects apparently work differently, like the light switch in Mines in MAG'.
|
||||
event({object_switch_off, ObjectID}, #state{gid=GID}) ->
|
||||
{ok, User} = egs_users:read(GID),
|
||||
{BlockID, EventID} = psu_instance:std_event(User#users.instancepid, (User#users.area)#psu_area.zoneid, ObjectID),
|
||||
{BlockID, EventID} = psu_instance:std_event(User#users.instancepid, element(2, User#users.area), ObjectID),
|
||||
psu_game:send_1205(EventID, BlockID, 1),
|
||||
psu_game:send_1213(ObjectID, 0);
|
||||
|
||||
event({object_switch_on, ObjectID}, #state{gid=GID}) ->
|
||||
{ok, User} = egs_users:read(GID),
|
||||
{BlockID, EventID} = psu_instance:std_event(User#users.instancepid, (User#users.area)#psu_area.zoneid, ObjectID),
|
||||
{BlockID, EventID} = psu_instance:std_event(User#users.instancepid, element(2, User#users.area), ObjectID),
|
||||
psu_game:send_1205(EventID, BlockID, 0),
|
||||
psu_game:send_1213(ObjectID, 1);
|
||||
|
||||
@ -691,7 +689,7 @@ event({object_vehicle_boost_respawn, ObjectID}, _State) ->
|
||||
%% @todo Second send_1211 argument should be User#users.lid. Fix when it's correctly handled.
|
||||
event({object_warp_take, BlockID, ListNb, ObjectNb}, #state{gid=GID}) ->
|
||||
{ok, User} = egs_users:read(GID),
|
||||
Pos = psu_instance:warp_event(User#users.instancepid, (User#users.area)#psu_area.zoneid, BlockID, ListNb, ObjectNb),
|
||||
Pos = psu_instance:warp_event(User#users.instancepid, element(2, User#users.area), BlockID, ListNb, ObjectNb),
|
||||
NewUser = User#users{pos=Pos},
|
||||
egs_users:write(NewUser),
|
||||
psu_game:send_0503(User#users.pos),
|
||||
@ -735,7 +733,7 @@ event(player_death, State=#state{gid=GID}) ->
|
||||
event(player_death_return_to_lobby, State=#state{gid=GID}) ->
|
||||
{ok, User} = egs_users:read(GID),
|
||||
PrevArea = User#users.prev_area,
|
||||
event({area_change, PrevArea#psu_area.questid, PrevArea#psu_area.zoneid, PrevArea#psu_area.mapid, User#users.prev_entryid}, State);
|
||||
event({area_change, element(1, PrevArea), element(2, PrevArea), element(3, PrevArea), User#users.prev_entryid}, State);
|
||||
|
||||
event(player_type_availability_request, State) ->
|
||||
psu_proto:send_1a07(State);
|
||||
@ -757,7 +755,7 @@ event({unicube_select, Selection, EntryID}, State=#state{gid=GID}) ->
|
||||
case Selection of
|
||||
16#ffffffff ->
|
||||
UniID = egs_universes:myroomid(),
|
||||
User2 = User#users{uni=UniID, area=#psu_area{questid=1120000, zoneid=0, mapid=100}, entryid=0};
|
||||
User2 = User#users{uni=UniID, area={1120000, 0, 100}, entryid=0};
|
||||
_ ->
|
||||
UniID = Selection,
|
||||
User2 = User#users{uni=UniID, entryid=EntryID}
|
||||
|
@ -68,7 +68,7 @@ handle_call({create, NPCid, BaseLevel}, _From, State) ->
|
||||
UCS2Name = << TmpUCS2Name/binary, 0:Padding >>,
|
||||
Character = #characters{gid=NPCGID, slot=0, type=npc, npcid=NPCid, name=UCS2Name, race=Race, gender=Gender, class=Class, appearance=Appearance,
|
||||
mainlevel={level, calc_level(BaseLevel, LevelDiff), 0}, blastbar=0, luck=2, money=0, playtime=0, stats={stats, 0, 0, 0, 0, 0, 0, 0}, se=[], currenthp=100, maxhp=100},
|
||||
User = #users{id=NPCGID, character=Character, areatype=lobby, area={psu_area, 0, 0, 0}, entryid=0},
|
||||
User = #users{id=NPCGID, character=Character, areatype=lobby, area={0, 0, 0}, entryid=0},
|
||||
{reply, User, State};
|
||||
|
||||
handle_call(stop, _From, State) ->
|
||||
|
@ -45,8 +45,8 @@ character_tuple_to_binary(Tuple) ->
|
||||
%% @todo The value before IntDir seems to be the player's current animation. 01 stand up, 08 ?, 17 normal sit
|
||||
|
||||
character_user_to_binary(User) ->
|
||||
#users{id=CharGID, lid=CharLID, character=Character, pos={X, Y, Z, Dir}, area={psu_area, QuestID, ZoneID, MapID}, entryid=EntryID,
|
||||
prev_area={psu_area, PrevQuestID, PrevZoneID, PrevMapID}, prev_entryid=PrevEntryID} = User,
|
||||
#users{id=CharGID, lid=CharLID, character=Character, pos={X, Y, Z, Dir}, area={QuestID, ZoneID, MapID}, entryid=EntryID,
|
||||
prev_area={PrevQuestID, PrevZoneID, PrevMapID}, prev_entryid=PrevEntryID} = User,
|
||||
#characters{npcid=NPCid, type=Type, mainlevel=Level, stats=Stats, se=SE, currenthp=CurrentHP, maxhp=MaxHP} = Character,
|
||||
#level{number=LV} = Level,
|
||||
CharBin = psu_characters:character_tuple_to_binary(Character),
|
||||
|
@ -85,14 +85,14 @@ area_load(QuestID, ZoneID, MapID, EntryID, State) ->
|
||||
{RetPid, RetSetID};
|
||||
true -> {OldUser#users.instancepid, OldUser#users.setid}
|
||||
end,
|
||||
User = OldUser#users{instancepid=InstancePid, areatype=AreaType, area={psu_area, QuestID, RealZoneID, RealMapID}, entryid=RealEntryID},
|
||||
User = OldUser#users{instancepid=InstancePid, areatype=AreaType, area={QuestID, RealZoneID, RealMapID}, entryid=RealEntryID},
|
||||
egs_users:write(User),
|
||||
RealSetID = if SetID > NbSetsInZone - 1 -> NbSetsInZone - 1; true -> SetID end,
|
||||
area_load(AreaType, IsStart, RealSetID, OldUser, User, QuestData, ZoneData, AreaName, State).
|
||||
|
||||
area_load(AreaType, IsStart, SetID, OldUser, User, QuestData, ZoneData, AreaName, State) ->
|
||||
#psu_area{questid=OldQuestID, zoneid=OldZoneID} = OldUser#users.area,
|
||||
#psu_area{questid=QuestID, zoneid=ZoneID, mapid=_MapID} = User#users.area,
|
||||
{OldQuestID, OldZoneID, _OldMapID} = OldUser#users.area,
|
||||
{QuestID, ZoneID, _MapID} = User#users.area,
|
||||
QuestChange = if OldQuestID /= QuestID, QuestData /= undefined -> true; true -> false end,
|
||||
if ZoneData =:= undefined ->
|
||||
ZoneChange = false;
|
||||
@ -200,7 +200,7 @@ npc_load(Leader, [{PartyPos, NPCGID}|NPCList], State) ->
|
||||
#users{instancepid=InstancePid, area=Area, entryid=EntryID, pos=Pos} = Leader,
|
||||
NPCUser = OldNPCUser#users{lid=PartyPos, instancepid=InstancePid, areatype=mission, area=Area, entryid=EntryID, pos=Pos},
|
||||
%% @todo This one on mission end/abort?
|
||||
%~ OldNPCUser#users{lid=PartyPos, instancepid=undefined, areatype=AreaType, area={psu_area, 0, 0, 0}, entryid=0, pos={0.0, 0.0, 0.0, 0}}
|
||||
%~ OldNPCUser#users{lid=PartyPos, instancepid=undefined, areatype=AreaType, area={0, 0, 0}, entryid=0, pos={0.0, 0.0, 0.0, 0}}
|
||||
egs_users:write(NPCUser),
|
||||
psu_proto:send_010d(NPCUser, State),
|
||||
psu_proto:send_0201(NPCUser, State),
|
||||
@ -263,7 +263,7 @@ send_022c(A, B) ->
|
||||
%% @todo The value before IntDir seems to be the player's current animation. 01 stand up, 08 ?, 17 normal sit
|
||||
send_0503({PrevX, PrevY, PrevZ, _AnyDir}) ->
|
||||
{ok, User} = egs_users:read(get(gid)),
|
||||
#users{id=GID, pos={X, Y, Z, Dir}, area=#psu_area{questid=QuestID, zoneid=ZoneID, mapid=MapID}, entryid=EntryID} = User,
|
||||
#users{id=GID, pos={X, Y, Z, Dir}, area={QuestID, ZoneID, MapID}, entryid=EntryID} = User,
|
||||
IntDir = trunc(Dir * 182.0416),
|
||||
send(<< 16#05030300:32, 0:64, GID:32/little-unsigned-integer, 0:64, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, GID:32/little-unsigned-integer, 0:32,
|
||||
16#1000:16, IntDir:16/little-unsigned-integer, PrevX:32/little-float, PrevY:32/little-float, PrevZ:32/little-float, X:32/little-float, Y:32/little-float, Z:32/little-float,
|
||||
@ -406,7 +406,7 @@ send_1004(Type, User, PartyPos) ->
|
||||
end,
|
||||
|
||||
UserGID = get(gid),
|
||||
#users{id=GID, character=Character, area={psu_area, QuestID, ZoneID, MapID}, entryid=EntryID} = User,
|
||||
#users{id=GID, character=Character, area={QuestID, ZoneID, MapID}, entryid=EntryID} = User,
|
||||
#characters{npcid=NPCid, name=Name, mainlevel=MainLevel} = Character,
|
||||
Level = MainLevel#level.number,
|
||||
send(<< 16#10040300:32, 16#ffff0000:32, 0:128, 16#00011300:32, UserGID:32/little-unsigned-integer, 0:64,
|
||||
|
@ -55,7 +55,7 @@ warp_event(InstancePid, ZoneID, BlockID, ListIndex, ObjectIndex) ->
|
||||
|
||||
%% @todo @spec hit(ServerPid, TargetID, Args) -> Response
|
||||
hit(User, SourceID, TargetID) ->
|
||||
gen_server:call(User#users.instancepid, {hit, (User#users.area)#psu_area.zoneid, User, SourceID, TargetID}).
|
||||
gen_server:call(User#users.instancepid, {hit, element(2, User#users.area), User, SourceID, TargetID}).
|
||||
|
||||
%% gen_server.
|
||||
|
||||
|
@ -1291,7 +1291,7 @@ send_0204(User, #state{socket=Socket, gid=DestGID}) ->
|
||||
|
||||
%% @doc Make the client load a new map.
|
||||
send_0205(CharUser, IsSeasonal, #state{socket=Socket, gid=DestGID, lid=DestLID, areanb=AreaNb}) ->
|
||||
#users{lid=CharLID, area=#psu_area{zoneid=ZoneID, mapid=MapID}, entryid=EntryID} = CharUser,
|
||||
#users{lid=CharLID, area={_QuestID, ZoneID, MapID}, entryid=EntryID} = CharUser,
|
||||
packet_send(Socket, << 16#02050300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:64,
|
||||
16#ffffffff:32, ZoneID:32/little, MapID:32/little, EntryID:32/little, AreaNb:32/little, CharLID:16/little, 0:8, IsSeasonal:8 >>).
|
||||
|
||||
@ -1450,7 +1450,7 @@ send_0a11(ItemID, ItemDesc, #state{socket=Socket, gid=DestGID, lid=DestLID}) ->
|
||||
%% @doc Quest init.
|
||||
%% @todo When first entering a zone it seems LID should be set to ffff apparently.
|
||||
send_0c00(CharUser, #state{socket=Socket, gid=DestGID, lid=DestLID}) ->
|
||||
#users{area=#psu_area{questid=QuestID}} = CharUser,
|
||||
#users{area={QuestID, _ZoneID, _MapID}} = CharUser,
|
||||
packet_send(Socket, << 16#0c000300:32, DestLID:16/little, 0:144, 16#00011300:32, DestGID:32/little, 0:64, QuestID:32/little,
|
||||
16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32,
|
||||
16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32, 16#ffffffff:32,
|
||||
@ -1524,7 +1524,7 @@ send_100e(CounterID, AreaName, #state{socket=Socket, gid=DestGID}) ->
|
||||
CounterType = if CounterID =:= 16#ffffffff -> 2; true -> 1 end,
|
||||
packet_send(Socket, << 16#100e0300:32, 16#ffffffbf:32, 0:128, 16#00011300:32, DestGID:32, 0:64,
|
||||
1, PartyPos, 0:48, 16#ffffff7f:32, UCS2Name/binary, 0:Padding, 0:32, CounterID:32/little, CounterType:32/little >>).
|
||||
send_100e(#psu_area{questid=QuestID, zoneid=ZoneID, mapid=MapID}, EntryID, AreaName, #state{socket=Socket, gid=DestGID}) ->
|
||||
send_100e({QuestID, ZoneID, MapID}, EntryID, AreaName, #state{socket=Socket, gid=DestGID}) ->
|
||||
PartyPos = 0,
|
||||
UCS2Name = << << X:8, 0:8 >> || X <- AreaName >>,
|
||||
Padding = 8 * (64 - byte_size(UCS2Name)),
|
||||
|
Loading…
Reference in New Issue
Block a user