summaryrefslogtreecommitdiff
path: root/src/char/char.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/char/char.c')
-rw-r--r--src/char/char.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/char/char.c b/src/char/char.c
index f1b430150..6523decf7 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -184,7 +184,7 @@ static void* create_online_char_data(DBKey key, va_list args)
character->char_id = -1;
character->server = -1;
character->fd = -1;
- character->waiting_disconnect = -1;
+ character->waiting_disconnect = INVALID_TIMER;
return character;
}
@@ -201,9 +201,9 @@ void set_char_charselect(int account_id)
character->char_id = -1;
character->server = -1;
- if(character->waiting_disconnect != -1) {
+ if(character->waiting_disconnect != INVALID_TIMER) {
delete_timer(character->waiting_disconnect, chardb_waiting_disconnect);
- character->waiting_disconnect = -1;
+ character->waiting_disconnect = INVALID_TIMER;
}
if (login_fd > 0 && !session[login_fd]->flag.eof)
@@ -237,9 +237,9 @@ void set_char_online(int map_id, int char_id, int account_id)
server[character->server].users++;
//Get rid of disconnect timer
- if(character->waiting_disconnect != -1) {
+ if(character->waiting_disconnect != INVALID_TIMER) {
delete_timer(character->waiting_disconnect, chardb_waiting_disconnect);
- character->waiting_disconnect = -1;
+ character->waiting_disconnect = INVALID_TIMER;
}
//Notify login server
@@ -262,9 +262,9 @@ void set_char_offline(int char_id, int account_id)
if( server[character->server].users > 0 ) // Prevent this value from going negative.
server[character->server].users--;
- if(character->waiting_disconnect != -1){
+ if(character->waiting_disconnect != INVALID_TIMER){
delete_timer(character->waiting_disconnect, chardb_waiting_disconnect);
- character->waiting_disconnect = -1;
+ character->waiting_disconnect = INVALID_TIMER;
}
if(character->char_id == char_id)
@@ -293,9 +293,9 @@ static int char_db_setoffline(DBKey key, void* data, va_list ap)
if (server == -1) {
character->char_id = -1;
character->server = -1;
- if(character->waiting_disconnect != -1){
+ if(character->waiting_disconnect != INVALID_TIMER){
delete_timer(character->waiting_disconnect, chardb_waiting_disconnect);
- character->waiting_disconnect = -1;
+ character->waiting_disconnect = INVALID_TIMER;
}
} else if (character->server == server)
character->server = -2; //In some map server that we aren't connected to.
@@ -313,7 +313,7 @@ static int char_db_kickoffline(DBKey key, void* data, va_list ap)
//Kick out any connected characters, and set them offline as appropiate.
if (character->server > -1)
mapif_disconnectplayer(server[character->server].fd, character->account_id, character->char_id, 1);
- else if (character->waiting_disconnect == -1)
+ else if (character->waiting_disconnect == INVALID_TIMER)
set_char_offline(character->char_id, character->account_id);
else
return 0; // fail
@@ -1937,7 +1937,7 @@ static void char_auth_ok(int fd, struct char_session_data *sd)
if (character->server > -1)
{ //Character already online. KICK KICK KICK
mapif_disconnectplayer(server[character->server].fd, character->account_id, character->char_id, 2);
- if (character->waiting_disconnect == -1)
+ if (character->waiting_disconnect == INVALID_TIMER)
character->waiting_disconnect = add_timer(gettick()+20000, chardb_waiting_disconnect, character->account_id, 0);
WFIFOW(fd,0) = 0x81;
WFIFOB(fd,2) = 8;
@@ -2016,7 +2016,7 @@ int parse_fromlogin(int fd)
ShowStatus("Connected to login-server (connection #%d).\n", fd);
//Send online accounts to login server.
- send_accounts_tologin(-1, gettick(), 0, 0);
+ send_accounts_tologin(INVALID_TIMER, gettick(), 0, 0);
// if no map-server already connected, display a message...
ARR_FIND( 0, MAX_MAP_SERVERS, i, server[i].fd > 0 && server[i].map[0] );
@@ -2222,7 +2222,7 @@ int parse_fromlogin(int fd)
if( character->server > -1 )
{ //Kick it from the map server it is on.
mapif_disconnectplayer(server[character->server].fd, character->account_id, character->char_id, 2);
- if (character->waiting_disconnect == -1)
+ if (character->waiting_disconnect == INVALID_TIMER)
character->waiting_disconnect = add_timer(gettick()+AUTH_TIMEOUT, chardb_waiting_disconnect, character->account_id, 0);
}
else
@@ -3838,7 +3838,7 @@ static int chardb_waiting_disconnect(int tid, unsigned int tick, int id, intptr
struct online_char_data* character;
if ((character = (struct online_char_data*)idb_get(online_char_db, id)) != NULL && character->waiting_disconnect == tid)
{ //Mark it offline due to timeout.
- character->waiting_disconnect = -1;
+ character->waiting_disconnect = INVALID_TIMER;
set_char_offline(character->char_id, character->account_id);
}
return 0;