summaryrefslogtreecommitdiff
path: root/src/map/map.c
diff options
context:
space:
mode:
authorwizputer <wizputer@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-28 00:01:39 +0000
committerwizputer <wizputer@54d463be-8e91-2dee-dedb-b68131a5f0ec>2004-11-28 00:01:39 +0000
commit6a079edada5a1abdbba3be15d0a8ac5f72fda0a9 (patch)
tree0ac2cf6071f6154f48f3816750cb9c56875cd4fa /src/map/map.c
parentee2e4d8299abc3723b43ba915b01a7577a75c6cf (diff)
downloadhercules-6a079edada5a1abdbba3be15d0a8ac5f72fda0a9.tar.gz
hercules-6a079edada5a1abdbba3be15d0a8ac5f72fda0a9.tar.bz2
hercules-6a079edada5a1abdbba3be15d0a8ac5f72fda0a9.tar.xz
hercules-6a079edada5a1abdbba3be15d0a8ac5f72fda0a9.zip
Fixed online system, online column works and prevent double login at the login server
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@392 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/map.c')
-rw-r--r--src/map/map.c32
1 files changed, 5 insertions, 27 deletions
diff --git a/src/map/map.c b/src/map/map.c
index 254883e93..4a7c111b8 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -1570,8 +1570,8 @@ static int map_readmap(int m,char *fn, char *alias) {
if(gat==NULL)
return -1;
-// printf("\rLoading Maps [%d/%d]: %-50s ",m,map_num,fn);
-// fflush(stdout);
+ printf("\rLoading Maps [%d/%d]: %-50s ",m,map_num,fn);
+ fflush(stdout);
map[m].m=m;
xs=map[m].xs=*(int*)(gat+6);
@@ -2054,25 +2054,6 @@ int sql_config_read(char *cfgName)
return 0;
}
-// sql online status checking [Valaris]
-void char_offline(struct map_session_data *sd)
-{
- if(sd && sd->status.char_id) {
- sprintf(tmp_sql,"UPDATE `%s` SET `online`='0' WHERE `char_id`='%d'", char_db, sd->status.char_id);
- if(mysql_query(&mmysql_handle, tmp_sql) ) {
- printf("DB server Error (update online `%s`)- %s\n", char_db, mysql_error(&mmysql_handle) );
- }
- }
-}
-
-void do_reset_online(void)
-{
- sprintf(tmp_sql,"UPDATE `%s` SET `online`='0' WHERE `online`='1'", char_db);
- if(mysql_query(&mmysql_handle, tmp_sql) ) {
- printf("DB server Error (reset_online `%s`)- %s\n", char_db, mysql_error(&mmysql_handle) );
- }
-}
-
int online_timer(int tid,unsigned int tick,int id,int data)
{
if(check_online_timer != tid)
@@ -2090,16 +2071,13 @@ void char_online_check(void)
int i;
struct map_session_data *sd=NULL;
- do_reset_online();
+ chrif_char_reset_offline();
for(i=0;i<fd_max;i++){
if (session[i] && (sd = session[i]->session_data) && sd && sd->state.auth &&
!(battle_config.hide_GM_session && pc_isGM(sd)))
if(sd->status.char_id) {
- sprintf(tmp_sql,"UPDATE `%s` SET `online`='1' WHERE `char_id`='%d'", char_db, sd->status.char_id);
- if(mysql_query(&mmysql_handle, tmp_sql) ) {
- printf("DB server Error (update online `%s`)- %s\n", char_db, mysql_error(&mmysql_handle) );
- }
+ chrif_char_online(sd);
}
}
@@ -2199,7 +2177,7 @@ void do_final(void) {
do_final_storage();
do_final_guild();
#ifndef TXT_ONLY
- do_reset_online();
+ chrif_char_reset_offline();
map_sql_close();
#endif /* not TXT_ONLY */
}