summaryrefslogtreecommitdiff
path: root/src/char_sql
diff options
context:
space:
mode:
authorcelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-05 14:57:03 +0000
committercelest <celest@54d463be-8e91-2dee-dedb-b68131a5f0ec>2005-04-05 14:57:03 +0000
commitec7f5035ca95489c32d7e49f4b0f8f1c76d36d7f (patch)
treefdf066cd04f332c90c78670fe94104e2f9c89e06 /src/char_sql
parent573c40f53e1d0fe29c72117fc4ca2d931b274d8c (diff)
downloadhercules-ec7f5035ca95489c32d7e49f4b0f8f1c76d36d7f.tar.gz
hercules-ec7f5035ca95489c32d7e49f4b0f8f1c76d36d7f.tar.bz2
hercules-ec7f5035ca95489c32d7e49f4b0f8f1c76d36d7f.tar.xz
hercules-ec7f5035ca95489c32d7e49f4b0f8f1c76d36d7f.zip
* Simplified Valaris' online_timer
* Updated Fogwall, Spiderweb, and HP Conversion * Adding saving character online/offline for TXT char and login (unfinished) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/stable@1411 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/char_sql')
-rw-r--r--src/char_sql/char.c23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/char_sql/char.c b/src/char_sql/char.c
index 1f90c27e1..d672bc0eb 100644
--- a/src/char_sql/char.c
+++ b/src/char_sql/char.c
@@ -208,18 +208,18 @@ void set_char_offline(int char_id, int account_id) {
if ( char_id == 99 )
sprintf(tmp_sql,"UPDATE `%s` SET `online`='0' WHERE `account_id`='%d'", char_db, account_id);
- else {
- cp = (struct mmo_charstatus*)numdb_search(char_db_,char_id);
- if (cp != NULL) {
- aFree(cp);
- numdb_erase(char_db_,char_id);
- }
+ else {
+ cp = (struct mmo_charstatus*)numdb_search(char_db_,char_id);
+ if (cp != NULL) {
+ aFree(cp);
+ numdb_erase(char_db_,char_id);
+ }
- sprintf(tmp_sql,"UPDATE `%s` SET `online`='0' WHERE `char_id`='%d'", char_db, char_id);
+ sprintf(tmp_sql,"UPDATE `%s` SET `online`='0' WHERE `char_id`='%d'", char_db, char_id);
- if (mysql_query(&mysql_handle, tmp_sql))
- printf("DB server Error (set_char_offline)- %s\n", mysql_error(&mysql_handle));
- }
+ if (mysql_query(&mysql_handle, tmp_sql))
+ printf("DB server Error (set_char_offline)- %s\n", mysql_error(&mysql_handle));
+ }
if (login_fd <= 0 || session[login_fd]->eof)
return;
@@ -2372,7 +2372,7 @@ int parse_char(int fd) {
sd = (struct char_session_data*)session[fd]->session_data;
- if(login_fd < 0)
+ if(login_fd < 0)
session[fd]->eof = 1;
if(session[fd]->eof) {
if (fd == login_fd)
@@ -3387,6 +3387,7 @@ int flush_timer(int tid, unsigned int tick, int id, int data){
int do_init(int argc, char **argv){
int i;
+ SERVER_TYPE = SERVER_CHAR;
for(i = 0; i < MAX_MAP_SERVERS; i++) {
memset(&server[i], 0, sizeof(struct mmo_map_server));
server_fd[i] = -1;