summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-09 15:57:22 +0000
committerFlavioJS <FlavioJS@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-12-09 15:57:22 +0000
commit91d42beda228772338cecadda47c7fd50217c60f (patch)
tree1544588bc5d896b581064e0182df75ef02c1f70d
parent8c1a525cdb55bd21309396d82d2d507adaebd794 (diff)
downloadhercules-91d42beda228772338cecadda47c7fd50217c60f.tar.gz
hercules-91d42beda228772338cecadda47c7fd50217c60f.tar.bz2
hercules-91d42beda228772338cecadda47c7fd50217c60f.tar.xz
hercules-91d42beda228772338cecadda47c7fd50217c60f.zip
- Reversed revision #9415 (messages with server_tick field being sent as soon as possible) since it didn't fix the client synchronization issue.
- clif_parse_TickSend is sent immediately so the client gets accurate "pings" Note: in Changelog, for my changes, if they're grouped together and in the same day I'm only gonna "sign" the bottom line. All unsigned lines are assumed to be from the same person of the previous line (below). (easier searches =P) git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@9443 54d463be-8e91-2dee-dedb-b68131a5f0ec
-rw-r--r--Changelog-Trunk.txt30
-rw-r--r--src/common/plugins.c8
-rw-r--r--src/common/socket.c6
-rw-r--r--src/common/socket.h4
-rw-r--r--src/map/clif.c53
-rw-r--r--src/map/clif.h4
6 files changed, 46 insertions, 59 deletions
diff --git a/Changelog-Trunk.txt b/Changelog-Trunk.txt
index 40c9cf576..1a849f959 100644
--- a/Changelog-Trunk.txt
+++ b/Changelog-Trunk.txt
@@ -3,6 +3,11 @@ Date Added
AS OF SVN REV. 5091, WE ARE NOW USING TRUNK. ALL UNTESTED BUGFIXES/FEATURES GO INTO TRUNK.
IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
+2006/12/09
+ * Reversed revision #9415 (messages with server_tick field being sent as
+ soon as possible) since it didn't fix the client synchronization issue.
+ * clif_parse_TickSend is sent immediately so the client gets accurate
+ "pings". [FlavioJS]
2006/12/08
* Now you can request a trade regardless of the state of the target trader.
[Skotlex]
@@ -52,7 +57,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
version.
[Skotlex]
* Messages with server_tick field are sent as soon as possible now.
- This might fix client synchronization issues. [FlavioJS]
+ This might fix client synchronization issues.
* Added StringBuf_Vprintf to utils.c and changed the showmsg.c buffer.
Now it uses a static buffer and a StringBuf when needed (a debug message
indicating the static buffer needs to be increased is shown). [FlavioJS]
@@ -62,12 +67,11 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
* Fixed sc data load failing when using charsave_method: 1 [Skotlex]
* Fixed the interserver link reserve size being 8 times instead of 1/8th
the default size. Changed it to be 1/4th as well. [Skotlex]
- * Found the position of emblem_id in packet 1b6. [FlavioJS]
+ * Found the position of emblem_id in packet 1b6.
* Moved START_ACCOUNT_NUM and END_ACCOUNT_NUM from login.h to mmo.h and
- changed clif_guess_PacketVer to use that. [FlavioJS]
- * Made the script engine big-endian compatible. [FlavioJS]
- * Commented out the remnants of ladmin packet parsing in map-server.
- [FlavioJS]
+ changed clif_guess_PacketVer to use that.
+ * Made the script engine big-endian compatible.
+ * Commented out the remnants of ladmin packet parsing in map-server.
* Added a warning when a player has an invalid packet version (shouldn't
happen). [FlavioJS]
2006/12/04
@@ -109,13 +113,13 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
stuck char) [Skotlex]
* Fixed even share exp flutuating as described in:
http://www.eathena.ws/board/index.php?showtopic=126139
- thanks to TheUltraMague for the fix. [FlavioJS]
- * Made ers double frees report as missing entries on destruction. [FlavioJS]
+ thanks to TheUltraMague for the fix.
+ * Made ers double frees report as missing entries on destruction.
* Only one swap function (in cbasetypes.h) is used. [FlavioJS]
2006/12/02
* Added buildin_checkvending and buildin_checkchatting. [Lance]
* Enabled atcommand parsing for clients with Korean langtype and version. [Lance]
- * Added missing min/max definitions to cbasetypes.h, needed for the @send change. [FlavioJS]
+ * Added missing min/max definitions to cbasetypes.h, needed for the @send change.
* Replaced @send with the version I use for testing packets.
Can display the packet length. Supports dynamic packets, quoted strings
with escaped characters and fixed/variable length, and normal/hex
@@ -140,7 +144,7 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
* Fixed land effects not taking effect inmediately on map-load when the
invincible timer is disabled. [Skotlex]
2006/11/29
- * Probably fixed the Segmentation Faults we've been having. [FlavioJS]
+ * Probably fixed the Segmentation Faults we've been having.
Description: A player quits and it's session is freed and set to NULL,
but the char server already sent a packet with player information
(registers, storage, ...). If a message is sent in consequence of
@@ -189,9 +193,9 @@ IF YOU HAVE A WORKING AND TESTED BUGFIX PUT IT INTO STABLE AS WELL AS TRUNK.
exp at all. [Skotlex]
* Changed write to send as suggested by TheUltraMage in:
http://www.eathena.ws/board/index.php?showtopic=105417
- Hopefully that will take care of the SIGPIPE problem in Debian and cygwin. [FlavioJS]
- * Server name in core.c skipping '\\' characters. [FlavioJS]
- * Memory allocation functions using file,line,func from the invoking functions. [FlavioJS]
+ Hopefully that will take care of the SIGPIPE problem in Debian and cygwin.
+ * Server name in core.c skipping '\\' characters.
+ * Memory allocation functions using file,line,func from the invoking functions.
* Other minor malloc changes. [FlavioJS]
2006/11/27
* Now when a player's "attack once" request fails due to range, the client
diff --git a/src/common/plugins.c b/src/common/plugins.c
index 9da12c35f..5951885a1 100644
--- a/src/common/plugins.c
+++ b/src/common/plugins.c
@@ -291,12 +291,6 @@ int plugins_config_read(const char *cfgName)
return 0;
}
-/// backward compatibillity function
-int plugin_WFIFOSET(int fd,int len)
-{
- return _WFIFOSET(fd,len,0);
-}
-
void plugins_init (void)
{
char *PLUGIN_CONF_FILENAME = "conf/plugin_athena.conf";
@@ -308,7 +302,7 @@ void plugins_init (void)
// networking
export_symbol (func_parse_table, 18);
export_symbol (RFIFOSKIP, 17);
- export_symbol (plugin_WFIFOSET, 16);
+ export_symbol (WFIFOSET, 16);
export_symbol (delete_session, 15);
export_symbol (session, 14);
export_symbol (&fd_max, 13);
diff --git a/src/common/socket.c b/src/common/socket.c
index dcaf2cdf2..fafa229df 100644
--- a/src/common/socket.c
+++ b/src/common/socket.c
@@ -687,7 +687,7 @@ int realloc_writefifo(int fd, size_t addition)
return 0;
}
-int _WFIFOSET(int fd, int len, char flush)
+int WFIFOSET(int fd,int len)
{
size_t newreserve;
struct socket_data *s = session[fd];
@@ -712,9 +712,7 @@ int _WFIFOSET(int fd, int len, char flush)
// For inter-server connections, let the reserve be 1/4th of the link size.
newreserve = s->wdata_size + (s->max_wdata>=FIFOSIZE_SERVERLINK?FIFOSIZE_SERVERLINK/4:wfifo_size);
- if( flush )
- flush_fifo(fd);
- else if(s->wdata_size >= frame_size)
+ if(s->wdata_size >= frame_size)
send_from_fifo(fd);
// realloc after sending
diff --git a/src/common/socket.h b/src/common/socket.h
index 2c0412a9e..9552575f3 100644
--- a/src/common/socket.h
+++ b/src/common/socket.h
@@ -67,8 +67,6 @@ extern time_t stall_time;
#define WFIFOL(fd,pos) (*(unsigned long*)WFIFOP(fd,pos))
// use function instead of macro.
//#define WFIFOSET(fd,len) (session[fd]->wdata_size = (session[fd]->wdata_size + (len) + 2048 < session[fd]->max_wdata) ? session[fd]->wdata_size + len : session[fd]->wdata_size)
-#define WFIFOSET(fd,len) _WFIFOSET(fd,len,0)
-#define WFIFOSET2(fd,len,flush) _WFIFOSET(fd,len,flush)
#define WBUFP(p,pos) (((unsigned char*)(p)) + (pos))
#define WBUFB(p,pos) (*(unsigned char*)((p) + (pos)))
#define WBUFW(p,pos) (*(unsigned short*)((p) + (pos)))
@@ -151,7 +149,7 @@ int make_connection(long,int);
int delete_session(int);
int realloc_fifo(int fd,unsigned int rfifo_size,unsigned int wfifo_size);
int realloc_writefifo(int fd, size_t addition);
-int _WFIFOSET(int fd,int len,char flush);
+int WFIFOSET(int fd,int len);
int RFIFOSKIP(int fd,int len);
int do_sendrecv(int next);
diff --git a/src/map/clif.c b/src/map/clif.c
index 50b2eb0ca..b6eb99d9e 100644
--- a/src/map/clif.c
+++ b/src/map/clif.c
@@ -276,7 +276,6 @@ int clif_send_sub(struct block_list *bl, va_list ap)
struct map_session_data *sd;
unsigned char *buf;
int len, type, fd;
- char flush;
nullpo_retr(0, bl);
nullpo_retr(0, ap);
@@ -290,7 +289,6 @@ int clif_send_sub(struct block_list *bl, va_list ap)
len = va_arg(ap,int);
nullpo_retr(0, src_bl = va_arg(ap,struct block_list*));
type = va_arg(ap,int);
- flush = (char)va_arg(ap,int);
switch(type) {
case AREA_WOS:
@@ -374,7 +372,7 @@ int clif_send_sub(struct block_list *bl, va_list ap)
}
}
}
- WFIFOSET2(fd,len,flush);
+ WFIFOSET(fd,len);
}
}
}
@@ -386,7 +384,7 @@ int clif_send_sub(struct block_list *bl, va_list ap)
*
*------------------------------------------
*/
-int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, char flush) {
+int clif_send (unsigned char *buf, int len, struct block_list *bl, int type) {
int i;
struct map_session_data *sd = NULL;
struct party_data *p = NULL;
@@ -410,7 +408,7 @@ int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, cha
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
WFIFOHEAD(i, len);
memcpy(WFIFOP(i,0), buf, len);
- WFIFOSET2(i,len,flush);
+ WFIFOSET(i,len);
}
}
}
@@ -423,7 +421,7 @@ int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, cha
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
WFIFOHEAD(i,len);
memcpy(WFIFOP(i,0), buf, len);
- WFIFOSET2(i,len,flush);
+ WFIFOSET(i,len);
}
}
}
@@ -431,15 +429,15 @@ int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, cha
case AREA:
case AREA_WOSC:
if (sd && bl->prev == NULL) //Otherwise source misses the packet.[Skotlex]
- clif_send2(buf, len, bl, SELF, flush);
+ clif_send (buf, len, bl, SELF);
case AREA_WOC:
case AREA_WOS:
map_foreachinarea(clif_send_sub, bl->m, bl->x-AREA_SIZE, bl->y-AREA_SIZE, bl->x+AREA_SIZE, bl->y+AREA_SIZE,
- BL_PC, buf, len, bl, type, flush);
+ BL_PC, buf, len, bl, type);
break;
case AREA_CHAT_WOC:
map_foreachinarea(clif_send_sub, bl->m, bl->x-(AREA_SIZE-5), bl->y-(AREA_SIZE-5),
- bl->x+(AREA_SIZE-5), bl->y+(AREA_SIZE-5), BL_PC, buf, len, bl, AREA_WOC, flush);
+ bl->x+(AREA_SIZE-5), bl->y+(AREA_SIZE-5), BL_PC, buf, len, bl, AREA_WOC);
break;
case CHAT:
case CHAT_WOS:
@@ -460,7 +458,7 @@ int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, cha
{
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
- WFIFOSET2(fd,len,flush);
+ WFIFOSET(fd,len);
}
}
}
@@ -474,7 +472,7 @@ int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, cha
{
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
- WFIFOSET2(fd,len,flush);
+ WFIFOSET(fd, len);
}
}
break;
@@ -512,7 +510,7 @@ int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, cha
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
- WFIFOSET2(fd,len,flush);
+ WFIFOSET(fd,len);
}
}
if (!enable_spy) //Skip unnecessary parsing. [Skotlex]
@@ -526,7 +524,7 @@ int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, cha
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
- WFIFOSET2(fd,len,flush);
+ WFIFOSET(fd,len);
}
}
}
@@ -546,7 +544,7 @@ int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, cha
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) {
WFIFOHEAD(i, len);
memcpy(WFIFOP(i,0), buf, len);
- WFIFOSET2(i,len,flush);
+ WFIFOSET(i,len);
}
}
}
@@ -555,7 +553,7 @@ int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, cha
if (sd && (fd=sd->fd) && packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
- WFIFOSET2(fd,len,flush);
+ WFIFOSET(fd,len);
}
break;
@@ -593,7 +591,7 @@ int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, cha
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
- WFIFOSET2(fd,len,flush);
+ WFIFOSET(fd,len);
}
}
}
@@ -606,7 +604,7 @@ int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, cha
if (packet_db[sd->packet_ver][RBUFW(buf,0)].len) { // packet must exist for the client version
WFIFOHEAD(fd,len);
memcpy(WFIFOP(fd,0), buf, len);
- WFIFOSET2(fd,len,flush);
+ WFIFOSET(fd,len);
}
}
}
@@ -643,7 +641,7 @@ int clif_authok(struct map_session_data *sd) {
WFIFOPOS(fd, 6, sd->bl.x, sd->bl.y, sd->ud.dir);
WFIFOB(fd, 9) = 5;
WFIFOB(fd,10) = 5;
- WFIFOSET2(fd,packet_len_table[0x73],1);//send immediately
+ WFIFOSET(fd,packet_len_table[0x73]);
return 0;
}
@@ -1667,7 +1665,7 @@ int clif_walkok(struct map_session_data *sd)
WFIFOL(fd,2)=gettick();
WFIFOPOS2(fd,6,sd->bl.x,sd->bl.y,sd->ud.to_x,sd->ud.to_y);
WFIFOB(fd,11)=0x88;
- WFIFOSET2(fd,packet_len_table[0x87],1);//send immediately
+ WFIFOSET(fd,packet_len_table[0x87]);
return 0;
}
@@ -1702,7 +1700,7 @@ int clif_movepc(struct map_session_data *sd) {
WBUFPOS2(buf,50,sd->bl.x,sd->bl.y,sd->ud.to_x,sd->ud.to_y);
WBUFB(buf,56)=5;
WBUFB(buf,57)=5;
- clif_send2(buf, packet_len_table[0x7b], &sd->bl, SELF, 1);
+ clif_send(buf, packet_len_table[0x7b], &sd->bl, SELF);
}
return 0;
@@ -1728,7 +1726,7 @@ int clif_move(struct block_list *bl) {
nullpo_retr(0, ud);
len = clif_set007b(bl,vd,ud,buf);
- clif_send2(buf,len,bl,AREA_WOS,1);
+ clif_send(buf,len,bl,AREA_WOS);
if (disguised(bl))
clif_setdisguise((TBL_PC*)bl, buf, len, 0);
@@ -3885,7 +3883,7 @@ void clif_getareachar_char(struct map_session_data* sd,struct block_list *bl)
WFIFOHEAD(fd, packet_len_table[0x7b]);
#endif
len = clif_set007b(bl,vd,ud,WFIFOP(fd,0));
- WFIFOSET2(fd,len,1);//send immediately
+ WFIFOSET(fd,len);
} else {
#if PACKETVER > 6
WFIFOHEAD(fd,packet_len_table[0x22a]);
@@ -3941,7 +3939,6 @@ int clif_fixpos2(struct block_list* bl)
struct view_data *vd;
unsigned char buf[256];
int len;
- char flush=0;
nullpo_retr(0, bl);
ud = unit_bl2ud(bl);
@@ -3950,19 +3947,16 @@ int clif_fixpos2(struct block_list* bl)
return 0;
if(ud && ud->walktimer != -1)
- {
len = clif_set007b(bl,vd,ud,buf);
- flush=1;
- }
else
len = clif_set0078(bl,vd,buf);
if (disguised(bl)) {
- clif_send2(buf,len,bl,AREA_WOS,flush);
+ clif_send(buf,len,bl,AREA_WOS);
clif_setdisguise((TBL_PC*)bl, buf, len, 0);
clif_setdisguise((TBL_PC*)bl, buf, len, 1);
} else
- clif_send2(buf,len,bl,AREA,flush);
+ clif_send(buf,len,bl,AREA);
return 0;
}
@@ -8449,7 +8443,8 @@ void clif_parse_TickSend(int fd, struct map_session_data *sd) {
WFIFOHEAD(fd, packet_len_table[0x7f]);
WFIFOW(fd,0)=0x7f;
WFIFOL(fd,2)=gettick();
- WFIFOSET2(fd,packet_len_table[0x7f],1);//send immediately
+ WFIFOSET(fd,packet_len_table[0x7f]);
+ flush_fifo(fd); // send immediatly so the client gets accurate "pings"
return;
}
diff --git a/src/map/clif.h b/src/map/clif.h
index 3cda2334c..70b28acc2 100644
--- a/src/map/clif.h
+++ b/src/map/clif.h
@@ -319,9 +319,7 @@ int clif_pet_emotion(struct pet_data *pd,int param);
int clif_pet_performance(struct block_list *bl,int param);
int clif_pet_equip(struct pet_data *pd);
int clif_pet_food(struct map_session_data *sd,int foodid,int fail);
-#define clif_send(buf,len,bl,type) _clif_send(buf,len,bl,type,0)
-#define clif_send2(buf,len,bl,type,flush) _clif_send(buf,len,bl,type,flush)
-int _clif_send(unsigned char *buf, int len, struct block_list *bl, int type, char flush);
+int clif_send(unsigned char *buf, int len, struct block_list *bl, int type);
//friends list
int clif_friendslist_toggle_sub(struct map_session_data *sd,va_list ap);