Raised This Month: $32 Target: $400
 8% 

[EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots


Post New Thread Reply   
 
Thread Tools Display Modes
WoZeR
Donor
Join Date: Nov 2007
Old 06-06-2008 , 06:13   Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
Reply With Quote #11

Quote:
Originally Posted by pRED* View Post
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.
We had a metamod plugin that did res slots by using the console to connect and our forums were flooded with "my res slot doesn't work".

So, If you do it... I'll have your 2nd baby and endless back rubs in #sourcemod
WoZeR is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 06-06-2008 , 11:07   Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
Reply With Quote #12

Reserved slots really should use the 'connect' method. If they don't, then regular players (1) keep connecting and getting kicked which is frustrating and (2) can't use the autojoin, as pRED said.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
WoZeR
Donor
Join Date: Nov 2007
Old 06-06-2008 , 12:56   Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
Reply With Quote #13

Quote:
Originally Posted by L. Duke View Post
Reserved slots really should use the 'connect' method. If they don't, then regular players (1) keep connecting and getting kicked which is frustrating and (2) can't use the autojoin, as pRED said.
Our res slots are not for admins but for donators. They can hammer the server all they want. With Predcrab's extension you should be able to drop them before they even join the game now.

The autojoin will break but I would rather have the donators get on instead of worrying about pub players that just want to get on a full server. Also, they can look and see its 32/33 and the auto join will not function correctly but most pub players don't know how all the back end stuff works and they will hammer anyway which fits the problem above where they don't know what a console is or how to type connect [ip].

I just want to make it easier for donators to get on the server and this plugin with a spoofed 33 slot should fix the problem.
WoZeR is offline
WoZeR
Donor
Join Date: Nov 2007
Old 06-06-2008 , 13:22   Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
Reply With Quote #14

Also, kind of off topic. Predcrab when you get a chance one day bud, could you explain to me how you go about finding these offsets. I'm really interested in messing around with them.

"RecalculateTags"
{
"library" "engine"
"windows" "\x83\xEC\x0C\x55\x8B\xE9\x8B\x45\x00\x8B\x50 \x68\xFF\xD2\x84\xC0"
"linux" "@_ZN11CBaseServer15RecalculateTagsEv"
}

.text:10005A20 sub esp, 0Ch
.text:10005A23 push ebp
.text:10005A24 mov ebp, ecx
.text:10005A26 mov eax, [ebp+0]
.text:10005A29 mov edx, [eax+68h]
.text:10005A2C call edx
.text:10005A2E test al, al
.text:10005A30 jnz loc_10005B83
.text:10005A36 cmp byte_1036FB31, al
.text:10005A3C jnz loc_10005B83
.text:10005A42 push esi
.text:10005A43 push edi
.text:10005A44 mov byte_1036FB31, 1
.text:10005A4B xor edi, edi
.text:10005A4D lea ecx, [ecx+0]
WoZeR is offline
blik
Senior Member
Join Date: May 2006
Old 06-07-2008 , 13:33   Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
Reply With Quote #15

This is working perfectly on my tf2 servers, and Dodsbeta, however normal dods im having some trouble...

I'm seeing this in console:

Code:
L 06/07/2008 - 12:40:35: [SDKTOOLS] Could not locate FireOutput - Disabling Enti
ty Outputs
L 06/07/2008 - 12:40:35: [SERVER] Sigscan for ConnectClient failed - Disabling d
etour
L 06/07/2008 - 12:40:35: [SERVER] Sigscan for RecalculateTags failed - Disabling
 detour
L 06/07/2008 - 12:40:35: [SM] Unable to load extension "cbaseserver.ext.dll":
L 06/07/2008 - 12:40:35: [SM] Unable to load plugin "cbaseservertest.smx": Requi
red extension "CBaseServer tools" file("cbaseserver.ext") not running
L 06/07/2008 - 12:40:35: Mod Detection: Day of Defeat []
I'm new to sourcemod, is it something trivial I have done wrong?
blik is offline
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 06-07-2008 , 14:57   Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
Reply With Quote #16

Quote:
Originally Posted by WoZeR View Post
Our res slots are not for admins but for donators. They can hammer the server all they want. With Predcrab's extension you should be able to drop them before they even join the game now.

The autojoin will break but I would rather have the donators get on instead of worrying about pub players that just want to get on a full server. Also, they can look and see its 32/33 and the auto join will not function correctly but most pub players don't know how all the back end stuff works and they will hammer anyway which fits the problem above where they don't know what a console is or how to type connect [ip].

I just want to make it easier for donators to get on the server and this plugin with a spoofed 33 slot should fix the problem.
This plugin should take care of it. Let me know in that thread if you have any problems.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke is offline
voogru
Inspector Javert
Join Date: Oct 2004
Old 06-08-2008 , 04:48   Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
Reply With Quote #17

Now that this is being put all over the place, there will be an incentive for people to figure out how to spoof the certificate and get free reserved slots.

I suggest logging the players IP/SteamID combo, when their SteamID finally authenticates, if their steam id does not match the ID that was passed in ConnectClient, issue a ban.

Also, after looking at the source code, you don't do any kind of validation on the certificate.

Code:
CDetourManager::DetourReturn ConnectClientDetour(void *CBaseServer, void *netaddr_s, int something, int something2, int something3, char  const* name, char  const* pass, const char* steamcert, int len)
{
	g_pConnect->PushCell(something);
	g_pConnect->PushCell(something2);
	g_pConnect->PushCell(something3);

	g_pConnect->PushString(name);
	g_pConnect->PushString(pass);

	char steamid[100];
	snprintf(steamid, sizeof(steamid), "STEAM_0:%u:%u", (*(unsigned int *)((char*)steamcert+0x10))%2, (*(unsigned int *)((char *)steamcert+0x10))/2);

	g_pConnect->PushString(steamid);

	g_pConnect->Execute(NULL);

	RETURN_DETOUR(CDetourManager::DetourReturn_Ignored);
}
The Steam Cert +16 is actually a CSteamID Instance.


I suggest doing something along the lines of...

Code:
CDetourManager::DetourReturn ConnectClientDetour(void *CBaseServer, void *netaddr_s, int something, int something2, int something3, char  const* name, char  const* pass, const char* steamcert, int len)
{
	g_pConnect->PushCell(something);
	g_pConnect->PushCell(something2);
	g_pConnect->PushCell(something3);

	g_pConnect->PushString(name);
	g_pConnect->PushString(pass);

	if(steamcert != NULL && len >= 256) 
	{
		CSteamID SteamID;
		memcpy(&SteamID, &steamcert[16], sizeof(SteamID));

		if(SteamID.GetEAccountType() == 1 && SteamID.GetEUniverse() == 1) {
			g_pConnect->PushString(SteamID.Render());
		} else {
			//This ID is invalid! THIS CAN AND DOES HAPPEN.
		}
	}

	g_pConnect->Execute(NULL);

	RETURN_DETOUR(CDetourManager::DetourReturn_Ignored);
}
Here's render.

Code:
char * CSteamID :: Render() const
{
	static char szSteamID[64];
	_snprintf(szSteamID, sizeof(szSteamID), "STEAM_0:%u:%u", (m_unAccountID % 2) ? 1 : 0, (int32)m_unAccountID/2);

	return szSteamID;
}
Clients with invalid ID's at ConnectClient, in my case, I reject them. They are usually the pirate server browsers looking for pirated servers to add to their pirate server list or other various scumbags.

Last edited by voogru; 06-08-2008 at 15:14.
voogru is offline
dann
Senior Member
Join Date: Nov 2007
Old 06-08-2008 , 05:04   Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
Reply With Quote #18

how do I set this up to kick by shortest connection time? do I only install the cbaseservertest.smx for sourcemod?
dann is offline
Xp3r7
SourceMod Donor
Join Date: Jul 2006
Old 06-08-2008 , 09:44   Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
Reply With Quote #19

So how does this extension differ from whats built into SM already?
__________________
Xp3r7 is offline
Send a message via MSN to Xp3r7
L. Duke
Veteran Member
Join Date: Apr 2005
Location: Walla Walla
Old 06-08-2008 , 16:12   Re: [EXTENSION] CBaseServer (+ Detouring class) - Reserved Slots with 0 wasted slots
Reply With Quote #20

With this plugin, you no longer have to have a slot sitting open all the time for your reserved slot players to connect to. If the server is full and a reserved slot player joins, it will kick another player to make room, before the reserved slot player gets the normal "server is full" error.
__________________
"Good grammar is essential, Robin."
- Batman
L. Duke 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 20:06.


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