diff options
-rw-r--r-- | Changelog-Trunk.txt | 5 | ||||
-rw-r--r-- | src/map/clif.c | 1 | ||||
-rw-r--r-- | src/map/script.c | 17 |
3 files changed, 15 insertions, 8 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt index 36c8a2060..0588cc7af 100644 --- a/Changelog-Trunk.txt +++ b/Changelog-Trunk.txt @@ -3,6 +3,11 @@ Date Added AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2006/06/23
+ * [Fixed]:
+ - MAPREGSQL overloading SQL table with temperory map registries.
+ - Incorrect perfomance calculation for MAPREGSQL loading and saving. [Lance]
+
2006/06/22
* Guessed and added support for the packets 0x22a (idle) and 0x22b (spawn).
This should complete the required packets for PACKETVER 7. [Skotlex]
diff --git a/src/map/clif.c b/src/map/clif.c index 11cb3f2fc..b5ea9fe40 100644 --- a/src/map/clif.c +++ b/src/map/clif.c @@ -7638,6 +7638,7 @@ int clif_refresh(struct map_session_data *sd) { clif_updatestatus(sd,SP_MAXWEIGHT);
clif_updatestatus(sd,SP_WEIGHT);
map_foreachinrange(clif_getareachar,&sd->bl,AREA_SIZE,BL_ALL,sd);
+ clif_weather_check(sd);
return 0;
}
diff --git a/src/map/script.c b/src/map/script.c index 8a151aba0..487f78bfa 100644 --- a/src/map/script.c +++ b/src/map/script.c @@ -11682,9 +11682,10 @@ int mapreg_setreg(int num,int val) #endif if(val!=0) { - + if(idb_put(mapreg_db,num,(void*)val)) + ; #if !defined(TXT_ONLY) && defined(MAPREGSQL) - if(name[1] != '@' && idb_get(mapreg_db,num) == NULL) { + else if(name[1] != '@') { sprintf(tmp_sql,"INSERT INTO `%s`(`%s`,`%s`,`%s`) VALUES ('%s','%d','%d')",mapregsql_db,mapregsql_db_varname,mapregsql_db_index,mapregsql_db_value,jstrescapecpy(tmp_str,name),i,val); if(mysql_query(&mmysql_handle,tmp_sql)){ ShowSQL("DB error - %s\n",mysql_error(&mmysql_handle)); @@ -11692,7 +11693,6 @@ int mapreg_setreg(int num,int val) } } #endif - idb_put(mapreg_db,num,(void*)val); // else } else { // [zBuffer] #if !defined(TXT_ONLY) && defined(MAPREGSQL) @@ -11744,7 +11744,8 @@ int mapreg_setregstr(int num,const char *str) if (idb_put(mapregstr_db,num,p)) ; #if !defined(TXT_ONLY) && defined(MAPREGSQL) - else { //put returned null, so we must insert. + else if(name[1] != '@'){ //put returned null, so we must insert. + // Someone is causing a database size infinite increase here without name[1] != '@' [Lance] sprintf(tmp_sql,"INSERT INTO `%s`(`%s`,`%s`,`%s`) VALUES ('%s','%d','%s')",mapregsql_db,mapregsql_db_varname,mapregsql_db_index,mapregsql_db_value,jstrescapecpy(tmp_str,name),i,jstrescapecpy(tmp_str2,p)); if(mysql_query(&mmysql_handle,tmp_sql)){ ShowSQL("DB error - %s\n",mysql_error(&mmysql_handle)); @@ -11804,7 +11805,7 @@ static int script_load_mapreg(void) | varname | index | value | +-------------------------+ */ - int perfomance = gettick_nocache(); + unsigned int perfomance = (unsigned int)time(NULL); sprintf(tmp_sql,"SELECT * FROM `%s`",mapregsql_db); ShowInfo("Querying script_load_mapreg ...\n"); if(mysql_query(&mmysql_handle, tmp_sql) ) { @@ -11836,7 +11837,7 @@ static int script_load_mapreg(void) ShowInfo("Freeing results...\n"); mysql_free_result(sql_res); mapreg_dirty=0; - perfomance = (gettick_nocache() - perfomance) / 1000; + perfomance = ((unsigned int)time(NULL) - perfomance); ShowInfo("SQL Mapreg Loading Completed Under %d Seconds.\n",perfomance); return 0; #endif /* TXT_ONLY */ @@ -11912,10 +11913,10 @@ static int script_save_mapreg(void) mapregstr_db->foreach(mapregstr_db,script_save_mapreg_strsub,fp); lock_fclose(fp,mapreg_txt,&lock); #else - int perfomance = (int)time(NULL); + unsigned int perfomance = (unsigned int)time(NULL); mapreg_db->foreach(mapreg_db,script_save_mapreg_intsub); // [zBuffer] mapregstr_db->foreach(mapregstr_db,script_save_mapreg_strsub); - perfomance = ((int)time(NULL) - perfomance) / 1000; + perfomance = ((int)time(NULL) - perfomance); if(perfomance > 2) ShowWarning("Slow Query: MapregSQL Saving @ %d second(s).\n", perfomance); #endif |