summaryrefslogtreecommitdiff
path: root/src/map/clif.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-27 14:54:01 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-27 14:54:01 +0000
commit036bbfd9ae5a4a77031fb33a87264e58214c2ba0 (patch)
tree7df6db240c83ab4c0e7b5733dee337c0583010b8 /src/map/clif.c
parentf68366250c523440b972616f61577edfe6d51c04 (diff)
downloadhercules-036bbfd9ae5a4a77031fb33a87264e58214c2ba0.tar.gz
hercules-036bbfd9ae5a4a77031fb33a87264e58214c2ba0.tar.bz2
hercules-036bbfd9ae5a4a77031fb33a87264e58214c2ba0.tar.xz
hercules-036bbfd9ae5a4a77031fb33a87264e58214c2ba0.zip
- Fixed indentation on int_pet.c (how did it got messed up?)
- Added mapflag "loadevent", now load-map script events will ONLY trigger on maps with this mapflag on, rather than every map. - High Jump can now be used in all versus maps. - Added Kaite's opt3 value, taken from jA - Added state dirty == 2 to storages. Signals when a storage was sent for final saving. Said storage is removed from memory after the ack from the char-server, and they are sent to save if the map/char servers reconnect before the act arrives. In short: they are guaranteed to be saved after a char logs out. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7358 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/clif.c')
-rw-r--r--src/map/clif.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/src/map/clif.c b/src/map/clif.c
index e25b89a8f..1698045e2 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -8207,7 +8207,7 @@ void clif_parse_LoadEndAck(int fd,struct map_session_data *sd)
sc_start(&sd->bl,SC_NOCHAT,100,0,0);
// Lance
- if(sd->state.event_loadmap){
+ if(sd->state.event_loadmap && map[sd->bl.m].flag.loadevent){
pc_setregstr(sd, add_str("@maploaded$"), map[sd->bl.m].name);
npc_script_event(sd, NPCE_LOADMAP);
}
@@ -9848,8 +9848,6 @@ void clif_parse_NpcStringInput(int fd,struct map_session_data *sd)
if(message_len >= sizeof(sd->npc_str)){
ShowWarning("clif: input string too long !\n");
message_len = sizeof(sd->npc_str);
- } else {
- message_len += 1; // Null character
}
// Exploit prevention if crafted packets (without null) is being sent. [Lance]
@@ -9972,12 +9970,18 @@ void clif_parse_ResetChar(int fd, struct map_session_data *sd) {
*/
void clif_parse_LGMmessage(int fd, struct map_session_data *sd) {
unsigned char buf[512];
- int len = RFIFOREST(fd);
+// int len = RFIFOREST(fd);
int plen = RFIFOW(fd,2);
RFIFOHEAD(fd);
- if(plen <= 0 || plen > len) // Possible hack! [Lance]
- plen = len;
+ //This shouldn't be needed.... because the parsing code makes sure
+ //this function is not invoked until enough bytes have been received.
+ //So if the client "hacks" the packet, all that will happen is that
+ //it will not be parsed until enough data is received, on which point
+ //the following packets will be offset, causing them to fail to parse,
+ //which leads to disconnecting them :3 [Skotlex]
+// if(plen <= 0 || plen > len) // Possible hack! [Lance]
+// plen = len;
if ((battle_config.atc_gmonly == 0 || pc_isGM(sd)) &&
(pc_isGM(sd) >= get_atcommand_level(AtCommand_LocalBroadcast))) {