Access Manager issue - flags not removed after expiring

Статус
В этой теме нельзя размещать новые ответы.
Сообщения
282
Реакции
34
Помог
3 раз(а)
Ошибка
Access Manager does not remove flags
ОС
Linux
Amx Mod X
1.9.0.5271
Билд
3.11.0.779-dev
ReGamedll
5.21.0.556-dev
Версия Metamod
Metamod-r v1.3.0.131
Список метамодулей
[ 1] SafeNameAndChat  RUN   -    SafeNameAndChat.so          v1.2 Beta 3      ini  ANY   ANY  
[ 2] Reunion RUN - reunion_mm_i386.so v0.1.0.137 ini Start Never
[ 3] Revoice RUN - revoice_mm_i386.so v0.1.0.34 ini Start Never
[ 4] ReAuthCheck RUN - reauthcheck_mm_i386.so v0.1.6 ini Start Never
[ 5] AMX Mod X RUN - amxmodx_mm_i386.so v1.9.0.5271 ini Start ANY
[ 6] WHBlocker RUN - whblocker_mm_i386.so v1.5.697 ini Chlvl ANY
[ 7] Rechecker RUN - rechecker_mm_i386.so v2.7 ini Chlvl ANY
[ 8] ReSRDetector RUN - resrdetector_mm_i386.so v0.1.0 ini Chlvl ANY
[ 9] ReSemiclip RUN - resemiclip_mm_i386.so v2.3.9 ini Chlvl ANY
[10] HitBox Fix RUN - hitbox_fix_mm_i386.so v1.1.1 ini Start ANY
[11] Admins Kit RUN - adminskit_amxx_i386.so v2.1.0 pl5 ANY ANY
[12] ReAPI RUN - reapi_amxx_i386.so v5.21.0.252-dev pl5 ANY Never
[13] FakeMeta RUN - fakemeta_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[14] MySQL RUN - mysql_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[15] Ham Sandwich RUN - hamsandwich_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[16] Engine RUN - engine_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[17] CStrike RUN - cstrike_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[18] Fun RUN - fun_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[19] GeoIP RUN - geoip_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
[20] ReAimDetector RUN - reaimdetector_amxx_i386.so v0.2.2 pl5 ANY Never
[21] CSX RUN - csx_amxx_i386.so v1.9.0.5271 pl5 ANY ANY
Список плагинов
[  1] UNREAL ANTI-ESP         2.7         Karaulov          anti_esp.amxx    running  
[ 2] FreshBans 1.4.7b kanagava fresh_bans_147- running
[ 3] ScreenMaker 1.1 neygomon screen_maker.am running
[ 4] CSStatsX SQL 0.7.4+2 serfreeman1337 csstatsx_sql.am debug
[ 5] AES: StatsX 0.5.9 [REA serfreeman1337/s aes_statsx_cstr running
[ 6] unknown unknown unknown trial_access_ad running
[ 7] Access Manager 1.0.0 mx?! AccessManager.a running
[ 8] Admin Commands 1.9.0.5271 AMXX Dev Team admincmd.amxx running
[ 9] Admin Help 1.9.0.5271 AMXX Dev Team adminhelp.amxx running
[ 10] Multi-Lingual System 1.9.0.5294 AMXX Dev Team multilingual.am running
[ 11] AMXX Gag 1.5.0 xPaw & Exolent amxgag.amxx running
[ 12] Menus Front-End 1.9.0.5294 AMXX Dev Team menufront.amxx running
[ 13] Commands Menu 1.9.0.5294 AMXX Dev Team cmdmenu.amxx running
[ 14] Players Menu 1.9.0.5294 AMXX Dev Team plmenu.amxx running
[ 15] Maps Menu 1.9.0.5294 AMXX Dev Team mapsmenu.amxx running
[ 16] Plugin Menu 1.9.0.5294 AMXX Dev Team pluginmenu.amxx running
[ 17] Anti Flood 1.9.0.5271 AMXX Dev Team antiflood.amxx running
[ 18] Scrolling Message 1.9.0.5294 AMXX Dev Team scrollmsg.amxx running
[ 19] Info. Messages 1.9.0.5294 AMXX Dev Team imessage.amxx running
[ 20] Map Manager: Core 3.1.5 Mistrick map_manager_cor running
[ 21] Map Manager: Scheduler 0.1.10 Mistrick map_manager_sch running
[ 22] Map Manager: Rtv 0.1.1 Mistrick map_manager_rtv running
[ 23] Map Manager: Nominatio 0.2.1 Mistrick map_manager_nom running
[ 24] Map Manager: BlockList 0.0.4 Mistrick map_manager_blo running
[ 25] Map Manager: Online so 0.0.4 Mistrick map_manager_onl running
[ 26] Map Manager: Effects 0.1.1 Mistrick map_manager_eff running
[ 27] Map Manager: Informer 0.0.5 Mistrick map_manager_inf running
[ 28] Map Manager: Sounds 0.0.2 Mistrick map_manager_sou running
[ 29] Map Manager: Advanced 0.1.0 Mistrick map_manager_adv running
[ 30] Map Manager: Priority 0.0.2 Mistrick map_manager_pri running
[ 31] Pause Plugins 1.9.0.5294 AMXX Dev Team pausecfg.amxx running
[ 32] Stats Configuration 1.9.0.5294 AMXX Dev Team statscfg.amxx running
[ 33] Unreal Cheater Cry 1.0.11 Karaulov unreal_cheater_ running
[ 34] [Advanced Slot Reserva 2.2 Shadows Adi advanced_slot_r running
[ 35] Restrict Weapons 1.10.0.545 AMXX Dev Team restmenu.amxx running
[ 36] Hobo Crontab 1.1 hoboman313 hobo_crontab.am debug
[ 37] [ReAPI] Best player of 1.1.2 F@nt0M best_player_of_ running
[ 38] Say me and Say hp 1.4 neygomon sayme_reapi.amx running
[ 39] Chat Manager 1.1.2-16 Mistrick chatmanager.amx running
[ 40] Std Admin Color Chat 1.1.1 Van der Cal kgb_admin_color running
[ 41] Unreal Spawn Fixer 1.1 karaulov spawnfix.amxx running
[ 42] Task Scheduler 0.2 JustinHoMi task_scheduler. running
[ 43] Reset Score 1.0 Silenttt ressetscore.amx running
[ 44] Autoresponder/Advertis 0.5 MaximusBrood ad_manager.amxx running
[ 45] [ReAPI] No Team Flash 0.0.2 Vaqtincha no_team_flash.a running
[ 46] [ReAPI] Colored Flash 1.0 ReHLDS Team colored_flash.a running
[ 47] AFK Control ReNew 1.2(a) neygomon afk_control.amx running
[ 48] unknown unknown unknown auto_join_team. running
[ 49] Online Logger 1.0.3 mx?! online_logger.a running
[ 50] Bypass Guard 1.0.1 mx?! bypass_guard.am running
[ 51] [BG] Provider: GeoIP 0.2 mx?! bg_provider_geo running
[ 52] Restrict Names 1.2a Brad Jones restrictnames.a running
[ 53] Models Replacement 0.0.2+fix ConnorMcLeod | V models_replacem running
[ 54] [ReAPI] Slay Losers 1.0 drag1c reapi_slayloser running
[ 55] WalkGuard 1.3.2 mogel walkguard_test. running
[ 56] Music Round End 1.2.7 Jumper MusicRoundEnd.a running
[ 57] ReAimDetector API 0.2.2 ReHLDS Team reaimdetector.a running
[ 58] Ping Checker 26.0.1 RC1 h1k3 ping_checker.am running
[ 59] Frags Counter 1.0 CHEL74 frags_counter.a running
[ 60] unknown unknown unknown gamename_wins.a running
[ 61] Mode 2x2 2.5re s1lent mode.amxx running
[ 62] [ReAPI] AWPoff 1.4.3 PAffAEJIkA :3 awp_off.amxx running
[ 63] Auto Team Balance Adva 1.5.1 Radius auto_team_balan running
[ 64] [ReAPI] Block Fire in 3.1.0 F@nt0M reapi_block_fit running
[ 65] Bullet Damage 1.0 drag1c bullet_damage.a running
[ 66] Advanced Kill Assists 1.3c Xelson kill_assist.amx running
[ 67] Custom Smoke 1.07 bionext custom_smoke.am running
[ 68] Style C4 Timer 3.1 OciXCrom crx_c4timer.amx running
[ 69] [ReAPI] Healthnade 0.0.8f DEV-CS.RU Commun reapi_healthnad running
[ 70] [GM] Night VIP 1.1.1 [GM] NWC gm_night_vips.a running
[ 71] Weapon Skin System 0.7.0-55 Mistrick weapon_skin_sys running
[ 72] CS:GO Inspect 1.0 O'Zone csgo_inspect.am running
[ 73] Advanced Experience Sy 0.5.9 [REA serfreeman1337/s aes_main.amxx running
[ 74] AES: CStrike Addon 0.5.9 [REA serfreeman1337/s aes_exp_cstrike running
[ 75] Revive Teammates: Core 0.11.0 ufame & Albertio rt_core.amxx running
[ 76] Revive Teammates: Plan 0.11.0 ufame & Albertio rt_planting.amx running
[ 77] Revive Teammates: Rest 0.11.0 ufame & Albertio rt_restrictions running
[ 78] Revive Teammates: Time 0.11.0 ufame & Albertio rt_timer.amxx running
[ 79] Revive Teammates: Effe 0.11.0 ufame & Albertio rt_effects.amxx running
[ 80] Revive Teammates: Soun 0.11.0 ufame & Albertio rt_sounds.amxx running
[ 81] Revive Teammates: Bonu 0.11.0 ufame & Albertio rt_bonus.amxx running
[ 82] [VipM-I] Health Nade 1.1.0 ArKaNeMaN VipM-I-HealthNa running
[ 83] [VipM][I] Default 5.0.0-beta ArKaNeMaN VipM-I-Default. debug
[ 84] [VipM] Items Controlle 5.0.0-beta ArKaNeMaN VipM-ItemsContr debug
[ 85] [VipM][L] Default 5.0.0-beta ArKaNeMaN VipM-L-Default. debug
[ 86] [VipM][L] Logic 5.0.0-beta ArKaNeMaN VipM-L-Logic.am debug
[ 87] [VipM][M] Spawn Health 5.0.0-beta ArKaNeMaN VipM-M-SpawnHea debug
[ 88] [VipM][M] Spawn Items 5.0.0-beta ArKaNeMaN VipM-M-SpawnIte debug
[ 89] [VipM][M] Vampire 5.0.0-beta ArKaNeMaN VipM-M-Vampire. debug
[ 90] [VipM][M] Vip in TAB 5.0.0-beta ArKaNeMaN VipM-M-VipInTab debug
[ 91] [VipM][M] Weapon Menu 5.0.0-beta ArKaNeMaN VipM-M-WeaponMe debug
[ 92] [VipM] Misc 5.0.0-beta ArKaNeMaN VipM-Misc.amxx debug
[ 93] [VipM] Modules Limiter 5.0.0-beta ArKaNeMaN VipM-ModulesLim debug
[ 94] Vip Modular 5.0.0-beta ArKaNeMaN VipModular.amxx debug
[ 95] Infinite Ammo 1.0 drag1c infiniteammo.am running
Автор плагина
BlackSignature
Версия плагина
1.0.0
Исходный код
Attached File
Plugin does not remove flags when expired.
1673985979712.png

This is example.
Server time (current check):
2023/01/17 - 21:07:36.

Note: Im using and pruning option.

Flag x is supervip on our server.
 
В этой теме было размещено решение! Перейти к решению.

Download all Attachments

Последнее редактирование:
Сообщения
1,292
Реакции
2,288
Помог
57 раз(а)
drag1c, it prune expired rows once per day
 
Сообщения
282
Реакции
34
Помог
3 раз(а)
drag1c, it prune expired rows once per day
Thank you for this information. I did not know... (I will check what's happening)
What about expiring admins? If time is out, does flags dissappear immediately or after first amx_reloadadmins ?

Edit: Checked
1674057113791.png

Expired: 1/14/2023, 11:00:19 PM
Line is still there, user still has "x" flag.

This is amx_amxadmins structure
1674057649960.png
 

Download all Attachments

Последнее редактирование:
Сообщения
1,292
Реакции
2,288
Помог
57 раз(а)
drag1c, after amx_reloadadmins
18 Янв 2023
drag1c show me row with column names. i don't remember where is what column
18 Янв 2023
drag1c 'days' is 0 so row skipped by prune condition
Код:
SELECT `id` FROM `amx_amxadmins` WHERE `ingame` = 1 AND `days` != 0 AND `expired` <= UNIX_TIMESTAMP(NOW())
i don't remember what reason is to use 'days' column. may be condition can be replaced with
Код:
SELECT `id` FROM `amx_amxadmins` WHERE `ingame` = 1 AND `expired` <= UNIX_TIMESTAMP(NOW())
 
Последнее редактирование:
Сообщения
282
Реакции
34
Помог
3 раз(а)
Here below is database picture:
Скрытое содержимое могут видеть только пользователь группы: Web Dev, Администратор, Модератор, Скриптер


Yeah, I find days not much important too. I should remove check for days !=0
 
Последнее редактирование:
Сообщения
282
Реакции
34
Помог
3 раз(а)
Could you check concerning amx_reloadadmins, does it pull request for column expired ?
 
Сообщения
1,292
Реакции
2,288
Помог
57 раз(а)
drag1c, what i need to check? Don't understand you.
 
Сообщения
282
Реакции
34
Помог
3 раз(а)
To check when amx_reloadadmins is typed, does it read expired column from the database.
 
Сообщения
282
Реакции
34
Помог
3 раз(а)
1674076667630.png

From my perspective, this part is critical.
It checks days = 0 or expired > unix_timestamp(now())
So, again it checks for days.
Maybe last row should be something like:
Код:
AND (`a`.`expired` = 0 OR `a`.`expired` > UNIX_TIMESTEAMP(NOW()))
If you give admin to someone like: amx_addadmin "steamid" "flags" "time", if you set "time" to "0", expired will be "0".
Example:
1674076919222.png

Please, tell me what do you think.
 
Сообщения
137
Реакции
23
Помог
2 раз(а)
It's not working like that look at source code where admin is expired, 0 = admin with no expiry and expired should be 1, that is how it does work.
 
Сообщения
282
Реакции
34
Помог
3 раз(а)
I just tested this way from my comment above and it seems it works.
I gave flag "x" to user on 5 mins. I was following him whole time. After 5 mins I wrote amx_reloadadmins and his flag got removed.
I've repeated process for 3 times and all 3 times were successful (2nd times were per 1 min, to not wait)

So, if anyone willing to give flag to someone which lasts less than 1 day:
1) Prune should not look at days
2) func_loadAdminsSql should not look at days
The only important thing is expired column, which is written in timestamp string.

This is from my perspective, after 3 testings. All other admins and flags stayed.
Tomorrow I will see what will happen with these expired flags and will they be pruned.
 
Сообщения
282
Реакции
34
Помог
3 раз(а)
Код:
"SELECT `id` FROM `amx_amxadmins` WHERE `ingame` = 1 AND `expired` > '0' AND `expired` <= UNIX_TIMESTAMP(NOW())"
is this a valid line?
 
Последнее редактирование:
Сообщения
1,292
Реакции
2,288
Помог
57 раз(а)
drag1c, i think 'days' usage is just a legacy behavior based on other systems that works with csbans. i don't know what you want to do, feel free to change conditions according to your needs. When plugin was writen, i take in mind how csbans write/modify rows when you add/change account data via web-part. I agree that this schema does not fit to usage like 'flags for 5 minutes'.

In AccessManager.sma you can use dirty hack to bypass this issue. Just change
Код:
iDays = (iMinutes * SECONDS_IN_MINUTE) / SECONDS_IN_DAY
to
Код:
iDays = max(1, (iMinutes * SECONDS_IN_MINUTE) / SECONDS_IN_DAY))
So every insertion via native will use 1 as 'days' minimal value and rows will be removed even with default conditions (as it was in original code).
I think bad things may happen if you modify that rows via csbans later (days can be reset to 0 due changing data), but that is the other question
19 Янв 2023
Another way is to use 'expired' instead of 'days' in prune / load conditions (in AccessMagager.sma). Global condition to use this schema (i just don't remember how csbans works) -'expired' must be 0 when account is permanent, and have any other value if account is non-permanent. If csbans will not mess with this, method will work.

To use 'expired' instead of 'days' just change
Код:
AND (`a`.`days` = '0' OR `a`.`expired` > UNIX_TIMESTAMP(NOW()))
to
Код:
AND (`a`.`expired` = '0' OR `a`.`expired` > UNIX_TIMESTAMP(NOW()))
and
Код:
"SELECT `id` FROM `amx_amxadmins` WHERE `ingame` = 1 AND `days` != 0 AND `expired` <= UNIX_TIMESTAMP(NOW())"
to
Код:
"SELECT `id` FROM `amx_amxadmins` WHERE `ingame` = 1 AND `expired` != 0 AND `expired` <= UNIX_TIMESTAMP(NOW())"
 
Сообщения
282
Реакции
34
Помог
3 раз(а)
I'm not using CS-Bans, so this will be perfect !
For the last row, I wrote
Код:
And `expired` > 0
, but I think your method with != 0 seems more valid.

Thank you sir!
 
Сообщения
282
Реакции
34
Помог
3 раз(а)
Please lock this topic. Topic is solved ☺
 
Статус
В этой теме нельзя размещать новые ответы.

Пользователи, просматривающие эту тему

Сейчас на форуме нет ни одного пользователя.
Сверху Снизу