summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
authorai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-01-14 21:00:38 +0000
committerai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec>2011-01-14 21:00:38 +0000
commit457cff865b0aa35bef85d8440ddf67c95158aa8b (patch)
tree81952176fc30d931365b22473b30a84db65fe706 /src/char_sql
parent3be161f802c28ddf802862b2c2835061ab45601b (diff)
downloadhercules-457cff865b0aa35bef85d8440ddf67c95158aa8b.tar.gz
hercules-457cff865b0aa35bef85d8440ddf67c95158aa8b.tar.bz2
hercules-457cff865b0aa35bef85d8440ddf67c95158aa8b.tar.xz
hercules-457cff865b0aa35bef85d8440ddf67c95158aa8b.zip
* Replaced remaining occurences of '-1' with 'INVALID_TIMER', where appropriate (follow up to r12998).
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@14670 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c28
-rw-r--r--src/char_sql/int_auction.c2
2 files changed, 15 insertions, 15 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index d8c710dd5..262f585d2 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -202,7 +202,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;
}
@@ -219,9 +219,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)
@@ -260,9 +260,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;
}
//Set char online in guild cache. If char is in memory, use the guild id on it, otherwise seek it.
@@ -305,9 +305,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)
@@ -336,9 +336,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.
@@ -356,7 +356,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
@@ -1722,7 +1722,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;
@@ -1801,7 +1801,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] );
@@ -2008,7 +2008,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
@@ -3628,7 +3628,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;
diff --git a/src/char_sql/int_auction.c b/src/char_sql/int_auction.c
index a51361789..bba693256 100644
--- a/src/char_sql/int_auction.c
+++ b/src/char_sql/int_auction.c
@@ -166,7 +166,7 @@ void auction_delete(struct auction_data *auction)
if( SQL_ERROR == Sql_Query(sql_handle, "DELETE FROM `%s` WHERE `auction_id` = '%d'", auction_db, auction_id) )
Sql_ShowDebug(sql_handle);
- if( auction->auction_end_timer != -1 )
+ if( auction->auction_end_timer != INVALID_TIMER )
delete_timer(auction->auction_end_timer, auction_end_timer);
idb_remove(auction_db_, auction_id);