summaryrefslogtreecommitdiff
path: root/src/emap/clif.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-10-21 19:18:48 +0300
committerAndrei Karas <akaras@inbox.ru>2015-10-21 19:18:48 +0300
commit6b4175131b4fc9838dbab3c3a564f65338adda41 (patch)
tree7db93f54d39f0eff5bee88bf65fff912f25f73d1 /src/emap/clif.c
parentfc9680eb5a3a5b10470eab4c15a249b9bb016ad7 (diff)
downloadevol-hercules-6b4175131b4fc9838dbab3c3a564f65338adda41.tar.gz
evol-hercules-6b4175131b4fc9838dbab3c3a564f65338adda41.tar.bz2
evol-hercules-6b4175131b4fc9838dbab3c3a564f65338adda41.tar.xz
evol-hercules-6b4175131b4fc9838dbab3c3a564f65338adda41.zip
Show duel messages in general tab.
Diffstat (limited to 'src/emap/clif.c')
-rw-r--r--src/emap/clif.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/emap/clif.c b/src/emap/clif.c
index 20c5f55..4de666f 100644
--- a/src/emap/clif.c
+++ b/src/emap/clif.c
@@ -10,6 +10,7 @@
#include "common/HPMi.h"
#include "common/memmgr.h"
#include "common/mmo.h"
+#include "common/nullpo.h"
#include "common/socket.h"
#include "common/strlib.h"
#include "common/cbasetypes.h"
@@ -700,3 +701,29 @@ void eclif_sendbgemblem_single(int *fdPtr, struct map_session_data *sd)
hookStop();
return;
}
+
+void eclif_disp_message(struct block_list* src,
+ const char* mes, size_t *lenPtr,
+ enum send_target *targetPtr)
+{
+ unsigned char buf[256];
+
+ int len = *lenPtr;
+
+ if (len == 0)
+ return;
+
+ nullpo_retv(src);
+ nullpo_retv(mes);
+
+ if (len > sizeof(buf) - 5)
+ {
+ ShowWarning("clif_disp_message: Truncated message '%s' (len=%d, max=%d, aid=%d).\n", mes, (int)len, (int)(sizeof(buf) - 5), src->id);
+ len = sizeof(buf) - 5;
+ }
+
+ WBUFW(buf, 0) = 0x8e;
+ WBUFW(buf, 2) = len + 5;
+ safestrncpy((char*)WBUFP(buf, 4), mes, len + 1);
+ clif->send(buf, WBUFW(buf, 2), src, *targetPtr);
+}