summaryrefslogtreecommitdiff
path: root/src/map/pc_groups.c
diff options
context:
space:
mode:
authorshennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-17 19:41:29 +0000
committershennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec>2012-08-17 19:41:29 +0000
commitd398b01eb2dceba231b7c313e402817554c3a43d (patch)
treee58896ff84ea57f360a79a00693ad80d4321937b /src/map/pc_groups.c
parentc03b423beb53c93a24075516597617ca3f40a493 (diff)
downloadhercules-d398b01eb2dceba231b7c313e402817554c3a43d.tar.gz
hercules-d398b01eb2dceba231b7c313e402817554c3a43d.tar.bz2
hercules-d398b01eb2dceba231b7c313e402817554c3a43d.tar.xz
hercules-d398b01eb2dceba231b7c313e402817554c3a43d.zip
Added 2 (3) new atcommands:
* @unloadnpcfile <file path> ** e.g. "@unloadnpcfile npc/cities/alberta.txt" unloads all npcs created by the npc/cities/alberta.txt file. * @addperm/@rmvperm <permission_name> ** e.g. "@addperm skill_unconditional" / "#rmvperm "player" skill_unconditional" git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16656 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc_groups.c')
-rw-r--r--src/map/pc_groups.c34
1 files changed, 4 insertions, 30 deletions
diff --git a/src/map/pc_groups.c b/src/map/pc_groups.c
index a2bf5f0c5..3111e2788 100644
--- a/src/map/pc_groups.c
+++ b/src/map/pc_groups.c
@@ -38,32 +38,6 @@ static config_t pc_group_config;
static DBMap* pc_group_db; // id -> GroupSettings
static DBMap* pc_groupname_db; // name -> GroupSettings
-static const struct {
- const char *name;
- int permission;
-} permission_name[] = {
- { "can_trade", PC_PERM_TRADE },
- { "can_party", PC_PERM_PARTY },
- { "all_skill", PC_PERM_ALL_SKILL },
- { "all_equipment", PC_PERM_USE_ALL_EQUIPMENT },
- { "skill_unconditional", PC_PERM_SKILL_UNCONDITIONAL },
- { "join_chat", PC_PERM_JOIN_ALL_CHAT },
- { "kick_chat", PC_PERM_NO_CHAT_KICK },
- { "hide_session", PC_PERM_HIDE_SESSION },
- { "who_display_aid", PC_PERM_WHO_DISPLAY_AID },
- { "hack_info", PC_PERM_RECEIVE_HACK_INFO },
- { "any_warp", PC_PERM_WARP_ANYWHERE },
- { "view_hpmeter", PC_PERM_VIEW_HPMETER },
- { "view_equipment", PC_PERM_VIEW_EQUIPMENT },
- { "use_check", PC_PERM_USE_CHECK },
- { "use_changemaptype", PC_PERM_USE_CHANGEMAPTYPE },
- { "all_commands", PC_PERM_USE_ALL_COMMANDS },
- { "receive_requests", PC_PERM_RECEIVE_REQUESTS },
- { "show_bossmobs", PC_PERM_SHOW_BOSS },
- { "disable_pvm", PC_PERM_DISABLE_PVM },
- { "disable_pvp", PC_PERM_DISABLE_PVP },
-};
-
/**
* @retval NULL if not found
* @private
@@ -199,8 +173,8 @@ static void read_config(void)
const char *name = config_setting_name(permission);
int j;
- ARR_FIND(0, ARRAYLENGTH(permission_name), j, strcmp(permission_name[j].name, name) == 0);
- if (j == ARRAYLENGTH(permission_name)) {
+ ARR_FIND(0, ARRAYLENGTH(pc_g_permission_name), j, strcmp(pc_g_permission_name[j].name, name) == 0);
+ if (j == ARRAYLENGTH(pc_g_permission_name)) {
ShowConfigWarning(permission, "pc_groups:read_config: non-existent permission name '%s', removing...", name);
config_setting_remove(permissions, name);
--i;
@@ -291,8 +265,8 @@ static void read_config(void)
if (val == 0) // does not have this permission
continue;
- ARR_FIND(0, ARRAYLENGTH(permission_name), j, strcmp(permission_name[j].name, name) == 0);
- group_settings->e_permissions |= permission_name[j].permission;
+ ARR_FIND(0, ARRAYLENGTH(pc_g_permission_name), j, strcmp(pc_g_permission_name[j].name, name) == 0);
+ group_settings->e_permissions |= pc_g_permission_name[j].permission;
}
}
dbi_destroy(iter);