From 28bb2f92cb15388e9c4c0776a6b5ab9ce0eb9b05 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lo=C3=AFc=20Hoguin?= Date: Thu, 2 Sep 2010 00:58:27 +0200 Subject: [PATCH] psu_game: Small improvements to send_0201 based on research. --- src/psu/psu_game.erl | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/psu/psu_game.erl b/src/psu/psu_game.erl index cf9c6e0..8da14dc 100644 --- a/src/psu/psu_game.erl +++ b/src/psu/psu_game.erl @@ -1152,12 +1152,19 @@ send_0200(ZoneType) -> %% @todo Handle LID correctly (should be ffffffff for self? yet LID should be 16 bits). send_0201(User) -> GID = get(gid), + CharTypeID = case (User#egs_user_model.character)#characters.type of + npc -> 16#00001d00; + _ -> 16#00001200 + end, CharGID = User#egs_user_model.id, CharBin = psu_characters:character_user_to_binary(User), IsGM = 0, OnlineStatus = 0, - GameVersion = 0, - send(<< 16#02010300:32, 0:32, 16#00001200:32, CharGID:32/little-unsigned-integer, 0:64, 16#00011300:32, + GameVersion = case (User#egs_user_model.character)#characters.type of + npc -> 255; + _ -> 0 + end, + send(<< 16#02010300:32, 0:32, CharTypeID:32, CharGID:32/little-unsigned-integer, 0:64, 16#00011300:32, GID:32/little-unsigned-integer, 0:64, CharBin/binary, IsGM:8, 0:8, OnlineStatus:8, GameVersion:8, 0:608 >>). %% @doc Hello packet, always sent on client connection.