summaryrefslogtreecommitdiff
path: root/src/map/intif.c
diff options
context:
space:
mode:
authorgepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-13 01:19:04 +0000
committergepard1984 <gepard1984@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-02-13 01:19:04 +0000
commit526217d77d50dc27b0815e3d5895df7bfa38ff76 (patch)
tree9fb6152ef59b7d08e7f226fbdc47eb6ba9617cc6 /src/map/intif.c
parent87469dc59de62990878ce6ccd29769ebd5b7d675 (diff)
downloadhercules-526217d77d50dc27b0815e3d5895df7bfa38ff76.tar.gz
hercules-526217d77d50dc27b0815e3d5895df7bfa38ff76.tar.bz2
hercules-526217d77d50dc27b0815e3d5895df7bfa38ff76.tar.xz
hercules-526217d77d50dc27b0815e3d5895df7bfa38ff76.zip
- Added `libconfig` (configuration file library: http://www.hyperrealm.com/libconfig/):
- Updated VS9/10 project files. - Updated `configure` & `Makefile`s. - New GM, Commands & Permissions system: - '''This is a backwards compatibility breaking update''', please read tid:58877 - Replaced GM levels with Player Groups. - Commands permissions & other privileges now depend on group, not GM level. - `@help` command improvements: requires "commandname" param and shows more detailed info about commands. - Modified GM whisper system to deliver messages basing on permissions, not GM level. - Remote trade request is now possible only if player is allowed to use `@trade` command as well. - Added a proper permission to use `/changemaptype` command. - `clif_displaymessage` is now capable of displaying multiline messages. - All `ACMD_FUNC`s are static now, and the only way to invoke them is with `is_atcommand()`; all client commands (starting with `/`) are now translated into corresponding atcommands (with exception of `/kick` used on monster, as there is no atcommand to kill single monster). - Removed nonsense "bot check" triggering when player blocked (`/ex`) Server. - Merged `@monster`, `@monsterbig` and `@monstersmall`. - Improved flow of atcommand execution to avoid revealing info about online players or existing commands to non-privileged players. - Merged `atcommand` and `charcommand` script functions (`charcommand` is aliased to `atcommand`). - Fixed `atcommand` script function reading unknown memory area (possible access violation). git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@15572 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/intif.c')
-rw-r--r--src/map/intif.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/src/map/intif.c b/src/map/intif.c
index 51002f027..f074b032b 100644
--- a/src/map/intif.c
+++ b/src/map/intif.c
@@ -237,22 +237,22 @@ int intif_wis_replay(int id, int flag)
}
// The transmission of GM only Wisp/Page from server to inter-server
-int intif_wis_message_to_gm(char *Wisp_name, int min_gm_level, char *mes)
+int intif_wis_message_to_gm(char *wisp_name, int permission, char *mes)
{
int mes_len;
if (CheckForCharServer())
return 0;
mes_len = strlen(mes) + 1; // + null
- WFIFOHEAD(inter_fd, mes_len + 30);
+ WFIFOHEAD(inter_fd, mes_len + 32);
WFIFOW(inter_fd,0) = 0x3003;
- WFIFOW(inter_fd,2) = mes_len + 30;
- memcpy(WFIFOP(inter_fd,4), Wisp_name, NAME_LENGTH);
- WFIFOW(inter_fd,4+NAME_LENGTH) = (short)min_gm_level;
- memcpy(WFIFOP(inter_fd,6+NAME_LENGTH), mes, mes_len);
+ WFIFOW(inter_fd,2) = mes_len + 32;
+ memcpy(WFIFOP(inter_fd,4), wisp_name, NAME_LENGTH);
+ WFIFOL(inter_fd,4+NAME_LENGTH) = permission;
+ memcpy(WFIFOP(inter_fd,8+NAME_LENGTH), mes, mes_len);
WFIFOSET(inter_fd, WFIFOW(inter_fd,2));
if (battle_config.etc_log)
- ShowNotice("intif_wis_message_to_gm: from: '%s', min level: %d, message: '%s'.\n", Wisp_name, min_gm_level, mes);
+ ShowNotice("intif_wis_message_to_gm: from: '%s', required permission: %d, message: '%s'.\n", wisp_name, permission, mes);
return 0;
}
@@ -860,11 +860,13 @@ int intif_parse_WisEnd(int fd)
static int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va)
{
- int min_gm_level = va_arg(va, int);
+ int permission = va_arg(va, int);
char *wisp_name;
char *message;
int len;
- if (pc_isGM(sd) < min_gm_level) return 0;
+
+ if (!pc_has_permission(sd, permission))
+ return 0;
wisp_name = va_arg(va, char*);
message = va_arg(va, char*);
len = va_arg(va, int);
@@ -873,22 +875,22 @@ static int mapif_parse_WisToGM_sub(struct map_session_data* sd,va_list va)
}
// Received wisp message from map-server via char-server for ALL gm
-// 0x3003/0x3803 <packet_len>.w <wispname>.24B <min_gm_level>.w <message>.?B
+// 0x3003/0x3803 <packet_len>.w <wispname>.24B <permission>.l <message>.?B
int mapif_parse_WisToGM(int fd)
{
- int min_gm_level, mes_len;
+ int permission, mes_len;
char Wisp_name[NAME_LENGTH];
char mbuf[255];
char *message;
- mes_len = RFIFOW(fd,2) - 30;
+ mes_len = RFIFOW(fd,2) - 32;
message = (char *) (mes_len >= 255 ? (char *) aMallocA(mes_len) : mbuf);
- min_gm_level = (int)RFIFOW(fd,28);
+ permission = RFIFOL(fd,28);
safestrncpy(Wisp_name, (char*)RFIFOP(fd,4), NAME_LENGTH);
- safestrncpy(message, (char*)RFIFOP(fd,30), mes_len);
- // information is sended to all online GM
- map_foreachpc(mapif_parse_WisToGM_sub, min_gm_level, Wisp_name, message, mes_len);
+ safestrncpy(message, (char*)RFIFOP(fd,32), mes_len);
+ // information is sent to all online GM
+ map_foreachpc(mapif_parse_WisToGM_sub, permission, Wisp_name, message, mes_len);
if (message != mbuf)
aFree(message);