- Added inter config connection_ping_interval which specifies interval in hours at which mysql_ping's must be done on all connection handles to keep the mysql connection alive. Defaults to 0 (disabled)

- Removed login sql handle from the map server as it isn't used for anything.
- Made the login sql handle on the char-sql server be used only when gm_read_method 1 is enabled.
- Small fixes to npc_enable, added BL_NPC handling on status_get_sc.
- Added a path_search check in map_random_dir, so that the random direction picked up doesn't goes through walls and all that.
- Some changes to close-confine, status start will fail when the source is not found or it doesn't has sc-data.
- pc_setoption no longer changes the character's class when mounting/dismounting, it only changes the view-class.
- The peco-crash-fix from the char servers is still needed. This packet must be wrong! We likely need to sniff it.
- Modified the char-txt server to modify the class of mounted characters to their non-mounted version. Added an upgrade_svn file to handle the class update on the sql tables.


git-svn-id: https://svn.code.sf.net/p/rathena/svn/trunk@5902 54d463be-8e91-2dee-dedb-b68131a5f0ec
This commit is contained in:
skotlex
2006-04-05 00:23:18 +00:00
parent 819d461660
commit 491228d9cc
13 changed files with 216 additions and 106 deletions

View File

@@ -303,6 +303,17 @@ int inter_log(char *fmt,...)
return 0;
}
/*======================================================
* Does a mysql_ping to all connection handles. [Skotlex]
*------------------------------------------------------
*/
int inter_sql_ping(int tid, unsigned int tick, int id, int data)
{
mysql_ping(&mysql_handle);
if(char_gm_read)
mysql_ping(&lmysql_handle);
return 0;
}
@@ -325,15 +336,17 @@ int inter_init(const char *file)
exit(1);
}
else if (inter_sql_test()) {
mysql_init(&lmysql_handle);
ShowInfo("Connect Character DB server.... (login server)\n");
if(!mysql_real_connect(&lmysql_handle, login_server_ip, login_server_id, login_server_pw,
login_server_db ,login_server_port, (char *)NULL, 0)) {
//pointer check
ShowFatalError("%s\n",mysql_error(&lmysql_handle));
exit(1);
}else {
ShowStatus ("Connect Success! (Login Server)\n");
ShowStatus("Connect Success! (Character Server)\n");
}
if(char_gm_read) {
mysql_init(&lmysql_handle);
ShowInfo("Connect Character DB server.... (login server)\n");
if(!mysql_real_connect(&lmysql_handle, login_server_ip, login_server_id, login_server_pw,
login_server_db ,login_server_port, (char *)NULL, 0)) {
//pointer check
ShowFatalError("%s\n",mysql_error(&lmysql_handle));
exit(1);
}else {
ShowStatus ("Connect Success! (Login Server)\n");
}
@@ -341,10 +354,11 @@ int inter_init(const char *file)
if(strlen(default_codepage) > 0 ) {
sprintf( tmp_sql, "SET NAMES %s", default_codepage );
if (mysql_query(&mysql_handle, tmp_sql)) {
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);
}
ShowSQL("DB error - %s\n",mysql_error(&mysql_handle));
ShowDebug("at %s:%d - %s\n", __FILE__,__LINE__,tmp_sql);
}
if(char_gm_read)
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);
}
@@ -357,6 +371,11 @@ int inter_init(const char *file)
inter_pet_sql_init();
inter_accreg_sql_init();
//printf ("interserver timer initializing : %d sec...\n",autosave_interval);
//i=add_timer_interval(gettick()+autosave_interval,inter_save_timer,0,0,autosave_interval);
if (connection_ping_interval) {
add_timer_func_list(inter_sql_ping, "inter_sql_ping");
add_timer_interval(gettick()+connection_ping_interval*60*1000,
inter_sql_ping, 0, 0, connection_ping_interval*60*1000);