summaryrefslogtreecommitdiff
path: root/src/char/char.c
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/char.c
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/char.c')
-rw-r--r--src/char/char.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/src/char/char.c b/src/char/char.c
index 93fd5ba44..73efbc864 100644
--- a/src/char/char.c
+++ b/src/char/char.c
@@ -228,6 +228,25 @@ char * search_character_name(int index) {
return unknown_char_name;
}
+//-------------------------------------------------
+// Set Character online/offline [Wizputer]
+//-------------------------------------------------
+
+void set_char_online(int char_id, int account_id) {
+ if (login_fd <= 0 || session[login_fd]->eof)
+ return;
+ WFIFOW(login_fd,0) = 0x272b;
+ WFIFOL(login_fd,2) = account_id;
+ WFIFOSET(login_fd,6);
+}
+void set_char_offline(int char_id, int account_id) {
+ if (login_fd <= 0 || session[login_fd]->eof)
+ return;
+ WFIFOW(login_fd,0) = 0x272c;
+ WFIFOL(login_fd,2) = account_id;
+ WFIFOSET(login_fd,6);
+}
+
/*---------------------------------------------------
Make a data line for friends list
--------------------------------------------------*/
@@ -2526,7 +2545,25 @@ int parse_frommap(int fd) {
RFIFOSKIP(fd, RFIFOW(fd,2));
// printf("char: save_account_reg (from map)\n");
break;
- }
+ }
+ // Character disconnected set online 0 [Wizputer]
+ case 0x2b17:
+ if (RFIFOREST(fd) < 6)
+ return 0;
+ //printf("Setting %d char offline\n",RFIFOL(fd,2));
+ set_char_offline(RFIFOL(fd,2),RFIFOL(fd,6));
+ RFIFOSKIP(fd,10);
+ break;
+
+ // Character set online [Wizputer]
+ case 0x2b19:
+ if (RFIFOREST(fd) < 6)
+ return 0;
+ //printf("Setting %d char online\n",RFIFOL(fd,2));
+ set_char_online(RFIFOL(fd,2),RFIFOL(fd,6));
+ RFIFOSKIP(fd,10);
+ break;
+
default:
// inter serverˆ—‚É“n‚·
{
@@ -3470,6 +3507,7 @@ void do_final(void) {
int do_init(int argc, char **argv) {
int i;
+ SERVER_TYPE = SERVER_CHAR;
char_config_read((argc < 2) ? CHAR_CONF_NAME : argv[1]);
lan_config_read((argc > 1) ? argv[1] : LOGIN_LAN_CONF_NAME);