diff options
author | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-11 20:16:55 +0000 |
---|---|---|
committer | skotlex <skotlex@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2006-07-11 20:16:55 +0000 |
commit | 792dfbb243bcbeee644bd096b7bd925a1e5c1e74 (patch) | |
tree | fa4735cd176917ba43883793fe215defe885220f /src/map/intif.c | |
parent | b9687899ece983642d2a83b4eee47a990a92cacc (diff) | |
download | hercules-792dfbb243bcbeee644bd096b7bd925a1e5c1e74.tar.gz hercules-792dfbb243bcbeee644bd096b7bd925a1e5c1e74.tar.bz2 hercules-792dfbb243bcbeee644bd096b7bd925a1e5c1e74.tar.xz hercules-792dfbb243bcbeee644bd096b7bd925a1e5c1e74.zip |
- Fixed clif_parse not checking for func_parse before sending data to the connected clients. This in turn required various code-rewrites in:
- duel related messaging functions (added clif targets DUEL/DUEL_WOS).
- intif whisper to gm function
- day/night timers
- Rewrote the parse_console function to stop allocating/deallocating memory on every call.
- Modified chrif_charselectreq to receive the player's ip among the data.
- Added function clif_disp_message, which is the same as clif_disp_onlyself, except you can specify the targets (it sends a guild-chat packet)
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@7617 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r-- | src/map/intif.c | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/src/map/intif.c b/src/map/intif.c index 1acdf9360..35fe41d99 100644 --- a/src/map/intif.c +++ b/src/map/intif.c @@ -831,10 +831,22 @@ int intif_parse_WisEnd(int fd) { return 0;
}
+static int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va) {
+ int min_gm_level = va_arg(va, int);
+ char *wisp_name;
+ char *message;
+ int len;
+ if (pc_isGM(sd) < min_gm_level) return 0;
+ clif_wis_message(sd->fd, wisp_name, message, len);
+ wisp_name = va_arg(va, char*);
+ message = va_arg(va, char*);
+ len = va_arg(va, int);
+ return 1;
+}
+
// Received wisp message from map-server via char-server for ALL gm
int mapif_parse_WisToGM(int fd) { // 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B
- int i, min_gm_level, mes_len;
- struct map_session_data *pl_sd;
+ int min_gm_level, mes_len;
char Wisp_name[NAME_LENGTH];
char mbuf[255];
char *message;
@@ -849,14 +861,10 @@ int mapif_parse_WisToGM(int fd) { // 0x3003/0x3803 <packet_len>.w <wispname>.24B memcpy(message, RFIFOP(fd,30), mes_len);
message[mes_len-1] = '\0';
// information is sended to all online GM
- for (i = 0; i < fd_max; i++)
- if (session[i] && (pl_sd = (struct map_session_data *) session[i]->session_data) && pl_sd->state.auth)
- if (pc_isGM(pl_sd) >= min_gm_level)
- clif_wis_message(i, Wisp_name, message, strlen(message) + 1);
+ clif_foreachclient(mapif_parse_WisToGM_sub, min_gm_level, Wisp_name, message, mes_len);
if (message != mbuf)
aFree(message);
-
return 0;
}
|