summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-09 03:18:16 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2007-05-09 03:18:16 +0000
commit290fb53feea76f9749e4630ec71552e41afa59de (patch)
tree9caf07f59c86716b5f4105d22b3cb65e89386cf2 /src/map/clif.c
parent89b8b179b6864e5ce5d8b22a52feac761f66e77c (diff)
downloadhercules-290fb53feea76f9749e4630ec71552e41afa59de.tar.gz
hercules-290fb53feea76f9749e4630ec71552e41afa59de.tar.bz2
hercules-290fb53feea76f9749e4630ec71552e41afa59de.tar.xz
hercules-290fb53feea76f9749e4630ec71552e41afa59de.zip
* Added Buuyo-Tama's shortlist for send/eof sockets (defined out for now).
* Replaced toupper/tolower in ladmin by TOUPPER/TOLOWER defines. Shortlist: It's a list of sockets that have data to send and/or are ready for eof processing. It aims to reduce the amount of time spent on do_sendrecv, where it was spending ~13.5% of execution time on a server with 1k users at WoE. thanks to Buuyo-tama for the profile info and code git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@10506 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index 15642ee62..ce70feaf9 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -4,12 +4,6 @@
#define DUMP_UNKNOWN_PACKET 0
#define DUMP_ALL_PACKETS 0
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdarg.h>
-#include <time.h>
-
#include "../common/cbasetypes.h"
#include "../common/socket.h"
#include "../common/timer.h"
@@ -21,7 +15,6 @@
#include "map.h"
#include "chrif.h"
-#include "clif.h"
#include "pc.h"
#include "status.h"
#include "npc.h"
@@ -44,6 +37,13 @@
#include "mercenary.h" //[orn]
#include "log.h"
#include "irc.h"
+#include "clif.h"
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include <stdarg.h>
+#include <time.h>
struct Clif_Config {
int packet_db_ver; //Preferred packet version.
@@ -1622,7 +1622,7 @@ void clif_quitsave(int fd,struct map_session_data *sd)
*/
static int clif_waitclose(int tid, unsigned int tick, int id, int data) {
if (session[id] && session[id]->func_parse == clif_parse) //Avoid disconnecting non-players, as pointed out by End of Exam [Skotlex]
- session[id]->eof = 1;
+ set_eof(id);
return 0;
}
@@ -11873,7 +11873,7 @@ int clif_parse(int fd)
packet_ver = sd->packet_ver;
if (packet_ver < 0 || packet_ver > MAX_PACKET_VER) { // This should never happen unless we have some corrupted memory issues :X [Skotlex]
ShowWarning("clif_parse: Disconnecting session #%d (AID:%d/CID:%d) for having invalid packet_ver=%d.", fd, sd->status.account_id, sd->status.char_id, packet_ver);
- session[fd]->eof = 1;
+ set_eof(fd);
return 0;
}
} else {
@@ -11909,7 +11909,7 @@ int clif_parse(int fd)
// ゲーム用以外パケットか、認証を終える前に0072以外が来たら、切断する
if (cmd > MAX_PACKET_DB || packet_db[packet_ver][cmd].len == 0) { // if packet is not inside these values: session is incorrect?? or auth packet is unknown
ShowWarning("clif_parse: Received unsupported packet (packet 0x%04x, %d bytes received), disconnecting session #%d.\n", cmd, RFIFOREST(fd), fd);
- session[fd]->eof = 1;
+ set_eof(fd);
return 0;
}
@@ -11922,7 +11922,7 @@ int clif_parse(int fd)
packet_len = RFIFOW(fd,2);
if (packet_len < 4 || packet_len > 32768) {
ShowWarning("clif_parse: Packet 0x%04x specifies invalid packet_len (%d), disconnecting session #%d.\n", cmd, packet_len, fd);
- session[fd]->eof =1;
+ set_eof(fd);
return 0;
}
}