diff options
author | Piotr HaĆaczkiewicz <piotr.halaczkiewicz@gmail.com> | 2013-07-24 12:41:50 +0200 |
---|---|---|
committer | Piotr HaĆaczkiewicz <piotr.halaczkiewicz@gmail.com> | 2013-07-29 21:51:08 +0200 |
commit | e7750ecfff5bf856ecc9f38ea327c6b6cc535761 (patch) | |
tree | 163859983acdced47483f0d4fb480377da5b5be2 /src/map/chat.c | |
parent | 640c66779d8da4baa8af6bd0fee2583ec2b6143c (diff) | |
download | hercules-e7750ecfff5bf856ecc9f38ea327c6b6cc535761.tar.gz hercules-e7750ecfff5bf856ecc9f38ea327c6b6cc535761.tar.bz2 hercules-e7750ecfff5bf856ecc9f38ea327c6b6cc535761.tar.xz hercules-e7750ecfff5bf856ecc9f38ea327c6b6cc535761.zip |
Permission cache overhaul
* Reworked group permission caching in session data (follow-up to cd45c30ab2dcc44bfbfac283d15bb09b3d4644bc)
* Removed duplicated information from session data in favor of direct pointer to group settings.
* Added getters for all group data required to process permissions and related stuff.
* Added new functions to PC interface and updated calls everywhere.
* Extracted function to set new group for a player (used at login, group config reload, manual adjustment of group).
* Moved command permission config parsing to atcommand module.
* Improved dummy map session handling.
* Since it's required for all map sessions to have a valid group, dummy sessions are now created by a designated function.
* Updated related code that uses dummy sessions (console `gm use` and script `atcommand`, `useatcmd`).
* Various minor improvements and cleanups.
* Eliminated some global variables related to loading atcommand permissions for group by passing them directly to function.
* Moved definition of global array holding PC permission names from header file to source file.
* Streamlined destuction of atcommands database to use DBApply helper function instead of DBIterator.
* Replaced hardcoded position of console dummy session with defines from mapindex.h (thx Haruna for pointing it out).
* Removed fixed length restriction on group names.
Diffstat (limited to 'src/map/chat.c')
-rw-r--r-- | src/map/chat.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/map/chat.c b/src/map/chat.c index a6a5d2c8b..75ae3681b 100644 --- a/src/map/chat.c +++ b/src/map/chat.c @@ -125,7 +125,7 @@ int chat_joinchat(struct map_session_data* sd, int chatid, const char* pass) return 0;
}
- if( !cd->pub && strncmp(pass, cd->pass, sizeof(cd->pass)) != 0 && !pc_has_permission(sd, PC_PERM_JOIN_ALL_CHAT) )
+ if( !cd->pub && strncmp(pass, cd->pass, sizeof(cd->pass)) != 0 && !pc->has_permission(sd, PC_PERM_JOIN_ALL_CHAT) )
{
clif->joinchatfail(sd,1);
return 0;
@@ -325,7 +325,7 @@ int chat_kickchat(struct map_session_data* sd, const char* kickusername) if( i == cd->users )
return -1;
- if (pc_has_permission(cd->usersd[i], PC_PERM_NO_CHAT_KICK))
+ if (pc->has_permission(cd->usersd[i], PC_PERM_NO_CHAT_KICK))
return 0; //gm kick protection [Valaris]
idb_put(cd->kick_list,cd->usersd[i]->status.char_id,(void*)1);
|