From 7603ea174c2d44cafee2b8aa833f80114c045500 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 4 Oct 2014 17:44:21 +0300 Subject: Increase sql password field size from 32 to 100 chars. 32 chars is very small for password. --- src/char/inter.c | 2 +- src/login/account_sql.c | 4 ++-- src/login/ipban_sql.c | 4 ++-- src/login/loginlog_sql.c | 4 ++-- src/map/log.h | 2 +- src/map/map.h | 2 +- 6 files changed, 9 insertions(+), 9 deletions(-) (limited to 'src') diff --git a/src/char/inter.c b/src/char/inter.c index e5a7d411c..2c652d897 100644 --- a/src/char/inter.c +++ b/src/char/inter.c @@ -41,7 +41,7 @@ Sql* sql_handle = NULL; int char_server_port = 3306; char char_server_ip[32] = "127.0.0.1"; char char_server_id[32] = "ragnarok"; -char char_server_pw[32] = "ragnarok"; +char char_server_pw[100] = "ragnarok"; char char_server_db[32] = "ragnarok"; char default_codepage[32] = ""; //Feature by irmin. diff --git a/src/login/account_sql.c b/src/login/account_sql.c index 51e499369..10852e5b1 100644 --- a/src/login/account_sql.c +++ b/src/login/account_sql.c @@ -33,14 +33,14 @@ typedef struct AccountDB_SQL char global_db_hostname[32]; uint16 global_db_port; char global_db_username[32]; - char global_db_password[32]; + char global_db_password[100]; char global_db_database[32]; char global_codepage[32]; // local sql settings char db_hostname[32]; uint16 db_port; char db_username[32]; - char db_password[32]; + char db_password[100]; char db_database[32]; char codepage[32]; // other settings diff --git a/src/login/ipban_sql.c b/src/login/ipban_sql.c index 081f28d84..82512b0f0 100644 --- a/src/login/ipban_sql.c +++ b/src/login/ipban_sql.c @@ -23,14 +23,14 @@ static char global_db_hostname[32] = "127.0.0.1"; static uint16 global_db_port = 3306; static char global_db_username[32] = "ragnarok"; -static char global_db_password[32] = "ragnarok"; +static char global_db_password[100] = "ragnarok"; static char global_db_database[32] = "ragnarok"; static char global_codepage[32] = ""; // local sql settings static char ipban_db_hostname[32] = ""; static uint16 ipban_db_port = 0; static char ipban_db_username[32] = ""; -static char ipban_db_password[32] = ""; +static char ipban_db_password[100] = ""; static char ipban_db_database[32] = ""; static char ipban_codepage[32] = ""; static char ipban_table[32] = "ipbanlist"; diff --git a/src/login/loginlog_sql.c b/src/login/loginlog_sql.c index 2c0b1cc03..5654b4c5b 100644 --- a/src/login/loginlog_sql.c +++ b/src/login/loginlog_sql.c @@ -19,14 +19,14 @@ static char global_db_hostname[32] = "127.0.0.1"; static uint16 global_db_port = 3306; static char global_db_username[32] = "ragnarok"; -static char global_db_password[32] = "ragnarok"; +static char global_db_password[100] = "ragnarok"; static char global_db_database[32] = "ragnarok"; static char global_codepage[32] = ""; // local sql settings static char log_db_hostname[32] = ""; static uint16 log_db_port = 0; static char log_db_username[32] = ""; -static char log_db_password[32] = ""; +static char log_db_password[100] = ""; static char log_db_database[32] = ""; static char log_codepage[32] = ""; static char log_login_db[256] = "loginlog"; diff --git a/src/map/log.h b/src/map/log.h index 6ab142f87..40dbf6761 100644 --- a/src/map/log.h +++ b/src/map/log.h @@ -98,7 +98,7 @@ struct log_interface { char db_ip[32]; int db_port; char db_id[32]; - char db_pw[32]; + char db_pw[100]; char db_name[32]; Sql* mysql_handle; /* */ diff --git a/src/map/map.h b/src/map/map.h index dba565cc0..c36f905ef 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -853,7 +853,7 @@ struct map_interface { int server_port; char server_ip[32]; char server_id[32]; - char server_pw[32]; + char server_pw[100]; char server_db[32]; Sql* mysql_handle; -- cgit v1.2.3-70-g09d2 From 3904b3a935395d9f0d9ac2864e6fa34863c630c2 Mon Sep 17 00:00:00 2001 From: Michieru Date: Sun, 26 Oct 2014 22:28:30 +0100 Subject: - Can't cast icewall more than once on the same center cell. Special thanks to Ind - Service for you now work properly on all skill level. - Fixed a problem that sometimes randomly a status change was removed on logout although it shouldn't. Special thanks to Playtester --- src/map/chrif.c | 7 +++++-- src/map/map.c | 4 ++++ src/map/map.h | 5 ++++- src/map/skill.c | 13 +++++++++---- src/map/unit.c | 6 ++++++ 5 files changed, 28 insertions(+), 7 deletions(-) (limited to 'src') diff --git a/src/map/chrif.c b/src/map/chrif.c index 34e92bee0..1ba89f8c0 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1125,9 +1125,12 @@ bool chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of th continue; if (sc->data[i]->timer != INVALID_TIMER) { td = timer->get(sc->data[i]->timer); - if (td == NULL || td->func != status->change_timer || DIFF_TICK(td->tick,tick) < 0) + if (td == NULL || td->func != status->change_timer) continue; - data.tick = DIFF_TICK32(td->tick,tick); //Duration that is left before ending. + if (DIFF_TICK32(td->tick,tick) > 0) + data.tick = DIFF_TICK32(td->tick,tick); //Duration that is left before ending. + else + data.tick = 0; //Negative tick does not necessarily mean that sc has expired } else data.tick = -1; //Infinite duration data.type = i; diff --git a/src/map/map.c b/src/map/map.c index 5fa8779eb..045233e91 100644 --- a/src/map/map.c +++ b/src/map/map.c @@ -2586,6 +2586,8 @@ int map_getcellp(struct map_data* m,int16 x,int16 y,cell_chk cellchk) { return (cell.nochat); case CELL_CHKICEWALL: return (cell.icewall); + case CELL_CHKNOICEWALL: + return (cell.noicewall); // special checks case CELL_CHKPASS: @@ -2645,6 +2647,8 @@ void map_setcell(int16 m, int16 x, int16 y, cell_t cell, bool flag) { case CELL_NOVENDING: map->list[m].cell[j].novending = flag; break; case CELL_NOCHAT: map->list[m].cell[j].nochat = flag; break; case CELL_ICEWALL: map->list[m].cell[j].icewall = flag; break; + case CELL_NOICEWALL: map->list[m].cell[j].noicewall = flag; break; + default: ShowWarning("map_setcell: invalid cell type '%d'\n", (int)cell); break; diff --git a/src/map/map.h b/src/map/map.h index 751fef67e..11dd6ce82 100644 --- a/src/map/map.h +++ b/src/map/map.h @@ -444,6 +444,7 @@ typedef enum { CELL_NOVENDING, CELL_NOCHAT, CELL_ICEWALL, + CELL_NOICEWALL, } cell_t; @@ -467,6 +468,7 @@ typedef enum { CELL_CHKNOVENDING, CELL_CHKNOCHAT, CELL_CHKICEWALL, + CELL_CHKNOICEWALL, } cell_chk; @@ -484,7 +486,8 @@ struct mapcell { landprotector : 1, novending : 1, nochat : 1, - icewall : 1; + icewall : 1, + noicewall : 1; #ifdef CELL_NOSTACK int cell_bl; //Holds amount of bls in this cell. diff --git a/src/map/skill.c b/src/map/skill.c index 0fe4b99ea..42aae546d 100644 --- a/src/map/skill.c +++ b/src/map/skill.c @@ -10078,7 +10078,6 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui case MG_THUNDERSTORM: case AL_PNEUMA: - case WZ_ICEWALL: case WZ_FIREPILLAR: case WZ_QUAGMIRE: case WZ_VERMILION: @@ -10187,6 +10186,11 @@ int skill_castend_pos2(struct block_list* src, int x, int y, uint16 skill_id, ui sc_start(src,src,SC_NO_SWITCH_EQUIP,100,0,skill->get_time(skill_id,skill_lv)); skill->unitsetting(src,skill_id,skill_lv,x,y,0); break; + case WZ_ICEWALL: + flag |= 1; + if( skill->unitsetting(src,skill_id,skill_lv,x,y,0) ) + map->list[src->m].setcell(src->m, x, y, CELL_NOICEWALL, true); + break; case RG_GRAFFITI: /* Graffiti [Valaris] */ skill->clear_unitgroup(src); skill->unitsetting(src,skill_id,skill_lv,x,y,0); @@ -10995,11 +10999,11 @@ struct skill_unit_group* skill_unitsetting(struct block_list *src, uint16 skill_ val1 += pc->checkskill(sd,BA_MUSICALLESSON); break; case DC_SERVICEFORYOU: - val1 = 15+skill_lv+(st->int_/10); // MaxSP percent increase TO-DO: this INT bonus value is guessed + val1 = 15+skill_lv+(st->int_/10); // MaxSP percent increase val2 = 20+3*skill_lv+(st->int_/10); // SP cost reduction if(sd){ - val1 += (pc->checkskill(sd,DC_DANCINGLESSON) + 1) / 2; - val2 += (pc->checkskill(sd,DC_DANCINGLESSON) + 1) / 2; + val1 += pc->checkskill(sd,DC_DANCINGLESSON) / 2; + val2 += pc->checkskill(sd,DC_DANCINGLESSON) / 2; } break; case BA_ASSASSINCROSS: @@ -15626,6 +15630,7 @@ int skill_delunit (struct skill_unit* su) { } break; case WZ_ICEWALL: + map->list[su->bl.m].setcell(su->bl.m, su->bl.x, su->bl.y, CELL_NOICEWALL, false); map->setgatcell(su->bl.m,su->bl.x,su->bl.y,su->val2); clif->changemapcell(0,su->bl.m,su->bl.x,su->bl.y,su->val2,ALL_SAMEMAP); // hack to avoid clientside cell bug skill->unitsetmapcell(su,WZ_ICEWALL,group->skill_lv,CELL_ICEWALL,false); diff --git a/src/map/unit.c b/src/map/unit.c index b4653df00..849e9348f 100644 --- a/src/map/unit.c +++ b/src/map/unit.c @@ -1584,6 +1584,12 @@ int unit_skilluse_pos2( struct block_list *src, short skill_x, short skill_y, ui clif->skill_fail(sd,skill_id,USESKILL_FAIL_LEVEL,0); return 0; } + /** + * "WHY IS IT HEREE": ice wall cannot be canceled past this point, the client displays the animation even, + * if we cancel it from castend_pos, so it has to be here for it to not display the animation. + **/ + if ( skill_id == WZ_ICEWALL && map->getcell(src->m, skill_x, skill_y, CELL_CHKNOICEWALL) ) + return 0; } if (!status->check_skilluse(src, NULL, skill_id, 0)) -- cgit v1.2.3-70-g09d2 From c151e8714304dc4f95d9ce91b98fc84bf0958d94 Mon Sep 17 00:00:00 2001 From: "Hercules.ws" Date: Sun, 26 Oct 2014 22:29:13 +0100 Subject: HPM Hooks Update Signed-off-by: HerculesWSAPI --- src/map/chrif.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/map/chrif.c b/src/map/chrif.c index 1ba89f8c0..c78b34309 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -1127,10 +1127,10 @@ bool chrif_save_scdata(struct map_session_data *sd) { //parses the sc_data of th td = timer->get(sc->data[i]->timer); if (td == NULL || td->func != status->change_timer) continue; - if (DIFF_TICK32(td->tick,tick) > 0) - data.tick = DIFF_TICK32(td->tick,tick); //Duration that is left before ending. - else - data.tick = 0; //Negative tick does not necessarily mean that sc has expired + if (DIFF_TICK32(td->tick,tick) > 0) + data.tick = DIFF_TICK32(td->tick,tick); //Duration that is left before ending. + else + data.tick = 0; //Negative tick does not necessarily mean that sc has expired } else data.tick = -1; //Infinite duration data.type = i; -- cgit v1.2.3-70-g09d2 From ce85609f42d6f0f2fd1db6e76bce9744e231074e Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 18 Oct 2014 21:34:29 +0200 Subject: Added source support to mark script commands as deprecated - Commands marked as deprecated will trigger a warning when the script is loaded. (there are currently no commands marked as such, but some will come soon) Signed-off-by: Haru --- src/map/script.c | 10 ++++++++-- src/map/script.h | 4 ++++ 2 files changed, 12 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/map/script.c b/src/map/script.c index b8e161e10..9429d66d4 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -772,6 +772,8 @@ const char* parse_callfunc(const char* p, int require_paren, int is_custom) script->addl(func); script->addc(C_ARG); arg = script->buildin[script->str_data[func].val]; + if (script->str_data[func].deprecated) + DeprecationWarning(p); if( !arg ) arg = &null_arg; // Use a dummy, null string } else if( script->str_data[func].type == C_USERFUNC || script->str_data[func].type == C_USERFUNC_POS ) { // script defined function @@ -18977,6 +18979,7 @@ bool script_add_builtin(const struct script_function *buildin, bool override) { } script->str_data[n].func = buildin->func; + script->str_data[n].deprecated = (buildin->deprecated ? 1 : 0); /* we only store the arguments, its the only thing used out of this */ if( slen ) { @@ -18994,11 +18997,14 @@ bool script_hp_add(char *name, char *args, bool (*func)(struct script_state *st) buildin.name = name; buildin.arg = args; buildin.func = func; + buildin.deprecated = false; return script->add_builtin(&buildin, true); } -#define BUILDIN_DEF(x,args) { buildin_ ## x , #x , args } -#define BUILDIN_DEF2(x,x2,args) { buildin_ ## x , x2 , args } +#define BUILDIN_DEF(x,args) { buildin_ ## x , #x , args, false } +#define BUILDIN_DEF2(x,x2,args) { buildin_ ## x , x2 , args, false } +#define BUILDIN_DEF_DEPRECATED(x,args) { buildin_ ## x , #x , args, true } +#define BUILDIN_DEF2_DEPRECATED(x,x2,args) { buildin_ ## x , x2 , args, true } void script_parse_builtin(void) { struct script_function BUILDIN[] = { // NPC interaction diff --git a/src/map/script.h b/src/map/script.h index 54b3835a7..75ba8d5ce 100644 --- a/src/map/script.h +++ b/src/map/script.h @@ -30,6 +30,8 @@ struct eri; #define DeprecationCaseWarning2(func, bad, good, where) ShowError("%s: detected possible use of wrong case in a script. Found '%s', probably meant to be '%s' (in '%s').\n", (func), (bad), (good), get_script_source(where)) #define disp_deprecation_message(func, good, p) disp_warning_message(func": use of deprecated keyword (use '"good"' instead).", (p)) +#define DeprecationWarning(p) disp_warning_message("This command is deprecated and it will be removed in a future update. Please see the script documentation for an alternative.\n", (p)) + #define NUM_WHISPER_VAR 10 /// Maximum amount of elements in script arrays @@ -433,6 +435,7 @@ struct script_function { bool (*func)(struct script_state *st); char *name; char *arg; + bool deprecated; }; // String buffer structures. @@ -445,6 +448,7 @@ struct str_data_struct { bool (*func)(struct script_state *st); int val; int next; + uint8 deprecated : 1; }; struct script_label_entry { -- cgit v1.2.3-70-g09d2 From bcf7a77e17b98997dfde8a54bbb2d279236e966b Mon Sep 17 00:00:00 2001 From: Haru Date: Sat, 25 Oct 2014 02:28:09 +0200 Subject: Marked command jump_zero as deprecated. - Added prefixed version for internal use. - Note: The command will be completely removed after about a month. Custom, third party scripts will require updates, in case they were using this command. Please see the jump_zero documentation. Signed-off-by: Haru --- doc/script_commands.txt | 24 ++++++++++++++++-------- src/map/script.c | 23 +++++++++++++---------- 2 files changed, 29 insertions(+), 18 deletions(-) (limited to 'src') diff --git a/doc/script_commands.txt b/doc/script_commands.txt index 651ce05e2..4edb596b6 100644 --- a/doc/script_commands.txt +++ b/doc/script_commands.txt @@ -974,14 +974,14 @@ Within executable script code, some lines can be labels: