Raised This Month: $12 Target: $400
 3% 

Advanced slot reservation


Post New Thread Reply   
 
Thread Tools Display Modes
Napoleon_be
Veteran Member
Join Date: Jul 2011
Location: Belgium
Old 01-04-2022 , 09:29   Re: [ReAPI] Advanced slot reservation
Reply With Quote #11

Quote:
Originally Posted by Shadows Adi View Post
I know about dynamic IPs, but, how I said, this is the current method until I find something I can use from hook. steam id, like, duh????


If you say so, I don't support non-steam, Amxmodx has a slot reservation plugin which works for admins too, but you can use it with IPs too, so I don't see where is the non-steam support for this.

Amxmodx offers it as AN option, it's not the ONLY option and definitely not the recommended method.
__________________
Napoleon_be is offline
Send a message via Skype™ to Napoleon_be
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-04-2022 , 10:00   Re: [ReAPI] Advanced slot reservation
Reply With Quote #12

SteamID and name are not available within SV_ConnectClient due it's hook. I requested it on GitHub https://github.com/s1lentq/reapi/issues/238. If it gets added, I will improve this plugin.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
HamletEagle
AMX Mod X Plugin Approver
Join Date: Sep 2013
Location: Romania
Old 01-04-2022 , 12:07   Re: [ReAPI] Advanced slot reservation
Reply With Quote #13

People in this topic sound like a broken record, but Shadows Adi also did a poor job explaining why steamid can't be used at this point. This isn't a matter of supporting no steam, during SV_ConnectClient the steamid is not available and no player index is passed to the function.
The IP can be obtained from "netfrom" buffer(which is what the plugin is doing). So, this plugin isn't for no steam.
However, I agree this is not terribly useful right now since most people have dynamic IP. But, if you add the option to reserve slots by name too(see below) then this may be somewhat useful and usable.

@Shadows Adi, you can retrieve the name without the use of extra ReAPI functions, no need to add anything to the API. See the following example:

PHP Code:
public SV_ConnectClient()
{
    new 
userinfo[1024]
    
read_args(userinfocharsmax(userinfo))

    new 
keyPos contain(userinfo"name")
    if(
keyPos != -1)
    {
        new 
buffer[1024]
        
copy(buffercharsmax(buffer), userinfo[keyPos])

        new 
key[32], temp[512], name[32], unused[512]
        
strtok(bufferkeycharsmax(key), tempcharsmax(temp), '\')
        strtok(temp, name, charsmax(name), unused, charsmax(unused), '
\')

        server_print("name = [%s]", name)
    }

name will contain the player name.

I can also provide the orpheu signature, if you want to add support for regular hlds. You don't have to deal with a lot of orpheu specific code, in case you were wondering.
__________________

Last edited by HamletEagle; 01-04-2022 at 12:17.
HamletEagle is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-04-2022 , 13:02   Re: [ReAPI] Advanced slot reservation
Reply With Quote #14

Quote:
Originally Posted by HamletEagle View Post
@Shadows Adi, you can retrieve the name without the use of extra ReAPI functions, no need to add anything to the API. See the following example:
Oh, thank you, I forgot this. I will update the script.
And thank you for explaining for people in this topic, seems they misunderstood me.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-04-2022 , 14:06   Re: [ReAPI] Advanced slot reservation
Reply With Quote #15

Update!
V 1.1


-
  • Added reservation type either by IP address or name.
  • Added some settings for connected players checking.
  • Added parsing player's name in SV_ConnectClient hook ( Thanks HamletEagle for showing me this way https://forums.alliedmods.net/showpo...9&postcount=13 ).
  • Improved connected players checking code.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-06-2022 , 14:40   Re: [ReAPI] Advanced slot reservation
Reply With Quote #16

Update!
Version 1.2:
  • Implemented a new reservation method:
  • Implemented more methods for the kicking player algorithm:
    • Kick only from spectators. If there is no spectator, then go to the next search method.
    • Kick player by played time ( the oldest player on the server or the newest player on the server ).
  • Added admin immunity flag in configuration file ( which flag should be skipped from algorithm ).
  • Added kick message field in configuration file.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-07-2022 , 12:25   Re: [ReAPI] Advanced slot reservation
Reply With Quote #17

Update!
Version 1.3:

  • Added support for VGUI connect ( like before but customizable, read description in config file ).
  • Removed SV_ConnectClient execute parameter (id) because it isn't passed from hook and renamed function name.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-07-2022 , 18:31   Re: [ReAPI] Advanced slot reservation
Reply With Quote #18

Update!
Version 1.4:
  • Added support for dynamiclly stored admins ( such as users.ini, SQL Admins, AmxBans too ) ( except those which have SteamID as auth data because player's steamID can't be retrieved in SV_ConnectClient hook ).
  • Thanks to PomanoB & droper for the idea.
  • Improved a little set_visible_players() function.
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-09-2022 , 09:29   Re: [ReAPI] Advanced slot reservation
Reply With Quote #19

Update!
Version 1.5:

  • Added API to plugin:
    • Added player_kick_pre() forward which is called before a player will be kicked.
    • Added player_kick_post() forward which is called right before a player is kicked.
    • Added player_check_playtime() forward which is called after player's indexes array was sorted.
  • Added an API test plugin.
  • Added a new ADMIN_SUPPORT value ( updated in documentation from the config file ).
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Shadows Adi
AlliedModders Donor
Join Date: Aug 2019
Location: Romania
Old 01-21-2022 , 13:40   Re: [ReAPI] Advanced slot reservation
Reply With Quote #20

Update!
Version 1.6:

  • Added compatibility support for AmxModX 1.8.2.

P.S.: Could I get a review on this script, please?
__________________


Accepting Paid Requests, contact PM.

MVP Of The Round View project on GITHUB / AlliedModders
CSGO REMAKE ~ CSGO MOD [STABLE + SOURCE CODE]
Shadows Adi is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 08:18.


Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Theme made by Freecode