summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2015-02-20 16:02:17 +0300
committerAndrei Karas <akaras@inbox.ru>2015-02-20 16:02:17 +0300
commit5db78490d8bb2703752bd33747c1c7252bbbbc42 (patch)
treea9e9fb850aad94c0577058305b4d62159a4ddf3c /src
parent60097ba0d9a71ab575c89a3d0162bb4df1cdc0ff (diff)
downloadevol-hercules-5db78490d8bb2703752bd33747c1c7252bbbbc42.tar.gz
evol-hercules-5db78490d8bb2703752bd33747c1c7252bbbbc42.tar.bz2
evol-hercules-5db78490d8bb2703752bd33747c1c7252bbbbc42.tar.xz
evol-hercules-5db78490d8bb2703752bd33747c1c7252bbbbc42.zip
Add show_client_version permission.
Use show_client_version permission in online list.
Diffstat (limited to 'src')
-rw-r--r--src/map/init.c1
-rw-r--r--src/map/map.c9
-rw-r--r--src/map/permission.c3
-rw-r--r--src/map/permission.h1
4 files changed, 10 insertions, 4 deletions
diff --git a/src/map/init.c b/src/map/init.c
index 78bd14d..48992ff 100644
--- a/src/map/init.c
+++ b/src/map/init.c
@@ -200,6 +200,7 @@ HPExport void server_preinit (void)
addHookPre("quest->read_db_sub", equest_read_db_sub);
addGroupPermission("send_gm_flag", permission_send_gm_flag);
+ addGroupPermission("show_client_version", permission_show_client_version_flag);
}
HPExport void server_online (void)
diff --git a/src/map/map.c b/src/map/map.c
index 1d18499..ec7483b 100644
--- a/src/map/map.c
+++ b/src/map/map.c
@@ -55,7 +55,6 @@ void emap_online_list(int fd)
char *ptr = buf;
struct map_session_data* sd;
-
struct SessionExt *data1 = session_get(fd);
const time_t t = time(NULL);
if (data1->onlinelistlasttime + 15 >= t)
@@ -64,6 +63,8 @@ void emap_online_list(int fd)
return;
}
+ struct map_session_data* ssd = (struct map_session_data*)session[fd]->session_data;
+ const bool showVersion = pc_has_permission(ssd, permission_show_client_version_flag);
data1->onlinelistlasttime = t;
DBIterator* iter = db_iterator(map->pc_db);
@@ -96,8 +97,10 @@ void emap_online_list(int fd)
*ptr = sd->status.base_level;
ptr ++;
- // need permissions what allow show version. now show always
- *ptr = data->clientVersion;
+ if (showVersion)
+ *ptr = data->clientVersion;
+ else
+ *ptr = 0;
ptr ++;
strcpy(ptr, sd->status.name);
diff --git a/src/map/permission.c b/src/map/permission.c
index 83928de..03026d0 100644
--- a/src/map/permission.c
+++ b/src/map/permission.c
@@ -14,4 +14,5 @@
#include "../../../map/npc.h"
#include "../../../map/status.h"
-unsigned int permission_send_gm_flag = UINT_MAX - 1; \ No newline at end of file
+unsigned int permission_send_gm_flag = UINT_MAX - 1;
+unsigned int permission_show_client_version_flag = UINT_MAX - 2;
diff --git a/src/map/permission.h b/src/map/permission.h
index 8cbdebb..a585c98 100644
--- a/src/map/permission.h
+++ b/src/map/permission.h
@@ -5,5 +5,6 @@
#define EVOL_MAP_PERMISSION
extern unsigned int permission_send_gm_flag;
+extern unsigned int permission_show_client_version_flag;
#endif // EVOL_MAP_PERMISSION