AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Extensions (https://forums.alliedmods.net/forumdisplay.php?f=134)
-   -   [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots (https://forums.alliedmods.net/showthread.php?t=72322)

pRED* 06-05-2008 03:52

[EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
 
1 Attachment(s)
Update:
Quote:

Originally Posted by psychonic (Post 1691669)
Updated gamedata for this is now here
http://hg.alliedmods.net/users/pred_...baseserver.txt



Without further ado (or any infact) I present CBaseServer tools.

Credit for the idea and research for this goes entirely to Nephyrin. I just stole it and made it usable for SourceMod.

Tools is probably a bit elaborate considering its a single hook.
Hooks the engine version of client connect and can provide the steamid of the connecting client.

I have no idea how secure this is (hasn't been auth'd) or how easy it is to spoof. I would not recommend using this to auth sourcemod admins.

The attached plugin will check if a client is admin and kick a client if they are (so works perfectly even if the server is entirely full - console connect only).
It works as a simple reserved slots plugin with no advanced features or comparing the confirmed steamid once the client has connected.
If I get permission to make this part of SourceMod core, i'll add this to the base reserved slots. Until then feel free to expand on my example to suit your needs.

Also in the code is my detour class that i've slowly been putting together, so if you want to try one, this should make it easier. (`k4rim and crimson - looking at you here)

Note: If you are using threaded sql admins this won't work because It cant instantly check if a steamid is an admin.

Source Code

Compatible with EP1 (Insurgency, etc.), Orangebox mods (AoC, PvKII, etc.), and Valve's new Orangebox (TF2, DODS, CSS OB). It is recommended to remove all previous dll/so, autoload, and gamedata files relating to the extension if upgrading.

Fredd 06-05-2008 10:35

Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
 
just looked at it fast, this is sooooo nice!!!!! thx alot man.

1nsane 06-05-2008 13:58

Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
 
Goodjob :D.

^BuGs^ 06-05-2008 16:34

Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
 
Master pRED at work. Good job!

blik 06-05-2008 16:47

Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
 
Awesome work! Think this has finally converted me to sourcemod...

Edit: Meant to say, tested this on a small TF2 server, windows 2003, latest sourcemod 1.0 snapshot, worked perfectly - Fantastic work!

L. Duke 06-05-2008 17:44

Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
 
Good job!
+1 *pRED
+1 Nephyrin

FLOOR_MASTER 06-05-2008 18:00

Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
 
I love you.

pRED* 06-05-2008 18:23

Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
 
Mmm updates.

WoZeR 06-06-2008 01:26

Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
 
predcrab can you spoof the max player packet going to a client so a server with max players of 32 shows 32/33 to the client. This will fool their client to allow them to double click the server instead of typing connect from the console. Or just hack sv_visiblemaxplayers to allow a value higher than 32.

I'm not sure if this is the spot but IDA shows this in engine.dll.

Quote:

.rdata:102AD338 ; char aGametype[]
.rdata:102AD338 aGametype db 'gametype',0 ; DATA XREF: sub_1009B220+388o
.rdata:102AD341 align 4
.rdata:102AD344 ; char aRegion[]
.rdata:102AD344 aRegion db 'region',0 ; DATA XREF: sub_1009B220+342o
.rdata:102AD34B align 4
.rdata:102AD34C ; char aLan[]
.rdata:102AD34C aLan db 'lan',0 ; DATA XREF: sub_1009B220+305o
.rdata:102AD350 ; char aOs[]
.rdata:102AD350 aOs db 'os',0 ; DATA XREF: sub_1009B220+2D5o
.rdata:102AD350 ; sub_100B4C20+2D7o ...
.rdata:102AD353 align 4
.rdata:102AD354 ; char aPassword[]
.rdata:102AD354 aPassword db 'password',0 ; DATA XREF: sub_1009B220+2BCo
.rdata:102AD354 ; sub_100B4C20+2B0o ...
.rdata:102AD35D align 10h
.rdata:102AD360 ; char aGamedir[]
.rdata:102AD360 aGamedir db 'gamedir',0 ; DATA XREF: sub_1009B220+275o
.rdata:102AD368 ; char aBots[]
.rdata:102AD368 aBots db 'bots',0 ; DATA XREF: sub_1009B220+259o
.rdata:102AD36D align 10h
.rdata:102AD370 ; char aMax[]
.rdata:102AD370 aMax db 'max',0 ; DATA XREF: sub_1009B220+1E0o
.rdata:102AD370 ; sub_1009B220+229o
.rdata:102AD374 ; char aPlayers[]
.rdata:102AD374 aPlayers db 'players',0 ; DATA XREF: sub_1009B220+1B5o
.rdata:102AD374 ; sub_1009B220+201o
.rdata:102AD37C ; char aChallenge[]
.rdata:102AD37C aChallenge db 'challenge',0 ; DATA XREF: sub_1009B220+17Bo
.rdata:102AD386 align 4
.rdata:102AD388 ; char aProtocol[]
.rdata:102AD388 aProtocol db 'protocol',0 ; DATA XREF: sub_1009B220+15Bo

pRED* 06-06-2008 02:58

Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
 
Updated plugin so it only kicks people if the server is full. Interesting concept.

Wozer: You sure you want this? Reasonably trivial to add but will stop the autojoin function from working. Most reserved slot users know to use console.


All times are GMT -4. The time now is 02:40.

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