summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHaru <haru@dotalux.com>2019-08-25 18:00:23 +0200
committerHaru <haru@dotalux.com>2019-08-26 00:29:06 +0200
commit79432202ba48e041c102b32b2675988690a754ef (patch)
treeafc4ecbede3677620b174285f54641003a54645a /src
parentde6d7eceb11e3a91c6c5d04178194b6d7e4a41c7 (diff)
downloadhercules-79432202ba48e041c102b32b2675988690a754ef.tar.gz
hercules-79432202ba48e041c102b32b2675988690a754ef.tar.bz2
hercules-79432202ba48e041c102b32b2675988690a754ef.tar.xz
hercules-79432202ba48e041c102b32b2675988690a754ef.zip
Remove round-trip to the inter-server for the party messages
Signed-off-by: Haru <haru@dotalux.com>
Diffstat (limited to 'src')
-rw-r--r--src/char/int_party.c1
-rw-r--r--src/char/inter.c2
-rw-r--r--src/char/mapif.c22
-rw-r--r--src/char/mapif.h2
-rw-r--r--src/map/intif.c32
-rw-r--r--src/map/intif.h2
-rw-r--r--src/map/party.c25
-rw-r--r--src/map/party.h1
8 files changed, 11 insertions, 76 deletions
diff --git a/src/char/int_party.c b/src/char/int_party.c
index 8ee03ecc5..c27d708f2 100644
--- a/src/char/int_party.c
+++ b/src/char/int_party.c
@@ -599,7 +599,6 @@ static int inter_party_parse_frommap(int fd)
case 0x3024: mapif->parse_PartyLeave(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break;
case 0x3025: mapif->parse_PartyChangeMap(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10), RFIFOW(fd,14), RFIFOB(fd,16), RFIFOW(fd,17)); break;
case 0x3026: mapif->parse_BreakParty(fd, RFIFOL(fd,2)); break;
- case 0x3027: mapif->parse_PartyMessage(fd, RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12); break;
case 0x3029: mapif->parse_PartyLeaderChange(fd, RFIFOL(fd,2), RFIFOL(fd,6), RFIFOL(fd,10)); break;
default:
return 0;
diff --git a/src/char/inter.c b/src/char/inter.c
index a70a81eb0..d6b96f020 100644
--- a/src/char/inter.c
+++ b/src/char/inter.c
@@ -69,7 +69,7 @@ int party_share_level = 10;
static int inter_recv_packet_length[] = {
0, 0, 0, 0, -1,13,36, (2 + 4 + 4 + 4 + NAME_LENGTH), 0, 0, 0, 0, 0, 0, 0, 0, // 3000-
6,-1, 6,-1, 0, 0, 0, 0, 10,-1, 0, 0, 0, 0, 0, 0, // 3010- Account Storage, Achievements [Smokexyz]
- -1,10,-1,14, 14,19, 6,-1, 14,14, 0, 0, 0, 0, 0, 0, // 3020- Party
+ -1,10,-1,14, 14,19, 6, 0, 14,14, 0, 0, 0, 0, 0, 0, // 3020- Party
-1, 6,-1,-1, 55,23, 6,-1, 14,-1,-1,-1, 18,19,186,-1, // 3030-
-1, 9, 0, 0, 10,10, 0, 0, 7, 6,10,10, 10,-1, 0, 0, // 3040- Clan System(3044-3045)
-1,-1,10,10, 0,-1,12, 0, 0, 0, 0, 0, 0, 0, 0, 0, // 3050- Auction System [Zephyrus], Item Bound [Mhalicot]
diff --git a/src/char/mapif.c b/src/char/mapif.c
index a2e7499d9..1f27c1c60 100644
--- a/src/char/mapif.c
+++ b/src/char/mapif.c
@@ -1319,20 +1319,6 @@ static int mapif_party_broken(int party_id, int flag)
return 0;
}
-//Remarks in the party
-static int mapif_party_message(int party_id, int account_id, const char *mes, int len, int sfd)
-{
- unsigned char buf[512];
- nullpo_ret(mes);
- WBUFW(buf, 0) = 0x3827;
- WBUFW(buf, 2) = len + 12;
- WBUFL(buf, 4) = party_id;
- WBUFL(buf, 8) = account_id;
- memcpy(WBUFP(buf, 12), mes, len);
- mapif->sendallwos(sfd, buf, len + 12);
- return 0;
-}
-
// Create Party
static int mapif_parse_CreateParty(int fd, const char *name, int item, int item2, const struct party_member *leader)
{
@@ -1408,12 +1394,6 @@ static int mapif_parse_BreakParty(int fd, int party_id)
return 0;
}
-//Party sending the message
-static int mapif_parse_PartyMessage(int fd, int party_id, int account_id, const char *mes, int len)
-{
- return mapif->party_message(party_id, account_id, mes, len, fd);
-}
-
static int mapif_parse_PartyLeaderChange(int fd, int party_id, int account_id, int char_id)
{
if (!inter_party->change_leader(party_id, account_id, char_id))
@@ -2452,7 +2432,6 @@ void mapif_defaults(void)
mapif->party_withdraw = mapif_party_withdraw;
mapif->party_membermoved = mapif_party_membermoved;
mapif->party_broken = mapif_party_broken;
- mapif->party_message = mapif_party_message;
mapif->parse_CreateParty = mapif_parse_CreateParty;
mapif->parse_PartyInfo = mapif_parse_PartyInfo;
mapif->parse_PartyAddMember = mapif_parse_PartyAddMember;
@@ -2460,7 +2439,6 @@ void mapif_defaults(void)
mapif->parse_PartyLeave = mapif_parse_PartyLeave;
mapif->parse_PartyChangeMap = mapif_parse_PartyChangeMap;
mapif->parse_BreakParty = mapif_parse_BreakParty;
- mapif->parse_PartyMessage = mapif_parse_PartyMessage;
mapif->parse_PartyLeaderChange = mapif_parse_PartyLeaderChange;
mapif->pet_created = mapif_pet_created;
mapif->pet_info = mapif_pet_info;
diff --git a/src/char/mapif.h b/src/char/mapif.h
index 284be6a19..f61b5a9d7 100644
--- a/src/char/mapif.h
+++ b/src/char/mapif.h
@@ -134,7 +134,6 @@ struct mapif_interface {
int (*party_withdraw) (int party_id,int account_id, int char_id);
int (*party_membermoved) (struct party *p, int idx);
int (*party_broken) (int party_id, int flag);
- int (*party_message) (int party_id, int account_id, const char *mes, int len, int sfd);
int (*parse_CreateParty) (int fd, const char *name, int item, int item2, const struct party_member *leader);
void (*parse_PartyInfo) (int fd, int party_id, int char_id);
int (*parse_PartyAddMember) (int fd, int party_id, const struct party_member *member);
@@ -142,7 +141,6 @@ struct mapif_interface {
int (*parse_PartyLeave) (int fd, int party_id, int account_id, int char_id);
int (*parse_PartyChangeMap) (int fd, int party_id, int account_id, int char_id, unsigned short map, int online, unsigned int lv);
int (*parse_BreakParty) (int fd, int party_id);
- int (*parse_PartyMessage) (int fd, int party_id, int account_id, const char *mes, int len);
int (*parse_PartyLeaderChange) (int fd, int party_id, int account_id, int char_id);
int (*pet_created) (int fd, int account_id, struct s_pet *p);
int (*pet_info) (int fd, int account_id, struct s_pet *p);
diff --git a/src/map/intif.c b/src/map/intif.c
index ba79a024b..412cd78f8 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -562,27 +562,6 @@ static int intif_break_party(int party_id)
return 0;
}
-// Sending party chat
-static int intif_party_message(int party_id, int account_id, const char *mes, int len)
-{
- if (intif->CheckForCharServer())
- return 0;
-
- if (chrif->other_mapserver_count < 1)
- return 0; //No need to send.
-
- nullpo_ret(mes);
- Assert_ret(len > 0 && len < 32000);
- WFIFOHEAD(inter_fd,len + 12);
- WFIFOW(inter_fd,0)=0x3027;
- WFIFOW(inter_fd,2)=len+12;
- WFIFOL(inter_fd,4)=party_id;
- WFIFOL(inter_fd,8)=account_id;
- memcpy(WFIFOP(inter_fd,12),mes,len);
- WFIFOSET(inter_fd,len+12);
- return 0;
-}
-
// Request a new leader for party
static int intif_party_leaderchange(int party_id, int account_id, int char_id)
{
@@ -1220,12 +1199,6 @@ static void intif_parse_PartyMove(int fd)
party->recv_movemap(RFIFOL(fd,2),RFIFOL(fd,6),RFIFOL(fd,10),RFIFOW(fd,14),RFIFOB(fd,16),RFIFOW(fd,17));
}
-// ACK party messages
-static void intif_parse_PartyMessage(int fd)
-{
- party->recv_message(RFIFOL(fd,4), RFIFOL(fd,8), RFIFOP(fd,12), RFIFOW(fd,2)-12);
-}
-
// ACK guild creation
static void intif_parse_GuildCreated(int fd)
{
@@ -2686,7 +2659,6 @@ static int intif_parse(int fd)
case 0x3824: intif->pPartyMemberWithdraw(fd); break;
case 0x3825: intif->pPartyMove(fd); break;
case 0x3826: intif->pPartyBroken(fd); break;
- case 0x3827: intif->pPartyMessage(fd); break;
case 0x3830: intif->pGuildCreated(fd); break;
case 0x3831: intif->pGuildInfo(fd); break;
case 0x3832: intif->pGuildMemberAdded(fd); break;
@@ -2777,7 +2749,7 @@ void intif_defaults(void)
const int packet_len_table [INTIF_PACKET_LEN_TABLE_SIZE] = {
0, 0, 0, 0, -1,-1,37,-1, 7, 0, 0, 0, 0, 0, 0, 0, //0x3800-0x380f
-1, 0, 0, 0, 0, 0, 0, 0, -1,11, 0, 0, 0, 0, 0, 0, //0x3810 Achievements [Smokexyz/Hercules]
- 39,-1,15,15, 14,19, 7,-1, 0, 0, 0, 0, 0, 0, 0, 0, //0x3820
+ 39,-1,15,15, 14,19, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, //0x3820
10,-1,15, 0, 79,25, 7,-1, 0,-1,-1,-1, 14,67,186,-1, //0x3830
-1, 0, 0,14, 0, 0, 0, 0, -1,74,-1,11, 11,-1, 0, 0, //0x3840
-1,-1, 7, 7, 7,11, 8, 0, 10, 0, 0, 0, 0, 0, 0, 0, //0x3850 Auctions [Zephyrus] itembound[Akinari] Clan System[Murilo BiO]
@@ -2808,7 +2780,6 @@ void intif_defaults(void)
intif->party_leave = intif_party_leave;
intif->party_changemap = intif_party_changemap;
intif->break_party = intif_break_party;
- intif->party_message = intif_party_message;
intif->party_leaderchange = intif_party_leaderchange;
intif->guild_create = intif_guild_create;
intif->guild_request_info = intif_guild_request_info;
@@ -2894,7 +2865,6 @@ void intif_defaults(void)
intif->pPartyMemberWithdraw = intif_parse_PartyMemberWithdraw;
intif->pPartyMove = intif_parse_PartyMove;
intif->pPartyBroken = intif_parse_PartyBroken;
- intif->pPartyMessage = intif_parse_PartyMessage;
intif->pGuildCreated = intif_parse_GuildCreated;
intif->pGuildInfo = intif_parse_GuildInfo;
intif->pGuildMemberAdded = intif_parse_GuildMemberAdded;
diff --git a/src/map/intif.h b/src/map/intif.h
index 134c7a97e..f5f013db9 100644
--- a/src/map/intif.h
+++ b/src/map/intif.h
@@ -73,7 +73,6 @@ struct intif_interface {
int (*party_leave) (int party_id,int account_id, int char_id);
int (*party_changemap) (struct map_session_data *sd, int online);
int (*break_party) (int party_id);
- int (*party_message) (int party_id, int account_id, const char *mes,int len);
int (*party_leaderchange) (int party_id,int account_id,int char_id);
int (*guild_create) (const char *name, const struct guild_member *master);
int (*guild_request_info) (int guild_id);
@@ -160,7 +159,6 @@ struct intif_interface {
void (*pPartyMemberWithdraw) (int fd);
void (*pPartyMove) (int fd);
void (*pPartyBroken) (int fd);
- void (*pPartyMessage) (int fd);
void (*pGuildCreated) (int fd);
void (*pGuildInfo) (int fd);
void (*pGuildMemberAdded) (int fd);
diff --git a/src/map/party.c b/src/map/party.c
index dc330d92d..9fbe915f3 100644
--- a/src/map/party.c
+++ b/src/map/party.c
@@ -886,17 +886,20 @@ static int party_send_logout(struct map_session_data *sd)
static int party_send_message(struct map_session_data *sd, const char *mes)
{
- int len;
-
nullpo_ret(sd);
nullpo_ret(mes);
- len = (int)strlen(mes);
-
if (sd->status.party_id == 0)
return 0;
- intif->party_message(sd->status.party_id, sd->status.account_id, mes, len);
- party->recv_message(sd->status.party_id, sd->status.account_id, mes, len);
+
+ struct party_data *p = party->search(sd->status.party_id);
+
+ if (p == NULL)
+ return 0;
+
+ int len = (int)strlen(mes);
+
+ clif->party_message(p, sd->status.account_id, mes, len);
// Chat logging type 'P' / Party Chat
logs->chat(LOG_CHAT_PARTY, sd->status.party_id, sd->status.char_id, sd->status.account_id, mapindex_id2name(sd->mapindex), sd->bl.x, sd->bl.y, NULL, mes);
@@ -904,15 +907,6 @@ static int party_send_message(struct map_session_data *sd, const char *mes)
return 0;
}
-static int party_recv_message(int party_id, int account_id, const char *mes, int len)
-{
- struct party_data *p;
- if( (p=party->search(party_id))==NULL)
- return 0;
- clif->party_message(p,account_id,mes,len);
- return 0;
-}
-
static int party_skill_check(struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv)
{
struct party_data *p;
@@ -1532,7 +1526,6 @@ void party_defaults(void)
party->send_levelup = party_send_levelup;
party->send_logout = party_send_logout;
party->send_message = party_send_message;
- party->recv_message = party_recv_message;
party->skill_check = party_skill_check;
party->send_xy_clear = party_send_xy_clear;
party->exp_share = party_exp_share;
diff --git a/src/map/party.h b/src/map/party.h
index 28e16dff7..1831da414 100644
--- a/src/map/party.h
+++ b/src/map/party.h
@@ -118,7 +118,6 @@ struct party_interface {
void (*send_levelup) (struct map_session_data *sd);
int (*send_logout) (struct map_session_data *sd);
int (*send_message) (struct map_session_data *sd, const char *mes);
- int (*recv_message) (int party_id,int account_id,const char *mes,int len);
int (*skill_check) (struct map_session_data *sd, int party_id, uint16 skill_id, uint16 skill_lv);
int (*send_xy_clear) (struct party_data *p);
int (*exp_share) (struct party_data *p,struct block_list *src,unsigned int base_exp,unsigned int job_exp,int zeny);