From 87f9bae4da0314e97f1a3e38513960998ee4d05d Mon Sep 17 00:00:00 2001 From: mekolat Date: Tue, 12 May 2015 21:40:18 -0400 Subject: use client version --- src/map/chrif.cpp | 4 ++-- src/map/clif.cpp | 2 +- src/map/map.hpp | 2 +- src/map/pc.cpp | 7 ++++--- src/map/pc.hpp | 2 +- src/map/script-fun.cpp | 8 ++++++++ 6 files changed, 17 insertions(+), 8 deletions(-) (limited to 'src/map') diff --git a/src/map/chrif.cpp b/src/map/chrif.cpp index 8127f20..ce5669e 100644 --- a/src/map/chrif.cpp +++ b/src/map/chrif.cpp @@ -867,11 +867,11 @@ void chrif_parse(Session *s) AccountId id = payload.account_id; int login_id2 = payload.login_id2; - short tmw_version = payload.packet_tmw_version; + short client_version = payload.packet_client_version; CharKey st_key = payload.char_key; CharData st_data = payload.char_data; pc_authok(id, login_id2, - tmw_version, + client_version, &st_key, &st_data); break; } diff --git a/src/map/clif.cpp b/src/map/clif.cpp index 6074c43..f94c316 100644 --- a/src/map/clif.cpp +++ b/src/map/clif.cpp @@ -2654,7 +2654,7 @@ void clif_skillinfoblock(dumb_ptr sd) std::vector> repeat_10f; for (SkillID i : erange(SkillID(), MAX_SKILL)) { - if (sd->status.skill[i].lv && sd->tmw_version >= 1) + if (sd->status.skill[i].lv && sd->client_version >= 1) { Packet_Repeat<0x010f> info; // [Fate] Version 1 and later don't crash because of bad skill IDs anymore diff --git a/src/map/map.hpp b/src/map/map.hpp index f57dcee..ce434fa 100644 --- a/src/map/map.hpp +++ b/src/map/map.hpp @@ -153,7 +153,7 @@ struct map_session_data : block_list, SessionData CharId char_id_; int login_id1, login_id2; SEX sex; - unsigned char tmw_version; // tmw client version + int client_version; // tmw client version CharKey status_key; CharData status; GenericArray>, InventoryIndexing> inventory_data = diff --git a/src/map/pc.cpp b/src/map/pc.cpp index 1179792..cb81e29 100644 --- a/src/map/pc.cpp +++ b/src/map/pc.cpp @@ -641,7 +641,7 @@ int pc_isequip(dumb_ptr sd, IOff0 n) *------------------------------------------ */ int pc_authok(AccountId id, int login_id2, - short tmw_version, const CharKey *st_key, const CharData *st_data) + short client_version, const CharKey *st_key, const CharData *st_data) { dumb_ptr sd = nullptr; @@ -652,7 +652,7 @@ int pc_authok(AccountId id, int login_id2, return 1; sd->login_id2 = login_id2; - sd->tmw_version = tmw_version; + sd->client_version = client_version; sd->status_key = *st_key; sd->status = *st_data; @@ -797,7 +797,8 @@ int pc_authok(AccountId id, int login_id2, pc_calcstatus(sd, 1); // Init Quest Log - clif_sendallquest(sd); + if(sd->client_version >= 2) + clif_sendallquest(sd); return 0; } diff --git a/src/map/pc.hpp b/src/map/pc.hpp index d100938..fc0bdb0 100644 --- a/src/map/pc.hpp +++ b/src/map/pc.hpp @@ -80,7 +80,7 @@ int pc_counttargeted(dumb_ptr sd, dumb_ptr src, int pc_setrestartvalue(dumb_ptr sd, int type); void pc_makesavestatus(dumb_ptr); int pc_setnewpc(dumb_ptr, AccountId, CharId, int, uint32_t /*tick_t*/, SEX); -int pc_authok(AccountId, int, short tmw_version, const CharKey *, const CharData *); +int pc_authok(AccountId, int, short client_version, const CharKey *, const CharData *); int pc_authfail(AccountId accid); EPOS pc_equippoint(dumb_ptr sd, IOff0 n); diff --git a/src/map/script-fun.cpp b/src/map/script-fun.cpp index 744f2c3..9020203 100644 --- a/src/map/script-fun.cpp +++ b/src/map/script-fun.cpp @@ -971,6 +971,13 @@ void builtin_delitem(ScriptState *st) } +static +void builtin_getversion(ScriptState *st) +{ + dumb_ptr sd = script_rid2sd(st);; + push_int(st->stack, sd->client_version); +} + /*========================================== *キャラ関係のID取得 *------------------------------------------ @@ -3028,6 +3035,7 @@ BuiltinFunction builtin_functions[] = BUILTIN(makeitem, "IiMxy"_s, '\0'), BUILTIN(delitem, "Ii"_s, '\0'), BUILTIN(getcharid, "i?"_s, 'i'), + BUILTIN(getversion, ""_s, 'i'), BUILTIN(strcharinfo, "i"_s, 's'), BUILTIN(getequipid, "i"_s, 'i'), BUILTIN(bonus, "ii"_s, '\0'), -- cgit v1.2.3-70-g09d2