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

[TF2] 34+ Players Without Client Crash


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
MasterXykon
BANNED
Join Date: Apr 2012
Old 05-07-2014 , 11:04   [TF2] 34+ Players Without Client Crash
Reply With Quote #1

I've successfully created a 34 player server in TF2, without crashing clients.

The issue now, is that it crashes the server when there are 35+ players.

The new issue seems to be because of these 2 functions:


CLagCompensationManager::FrameUpdatePostEntit yThink()

CLagCompensationManager::CLagCompensationMana ger(char const*)


I thought some of those at allied modders would like to know about this.


If you want proof, go check it out for yourself at: 192.99.32.150:27015

I haven't tested it with real players yet, just bots & myself, so if you decide to check it out,
more players = more tests


EDIT:
This works by using DHooks to make CBaseServer::GetMaxClients always return 33 or less.
If you want to mess with it, I've attached a zip file, but it's very messy, and it only works on LINUX.
Just use the original Player Limit Remover (PLR) to go over 32 slots, and use the command sm_max 33 so clients won't crash.

There's also some Player Count control code, but it only works in CSGO, and only if you're viewing it from your favorites.
Attached Files
File Type: zip PlayerCount.zip (7.8 KB, 343 views)

Last edited by MasterXykon; 05-07-2014 at 23:25.
MasterXykon is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-07-2014 , 11:30   Re: [TF2] 34+ Players Without Client Crash
Reply With Quote #2

Of course it crashes the server... if you look at the netprops, the various CTFPlayerResource tables only have 34 entries (0 through 33).

This is the same reason that clients crash... it's never been clear to me why they'd crash at 34 before instead of 35...
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-07-2014 at 11:33.
Powerlord is offline
Sreaper
髪を用心
Join Date: Nov 2009
Old 05-07-2014 , 11:32   Re: [TF2] 34+ Players Without Client Crash
Reply With Quote #3

Never did this because of the risk of being delisted. Anxious to see how your server plays out.
Sreaper is offline
Root_
Veteran Member
Join Date: Jan 2012
Location: ryssland
Old 05-07-2014 , 11:47   Re: [TF2] 34+ Players Without Client Crash
Reply With Quote #4

I tried to create 34 players on DoD:S server (33 + SourceTV). I have successfully created 34 slots server, but every time I tried to connect, my game was crashed. It's caused by different maxplayers limit on a client and a server. You cant make more than 35 in tf2 until valve allows it, though.
__________________


dodsplugins.com - Plugins and Resources for Day of Defeat
http://twitch.tv/zadroot
Root_ is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 05-07-2014 , 11:49   Re: [TF2] 34+ Players Without Client Crash
Reply With Quote #5

Atleast you have a little more slots without crash
__________________
...
Oshizu is offline
MasterXykon
BANNED
Join Date: Apr 2012
Old 05-07-2014 , 11:53   Re: [TF2] 34+ Players Without Client Crash
Reply With Quote #6

This doesn't seem to be the usual kind of limit error, my method makes clients think the server has a limit of 33, when the limit is actually higher, then I can have 34 players and no client crash.

It took a few minutes and some DHooking.
MasterXykon is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-07-2014 , 12:00   Re: [TF2] 34+ Players Without Client Crash
Reply With Quote #7

Quote:
Originally Posted by MasterXykon View Post
This doesn't seem to be the usual kind of limit error, my method makes clients think the server has a limit of 33, when the limit is actually higher, then I can have 34 players and no client crash.

It took a few minutes and some DHooking.
Yeah... I already told you generically why, but if you really want more detail about what could be happening:

When player 35 connects, the server starts doing buffer overflows on every array in the CTFPlayerResources object.

You have no idea what memory its overwriting when it does this.

Edit: Incidentally, it's always sized to MAX_PLAYERS + 1, and MAX_PLAYERS for the TF2 SDK / 2013 SDK is 33 (unless CSTRIKE_DLL is defined, in which case it's 65).

Edit 2: Actually, it's more likely that the server sees a client whose index is higher than gpGlobals->maxClients and just crashes because of it.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-07-2014 at 13:22.
Powerlord is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 05-07-2014 , 14:03   Re: [TF2] 34+ Players Without Client Crash
Reply With Quote #8

Quote:
Originally Posted by Powerlord View Post
Yeah... I already told you generically why, but if you really want more detail about what could be happening:

When player 35 connects, the server starts doing buffer overflows on every array in the CTFPlayerResources object.

You have no idea what memory its overwriting when it does this.

Edit: Incidentally, it's always sized to MAX_PLAYERS + 1, and MAX_PLAYERS for the TF2 SDK / 2013 SDK is 33 (unless CSTRIKE_DLL is defined, in which case it's 65).

Edit 2: Actually, it's more likely that the server sees a client whose index is higher than gpGlobals->maxClients and just crashes because of it.
Wouldn't it be possible in someway to override MAX_PLAYERS same way we can override mvm check for bi-teleporter so it could work ?
If everything related to amount of players would use MAX_PLAYERS for buffer size then we could just detour MAX_PLAYERS to like 65 and i guess it could bring some results atleast
__________________
...

Last edited by Oshizu; 05-07-2014 at 14:12.
Oshizu is offline
Powerlord
AlliedModders Donor
Join Date: Jun 2008
Location: Seduce Me!
Old 05-07-2014 , 14:25   Re: [TF2] 34+ Players Without Client Crash
Reply With Quote #9

Quote:
Originally Posted by Oshizu View Post
Wouldn't it be possible in someway to override MAX_PLAYERS same way we can override mvm check for bi-teleporter so it could work ?
If everything related to amount of players would use MAX_PLAYERS for buffer size then we could just detour MAX_PLAYERS to like 65 and i guess it could bring some results atleast
MAX_PLAYERS isn't a variable... it's a compile-time #define. Which means its replaced by its numeric literal in the actual compiled code.
__________________
Not currently working on SourceMod plugin development.

Last edited by Powerlord; 05-07-2014 at 14:28.
Powerlord is offline
Oshizu
Veteran Member
Join Date: Nov 2012
Location: Warsaw
Old 05-07-2014 , 14:33   Re: [TF2] 34+ Players Without Client Crash
Reply With Quote #10

Quote:
Originally Posted by Powerlord View Post
MAX_PLAYERS isn't a variable... it's a compile-time #define. Which means its replaced by its numeric literal in the actual compiled code.
Oh... That complicates everything
If we were to successfuly replace all MAX_PLAYERS uses keeping gamedata latest would be true pain since probatly Valve used it in lots of places
__________________
...

Last edited by Oshizu; 05-07-2014 at 14:34.
Oshizu is offline
Reply



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 10:01.


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