anchor.diff:  
   %% @doc Movement (non-broadcast) handler. Do nothing.
   
  -handle(16#0102, _, _, _, _) ->
  +handle(16#0102, _) ->
   	ignore;
   
   %% @doc Weapon equip, unequip, item drop, and more... handler. Do what we can.
  
positive.code: 	end,
  	User = OldUser#users{instanceid=InstanceID, areatype=AreaType, questid=QuestID, zoneid=RealZoneID, mapid=RealMapID, entryid=RealEntryID},
  	egs_db:users_insert(User),
  	area_load(CSocket, GID, AreaType, IsStart, OldUser, User, QuestFile, ZoneFile, AreaName).
  
  area_load(CSocket, GID, AreaType, IsStart, OldUser, User, QuestFile, ZoneFile, AreaName) ->
  	[{status, 1}, {char, Char}, {options, Options}] = data_load(User#users.folder, User#users.charnumber),
  	QuestChange = if OldUser#users.questid /= User#users.questid, QuestFile /= undefined -> true; true -> false end,
  	if	ZoneFile =:= undefined ->
  
negative.code: 	if	QuestChange =:= true ->
  			% reload the character if entering or leaving the room quest
  			if	OldUser#users.questid =:= 1120000; User#users.questid =:= 1120000 ->
  					char_load(Char, Options, User#users.charnumber);
  				true -> ignore
  			end,
  			% load new quest
  			send_0c00(User#users.questid),
  			send_020e(QuestFile);
  		true -> ignore
  	end,
  	if	IsStart =:= true ->
  			send_0215(16#ffffffff);
  		true -> ignore
  	end,
  	if	ZoneChange =:= true ->
  			% load new zone
  			send_0a05(),
  			if AreaType =:= lobby ->
  					send_0111();
  				true -> ignore
  			end,
  			% 010d
  			send_0200(AreaType),
  			Layout = if IsStart =:= true -> crypto:rand_uniform(0, 4);
  				true -> 0
  			end,
  			send_020f(ZoneFile, Layout, Season);
  		true -> ignore
  	end,
  	send_0205(User#users.zoneid, User#users.mapid, User#users.entryid, IsSeasonal),
  	send_100e(User#users.questid, User#users.zoneid, User#users.mapid, AreaName, 16#ffffffff),
  	if	AreaType =:= mission ->
  			send_0215(0),
  			if	IsStart =:= true ->
  					send_0215(0),
  					send_0c09();
  				true -> ignore
  			end;
  		true ->
  			send_020c()
  	end,
  	case AreaType of
  		myroom ->
  			myroom_send_packet("p/packet1332.bin"),
  			send_1202(),
  			send_1204(),
  			send_1206();
  		mission ->
  			send_1202(),
  			send_1204(),
  			send_1206(),
  			send_1207();
  		_ -> ignore
  	end,
  	if	AreaType /= spaceport ->
  			send_1212();
  		true -> ignore
  	end,
  	if	AreaType =:= myroom ->
  			myroom_send_packet("p/packet1309.bin");
  		true -> ignore
  	end,
  	send_0201(User, Char),
  	if	ZoneChange =:= true ->
  			send_0a06();
  		true -> ignore
  	end,
  	send_0233(egs_db:users_select_others_in_area(User)),
  	send_0208(),
  	send_0236().
  
  myroom_send_packet(Filename) ->
  	{ok, << _:32, File/bits >>} = file:read_file(Filename),
  	send(File).
  
  %% @doc Game's main loop.
  
  loop(SoFar) ->
  	receive
  		{psu_broadcast, Orig} ->
  			<< A:64/bits, _:32, B:96/bits, _:64, C/bits >> = Orig,
  			GID = get(gid),
  			send(<< A/binary, 16#00011300:32, B/binary, 16#00011300:32, GID:32/little-unsigned-integer, C/binary >>),
  			?MODULE:loop(SoFar);
  		{psu_chat, ChatGID, ChatName, ChatModifiers, ChatMessage} ->
  			send_0304(ChatGID, ChatName, ChatModifiers, ChatMessage),
  			?MODULE:loop(SoFar);
  		{psu_keepalive} ->
  			egs_proto:send_keepalive(get(socket)),
  			?MODULE:loop(SoFar);
  		{psu_player_spawn, Spawn} ->
  			send_spawn(Spawn),
  			?MODULE:loop(SoFar);
  		{psu_player_unspawn, Spawn} ->
  			send_0204(Spawn#users.gid, Spawn#users.lid, 5),
  			?MODULE:loop(SoFar);
  		{ssl, _, Data} ->
  			{Packets, Rest} = egs_proto:packet_split(<< SoFar/bits, Data/bits >>),
  			[dispatch(Orig) || Orig <- Packets],
  			?MODULE:loop(Rest);
  		{ssl_closed, _} ->
  			exit(ssl_closed);
  		{ssl_error, _, _} ->
  			exit(ssl_error);
  		_ ->
  			?MODULE:loop(SoFar)
  	after 1000 ->
  		reload,
  		?MODULE:loop(SoFar)
  	end.
  
  %% @doc Dispatch the command to the right handler.
  
  dispatch(Orig) ->
  	{command, Command, Channel, Data} = egs_proto:packet_parse(Orig),
  	case Channel of
  		ignore -> ignore;
  		1 -> broadcast(Command, Orig);
  		_ -> handle(Command, Data)
  	end.
  
  %% @doc Position change broadcast handler. Save the position and then dispatch it.
  
  broadcast(16#0503, Orig) ->
  	<< 100:32/little-unsigned-integer, 16#050301:24/unsigned-integer, _:360, Direction:32/bits, Coords:96/bits, _:96,
  		QuestID:32/little-unsigned-integer, ZoneID:32/little-unsigned-integer, MapID:32/little-unsigned-integer,
  		EntryID:32/little-unsigned-integer, _:32 >> = Orig,
  	User = egs_db:users_select(get(gid)),
  	NewUser = User#users{direction=Direction, coords=Coords, questid=QuestID, zoneid=ZoneID, mapid=MapID, entryid=EntryID},
  	egs_db:users_insert(NewUser),
  	broadcast(default, Orig);
  
  %% @doc Stand still broadcast handler. Save the position and then dispatch it.
  
  broadcast(16#0514, Orig) ->
  	<< _:320, _:96, Direction:32/bits, Coords:96/bits, QuestID:32/little-unsigned-integer, ZoneID:32/little-unsigned-integer,
  		MapID:32/little-unsigned-integer, EntryID:32/little-unsigned-integer, _/bits >> = Orig,
  	User = egs_db:users_select(get(gid)),
  	NewUser = User#users{direction=Direction, coords=Coords, questid=QuestID, zoneid=ZoneID, mapid=MapID, entryid=EntryID},
  	egs_db:users_insert(NewUser),
  	broadcast(default, Orig);
  
  %% @doc Default broadcast handler. Dispatch the command to everyone.
  %%      We clean up the command and use the real GID and LID of the user, disregarding what was sent and possibly tampered with.
  %%      Only a handful of commands are allowed to broadcast. An user tampering with it would get disconnected instantly.
  %% @todo Don't query the user data everytime! Keep an User instead of a GID probably.
  
  broadcast(Command, Orig)
  	when	Command =:= 16#0101;
  			Command =:= 16#0102;
  			Command =:= 16#0104;
  