diff options
author | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-07-18 19:47:51 +0000 |
---|---|---|
committer | shennetsind <shennetsind@54d463be-8e91-2dee-dedb-b68131a5f0ec> | 2012-07-18 19:47:51 +0000 |
commit | cd45c30ab2dcc44bfbfac283d15bb09b3d4644bc (patch) | |
tree | b202ca2859b92e0b13eeff9c7678d3567f3dc4a8 /src/map/pc.c | |
parent | aef1f6939ed8f235ba91afbcc69cdfcc5571988b (diff) | |
download | hercules-cd45c30ab2dcc44bfbfac283d15bb09b3d4644bc.tar.gz hercules-cd45c30ab2dcc44bfbfac283d15bb09b3d4644bc.tar.bz2 hercules-cd45c30ab2dcc44bfbfac283d15bb09b3d4644bc.tar.xz hercules-cd45c30ab2dcc44bfbfac283d15bb09b3d4644bc.zip |
Super performance improvement to groups system, caching permissions levels and atcommand permissions saving thousands of thousands of dbmap lookups.
git-svn-id: https://rathena.svn.sourceforge.net/svnroot/rathena/trunk@16443 54d463be-8e91-2dee-dedb-b68131a5f0ec
Diffstat (limited to 'src/map/pc.c')
-rw-r--r-- | src/map/pc.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/src/map/pc.c b/src/map/pc.c index 1e18e4941..138bc0828 100644 --- a/src/map/pc.c +++ b/src/map/pc.c @@ -101,7 +101,7 @@ inline int pc_get_group_id(struct map_session_data *sd) { } inline int pc_get_group_level(struct map_session_data *sd) { - return pc_group_id2level(pc_get_group_id(sd)); + return sd->group_level; } static int pc_invincible_timer(int tid, unsigned int tick, int id, intptr_t data) @@ -922,6 +922,10 @@ bool pc_authok(struct map_session_data *sd, int login_id2, time_t expiration_tim sd->login_id2 = login_id2; sd->group_id = group_id; + + /* load user permissions */ + pc_group_pc_load(sd); + memcpy(&sd->status, st, sizeof(*st)); if (st->sex != sd->status.sex) { @@ -8626,16 +8630,6 @@ bool pc_can_use_command(struct map_session_data *sd, const char *command, AtComm } /** - * Checks if player has a permission - * @param sd Player map session data - * @param permission permission to check - */ -bool pc_has_permission(struct map_session_data *sd, int permission) -{ - return pc_group_has_permission(pc_get_group_id(sd), permission); -} - -/** * Checks if commands used by a player should be logged * according to their group setting. * @param sd Player map session data |