diff options
author | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-12-26 22:36:41 +0000 |
---|---|---|
committer | ai4rei <ai4rei@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2010-12-26 22:36:41 +0000 |
commit | 6096ce0b42a3eee07dc70ae5ef489aa4c30bf515 (patch) | |
tree | e91f8afd3b7b8b80f0c55aae07f7a478f469c37a /src/map/chrif.c | |
parent | 23e1b7db5ba2277a406fc84c30e87c324a83097c (diff) | |
download | hercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.tar.gz hercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.tar.bz2 hercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.tar.xz hercules-6096ce0b42a3eee07dc70ae5ef489aa4c30bf515.zip |
* Merged changes from trunk [14496:14630/trunk].
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/branches/renewal@14632 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/chrif.c')
-rw-r--r-- | src/map/chrif.c | 38 |
1 files changed, 8 insertions, 30 deletions
diff --git a/src/map/chrif.c b/src/map/chrif.c index 40e7ca8d1..a9634d2c2 100644 --- a/src/map/chrif.c +++ b/src/map/chrif.c @@ -74,7 +74,7 @@ static const int packet_len_table[0x3d] = { // U - used, F - free //2b13: Incoming, chrif_accountdeletion -> 'Delete acc XX, if the player is on, kick ....' //2b14: Incoming, chrif_accountban -> 'not sure: kick the player with message XY' //2b15: FREE -//2b16: Outgoing, chrif_ragsrvinfo -> 'sends motd / rates ....' +//2b16: Outgoing, chrif_ragsrvinfo -> 'sends base / job / drop rates ....' //2b17: Outgoing, chrif_char_offline -> 'tell the charserver that the char is now offline' //2b18: Outgoing, chrif_char_reset_offline -> 'set all players OFF!' //2b19: Outgoing, chrif_char_online -> 'tell the charserver that the char .. is online' @@ -1229,40 +1229,18 @@ int chrif_load_scdata(int fd) /*========================================== * Send rates and motd to char server [Wizputer] - * S 2b16 <base rate>.w <job rate>.w <drop rate>.w <motd len>.w <motd>.256B + * S 2b16 <base rate>.L <job rate>.L <drop rate>.L *------------------------------------------*/ - int chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate) +int chrif_ragsrvinfo(int base_rate, int job_rate, int drop_rate) { - char buf[256]; - FILE *fp; - int i; - chrif_check(-1); - WFIFOHEAD(char_fd, sizeof(buf) + 10); + WFIFOHEAD(char_fd,14); WFIFOW(char_fd,0) = 0x2b16; - WFIFOW(char_fd,2) = base_rate; - WFIFOW(char_fd,4) = job_rate; - WFIFOW(char_fd,6) = drop_rate; - WFIFOW(char_fd,8) = sizeof(buf) + 10; - - if ((fp = fopen(motd_txt, "r")) != NULL) { - if (fgets(buf, sizeof(buf), fp) != NULL) - { - for(i = 0; buf[i]; i++) { - if (buf[i] == '\r' || buf[i] == '\n') { - buf[i] = 0; - break; - } - } - memcpy(WFIFOP(char_fd,10), buf, sizeof(buf)); - } - fclose(fp); - } else { - memset(buf, 0, sizeof(buf)); //No data found, send empty packets? - memcpy(WFIFOP(char_fd,10), buf, sizeof(buf)); - } - WFIFOSET(char_fd,WFIFOW(char_fd,8)); + WFIFOL(char_fd,2) = base_rate; + WFIFOL(char_fd,6) = job_rate; + WFIFOL(char_fd,10) = drop_rate; + WFIFOSET(char_fd,14); return 0; } |