diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-04-19 23:53:07 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-04-19 23:53:07 +0300 |
commit | 72d4d2df6918917a50c057fea3f5847f9e3750eb (patch) | |
tree | 010f8d609f16527de953df159f543e2e455de9b5 /src/echar | |
parent | 7cfd66e3c24240af8efdbae57407755283114f14 (diff) | |
download | plugin-72d4d2df6918917a50c057fea3f5847f9e3750eb.tar.gz plugin-72d4d2df6918917a50c057fea3f5847f9e3750eb.tar.bz2 plugin-72d4d2df6918917a50c057fea3f5847f9e3750eb.tar.xz plugin-72d4d2df6918917a50c057fea3f5847f9e3750eb.zip |
Drop support for client protocol version 3 (Nov 28 2014).
Diffstat (limited to 'src/echar')
-rw-r--r-- | src/echar/char.c | 81 |
1 files changed, 36 insertions, 45 deletions
diff --git a/src/echar/char.c b/src/echar/char.c index 6d16e56..d6a2c40 100644 --- a/src/echar/char.c +++ b/src/echar/char.c @@ -36,32 +36,29 @@ void echar_parse_char_create_new_char(int *fdPtr, struct char_session_data **sdP if (!sd) return; - if (sd->version >= 4) + race = RFIFOW(fd, 31); + if (race < min_char_class || race > max_char_class) { - race = RFIFOW(fd, 31); - if (race < min_char_class || race > max_char_class) - { - chr->creation_failed(fd, -10); - RFIFOSKIP(fd, 31 + 5); - hookStop(); - return; - } - sex = RFIFOB(fd, 33); - if (sex != 0 && sex != 1 && sex != 3 && sex != 99) - { - chr->creation_failed(fd, -11); - RFIFOSKIP(fd, 31 + 5); - hookStop(); - return; - } - look = RFIFOW(fd, 34); - if (look < min_look || look > max_look) - { - chr->creation_failed(fd, -12); - RFIFOSKIP(fd, 31 + 5); - hookStop(); - return; - } + chr->creation_failed(fd, -10); + RFIFOSKIP(fd, 31 + 5); + hookStop(); + return; + } + sex = RFIFOB(fd, 33); + if (sex != 0 && sex != 1 && sex != 3 && sex != 99) + { + chr->creation_failed(fd, -11); + RFIFOSKIP(fd, 31 + 5); + hookStop(); + return; + } + look = RFIFOW(fd, 34); + if (look < min_look || look > max_look) + { + chr->creation_failed(fd, -12); + RFIFOSKIP(fd, 31 + 5); + hookStop(); + return; } // +++ need remove addition sql query after this line for set sex @@ -76,33 +73,27 @@ void echar_parse_char_create_new_char(int *fdPtr, struct char_session_data **sdP struct mmo_charstatus char_dat; chr->mmo_char_fromsql(result, &char_dat, false); //Only the short data is needed. - if (sd->version >= 4) + char_dat.class = race; + char_dat.sex = sex; + char_dat.clothes_color = look; + + chr->mmo_char_tosql(result, &char_dat); + char cSex = 'U'; + if (sex == SEX_MALE) + cSex = 'M'; + else if (sex == SEX_FEMALE) + cSex = 'F'; + + if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `sex` = '%c' WHERE `char_id` = '%d'", "char", cSex, char_dat.char_id)) { - char_dat.class = race; - char_dat.sex = sex; - char_dat.clothes_color = look; - - chr->mmo_char_tosql(result, &char_dat); - char cSex = 'U'; - if (sex == SEX_MALE) - cSex = 'M'; - else if (sex == SEX_FEMALE) - cSex = 'F'; - - if (SQL_ERROR == SQL->Query(inter->sql_handle, "UPDATE `%s` SET `sex` = '%c' WHERE `char_id` = '%d'", "char", cSex, char_dat.char_id)) - { - Sql_ShowDebug(inter->sql_handle); - } + Sql_ShowDebug(inter->sql_handle); } chr->creation_ok(fd, &char_dat); // add new entry to the chars list sd->found_char[char_dat.slot] = result; // the char_id of the new char } - if (sd->version >= 4) - RFIFOSKIP(fd, 31 + 5); - else - RFIFOSKIP(fd, 31); + RFIFOSKIP(fd, 31 + 5); hookStop(); } |