summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-20 21:28:44 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-02-20 21:28:44 +0000
commitd63bfea2a4c95f34b3373dab2d1425d72ea227df (patch)
tree105847d717682fefb7e4737661010ac703a2bd72
parent0d8bcc88e3a5d621b5e483b8af1eff7958f0fe79 (diff)
downloadhercules-d63bfea2a4c95f34b3373dab2d1425d72ea227df.tar.gz
hercules-d63bfea2a4c95f34b3373dab2d1425d72ea227df.tar.bz2
hercules-d63bfea2a4c95f34b3373dab2d1425d72ea227df.tar.xz
hercules-d63bfea2a4c95f34b3373dab2d1425d72ea227df.zip
- Play-dead and Basilica now do block Gospel
- Map SQL server will no longer ignore the gm-list packets received from char. - Login-SQL server will not free the current GM listing if the SQL reading of it failed. - Login-SQL will now read for the GM list ALL accounts with level above 0, not just those with level above min_gm_level (just like the TXT server does) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@5349 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt9
-rw-r--r--src/login_sql/login.c19
-rw-r--r--src/map/pc.c26
-rw-r--r--src/map/status.c22
4 files changed, 32 insertions, 44 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 95ad7e874..d10b93ac9 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -5,6 +5,15 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK. EV
GOES INTO TRUNK AND WILL BE MERGED INTO STABLE BY VALARIS AND WIZPUTER. -- VALARIS
2006/02/20
+ * Play-dead and Basilica now block Gospel [Skotlex]
+ * Map SQL server will no longer ignore the gm-list packets received from
+ char. [Skotlex]
+ * Login-SQL server will not free the current GM listing if the SQL reading
+ of it failed (prevents GM lists being lost on SQL connection problems)
+ [Skotlex]
+ * Login-SQL will now read for the GM list ALL accounts with level above 0,
+ not just those with level above min_gm_level (just like the TXT server
+ does) [Skotlex]
* SC_NOCHAT is not dispelled on death now. [Skotlex]
* Cleaned up the global message function, Super Novice Explosion Spirits
will not trigger on maps where said skill can't be used. [Skotlex]
diff --git a/src/login_sql/login.c b/src/login_sql/login.c
index ca27c0036..9bbad06dc 100644
--- a/src/login_sql/login.c
+++ b/src/login_sql/login.c
@@ -122,7 +122,6 @@ char login_db_level[256] = "level";
char reg_db[256] = "global_reg_value";
-int lowest_gm_level;
struct gm_account *gm_account_db;
int GM_num;
char tmpsql[65535], tmp_sql[65535];
@@ -203,15 +202,20 @@ void read_gm_account(void) {
MYSQL_RES* sql_res ;
MYSQL_ROW sql_row;
- if (gm_account_db != NULL)
- aFree(gm_account_db);
- GM_num = 0;
-
- sprintf(tmp_sql, "SELECT `%s`,`%s` FROM `%s` WHERE `%s`>='%d'",login_db_account_id,login_db_level,login_db,login_db_level,lowest_gm_level);
+ sprintf(tmp_sql, "SELECT `%s`,`%s` FROM `%s` WHERE `%s`> '0'",login_db_account_id,login_db_level,login_db,login_db_level);
if (mysql_query(&mysql_handle, tmp_sql)) {
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
+ return; //Failed to read GM list!
+ }
+
+ if (gm_account_db != NULL)
+ {
+ aFree(gm_account_db);
+ gm_account_db = NULL;
}
+ GM_num = 0;
+
sql_res = mysql_store_result(&mysql_handle);
if (sql_res) {
gm_account_db = (struct gm_account*)aCalloc((size_t)mysql_num_rows(sql_res), sizeof(struct gm_account));
@@ -2146,9 +2150,6 @@ void sql_config_read(const char *cfgName){ /* Kalaspuff, to get login_db */
else if (strcmpi(w1, "loginlog_db") == 0) {
strcpy(loginlog_db, w2);
}
- else if (strcmpi(w1, "lowest_gm_level") == 0) {
- lowest_gm_level = atoi(w2);
- }
else if (strcmpi(w1, "reg_db") == 0) {
strcpy(reg_db, w2);
}
diff --git a/src/map/pc.c b/src/map/pc.c
index 7955c0132..b8bea9740 100644
--- a/src/map/pc.c
+++ b/src/map/pc.c
@@ -7949,14 +7949,11 @@ int pc_autosave(int tid,unsigned int tick,int id,int data)
int pc_read_gm_account(int fd)
{
-#ifdef TXT_ONLY
int i = 0;
RFIFOHEAD(fd);
-#endif
if (gm_account != NULL)
aFree(gm_account);
GM_num = 0;
-#ifdef TXT_ONLY
gm_account = (struct gm_account *) aCallocA(((RFIFOW(fd,2) - 4) / 5), sizeof(struct gm_account));
for (i = 4; i < RFIFOW(fd,2); i = i + 5) {
gm_account[GM_num].account_id = RFIFOL(fd,i);
@@ -7964,26 +7961,6 @@ int pc_read_gm_account(int fd)
//printf("GM account: %d -> level %d\n", gm_account[GM_num].account_id, gm_account[GM_num].level);
GM_num++;
}
-#else
- sprintf (tmp_sql, "SELECT `%s`,`%s` FROM `%s` WHERE `%s`>='%d'",gm_db_account_id,gm_db_level,gm_db,gm_db_level,lowest_gm_level);
- if(mysql_query(&lmysql_handle, tmp_sql) ) {
- ShowSQL("DB error - %s\n",mysql_error(&lmysql_handle));
- ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
- return 0;
- }
- lsql_res = mysql_store_result(&lmysql_handle);
- if (lsql_res) {
- gm_account = (struct gm_account *) aCallocA((size_t)mysql_num_rows(lsql_res), sizeof(struct gm_account));
- while ((lsql_row = mysql_fetch_row(lsql_res))) {
- gm_account[GM_num].account_id = atoi(lsql_row[0]);
- gm_account[GM_num].level = atoi(lsql_row[1]);
- ShowNotice("GM account: %d -> level %d\n", gm_account[GM_num].account_id, gm_account[GM_num].level);
- GM_num++;
- }
- }
-
- mysql_free_result(lsql_res);
-#endif /* TXT_ONLY */
return GM_num;
}
@@ -8394,9 +8371,6 @@ int do_init_pc(void) {
natural_heal_prev_tick = gettick();
add_timer_interval(natural_heal_prev_tick + NATURAL_HEAL_INTERVAL, pc_natural_heal, 0, 0, NATURAL_HEAL_INTERVAL);
add_timer(gettick() + autosave_interval, pc_autosave, 0, 0);
-#ifndef TXT_ONLY
- pc_read_gm_account(0);
-#endif /* not TXT_ONLY */
if (battle_config.day_duration > 0 && battle_config.night_duration > 0) {
int day_duration = battle_config.day_duration;
diff --git a/src/map/status.c b/src/map/status.c
index 3e36817c5..4b6fade9b 100644
--- a/src/map/status.c
+++ b/src/map/status.c
@@ -343,15 +343,6 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
if (target && status_isdead(target) && skill_num != ALL_RESURRECTION && skill_num != PR_REDEMPTIO)
return 0;
- if (skill_num == PA_PRESSURE && flag) {
- //Once Gloria Domini has been casted, there's nothing you can do to stop it. [Skotlex]
- //- Except hiding from it.
- tsc = target?status_get_sc(target):NULL;
- if(tsc && tsc->option&OPTION_HIDE)
- return 0;
- return 1;
- }
-
mode = src?status_get_mode(src):MD_CANATTACK;
if (!skill_num && !(mode&MD_CANATTACK))
@@ -368,6 +359,19 @@ int status_check_skilluse(struct block_list *src, struct block_list *target, int
if (race&INF_GROUND_SKILL && skill_get_unit_target(skill_num)&BCT_ENEMY)
return 0;
}
+
+ if (skill_num == PA_PRESSURE && flag) {
+ //Gloria Avoids pretty much everythng....
+ tsc = target?status_get_sc(target):NULL;
+ if(tsc) {
+ if (tsc->option&OPTION_HIDE)
+ return 0;
+ if (tsc->count && tsc->data[SC_TRICKDEAD].timer != -1)
+ return 0;
+ }
+ return 1;
+ }
+
if (src) sc = status_get_sc(src);
if(sc && sc->opt1 >0)