From 6e565a64b6a89e943c95e5b001aadd38727abe01 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Sat, 7 Mar 2015 16:08:07 +0300 Subject: map: translate server to client text messages. --- src/map/atcommand.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 src/map/atcommand.c (limited to 'src/map/atcommand.c') 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 +#include +#include + +#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); +} -- cgit v1.2.3-70-g09d2