summaryrefslogtreecommitdiff
path: root/src/map/intif.c
diff options
context:
space:
mode:
authorskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-03 15:48:46 +0000
committerskotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec>2006-06-03 15:48:46 +0000
commitcfdb383a81bb9bb9349454ec38760774e4150d38 (patch)
treecb18aa927778640f4c6c0aa34ac398493d21ed5b /src/map/intif.c
parentae84a968da2ef7573b17f9f31814fa16f76102bb (diff)
downloadhercules-cfdb383a81bb9bb9349454ec38760774e4150d38.tar.gz
hercules-cfdb383a81bb9bb9349454ec38760774e4150d38.tar.bz2
hercules-cfdb383a81bb9bb9349454ec38760774e4150d38.tar.xz
hercules-cfdb383a81bb9bb9349454ec38760774e4150d38.zip
- Added variable other_mapserver_count to chrif.c which holds total count of connected map-servers. By using this we prevent sending unnecessary packets to the char-server when there's no more map-servers connected.
- Affected packets are whispers, announces, party messages, guild messages. git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@6955 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r--src/map/intif.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/map/intif.c b/src/map/intif.c
index 926d03335..fc7fd6c3d 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -134,6 +134,9 @@ int intif_GMmessage(char* mes,int len,int flag)
if (CheckForCharServer())
return 0;
+ if (other_mapserver_count < 1)
+ return 0; //No need to send.
+
WFIFOHEAD(inter_fd,lp + len + 4);
WFIFOW(inter_fd,0) = 0x3000;
WFIFOW(inter_fd,2) = lp + len + 4;
@@ -154,6 +157,10 @@ int intif_announce(char* mes,int len, unsigned long color, int flag)
if (CheckForCharServer())
return 0;
+
+ if (other_mapserver_count < 1)
+ return 0; //No need to send.
+
WFIFOHEAD(inter_fd, 8 + len);
WFIFOW(inter_fd,0) = 0x3000;
WFIFOW(inter_fd,2) = 8 + len;
@@ -169,6 +176,12 @@ int intif_wis_message(struct map_session_data *sd, char *nick, char *mes, int me
if (CheckForCharServer())
return 0;
+ if (other_mapserver_count < 1)
+ { //Character not found.
+ clif_wis_end(sd->fd, 1);
+ return 0;
+ }
+
WFIFOHEAD(inter_fd,mes_len + 52);
WFIFOW(inter_fd,0) = 0x3001;
WFIFOW(inter_fd,2) = mes_len + 52;
@@ -467,8 +480,10 @@ int intif_party_message(int party_id,int account_id,char *mes,int len)
{
if (CheckForCharServer())
return 0;
-// if(battle_config.etc_log)
-// printf("intif_party_message: %s\n",mes);
+
+ if (other_mapserver_count < 1)
+ return 0; //No need to send.
+
WFIFOHEAD(inter_fd,len + 12);
WFIFOW(inter_fd,0)=0x3027;
WFIFOW(inter_fd,2)=len+12;
@@ -608,6 +623,10 @@ int intif_guild_message(int guild_id,int account_id,char *mes,int len)
{
if (CheckForCharServer())
return 0;
+
+ if (other_mapserver_count < 1)
+ return 0; //No need to send.
+
WFIFOHEAD(inter_fd, len + 12);
WFIFOW(inter_fd,0)=0x3037;
WFIFOW(inter_fd,2)=len+12;