summaryrefslogtreecommitdiff
path: root/src/map/atcommand.c
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-03-07 16:08:07 +0300
committerAndrei Karas <akaras@inbox.ru>2015-03-07 16:08:07 +0300
commit6e565a64b6a89e943c95e5b001aadd38727abe01 (patch)
treed75167bd37fb30336d1145203b0d040f7c7d215f /src/map/atcommand.c
parent20e70d1846ba39599255887bef5098583a7586c9 (diff)
downloadevol-hercules-6e565a64b6a89e943c95e5b001aadd38727abe01.tar.gz
evol-hercules-6e565a64b6a89e943c95e5b001aadd38727abe01.tar.bz2
evol-hercules-6e565a64b6a89e943c95e5b001aadd38727abe01.tar.xz
evol-hercules-6e565a64b6a89e943c95e5b001aadd38727abe01.zip
map: translate server to client text messages.
Diffstat (limited to 'src/map/atcommand.c')
-rw-r--r--src/map/atcommand.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/map/atcommand.c b/src/map/atcommand.c
new file mode 100644
index 0000000..00ffb44
--- /dev/null
+++ b/src/map/atcommand.c
@@ -0,0 +1,35 @@
+// Copyright (c) Copyright (c) Hercules Dev Team, licensed under GNU GPL.
+// Copyright (c) 2014 Evol developers
+
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+
+#include "../../../common/HPMi.h"
+#include "../../../common/malloc.h"
+#include "../../../common/mmo.h"
+#include "../../../common/socket.h"
+#include "../../../common/strlib.h"
+#include "../../../common/timer.h"
+#include "../../../map/atcommand.h"
+#include "../../../map/map.h"
+#include "map/atcommand.h"
+#include "map/lang.h"
+
+const char* eatcommand_msgsd(struct map_session_data *sd, int *msgPtr)
+{
+ const int msg_number = *msgPtr;
+ if (!(msg_number >= 0 && msg_number < MAX_MSG))
+ return "??";
+ return lang_pctrans(atcommand->msg_table[0][msg_number], sd);
+}
+
+const char* eatcommand_msgfd(int *fdPtr, int *msgPtr)
+{
+ const int msg_number = *msgPtr;
+ const int fd = *fdPtr;
+ struct map_session_data *sd = session_isValid(fd) ? session[fd]->session_data : NULL;
+ if (!(msg_number >= 0 && msg_number < MAX_MSG))
+ return "??";
+ return lang_pctrans(atcommand->msg_table[0][msg_number], sd);
+}