AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   General (https://forums.alliedmods.net/forumdisplay.php?f=58)
-   -   [TF2] 34+ Players Without Client Crash (https://forums.alliedmods.net/showthread.php?t=240011)

MasterXykon 05-07-2014 11:04

[TF2] 34+ Players Without Client Crash
 
1 Attachment(s)
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.

Powerlord 05-07-2014 11:30

Re: [TF2] 34+ Players Without Client Crash
 
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...

Sreaper 05-07-2014 11:32

Re: [TF2] 34+ Players Without Client Crash
 
Never did this because of the risk of being delisted. Anxious to see how your server plays out.

Root_ 05-07-2014 11:47

Re: [TF2] 34+ Players Without Client Crash
 
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.

Oshizu 05-07-2014 11:49

Re: [TF2] 34+ Players Without Client Crash
 
Atleast you have a little more slots without crash :D

MasterXykon 05-07-2014 11:53

Re: [TF2] 34+ Players Without Client Crash
 
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.

Powerlord 05-07-2014 12:00

Re: [TF2] 34+ Players Without Client Crash
 
Quote:

Originally Posted by MasterXykon (Post 2134863)
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.

Oshizu 05-07-2014 14:03

Re: [TF2] 34+ Players Without Client Crash
 
Quote:

Originally Posted by Powerlord (Post 2134865)
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 :3

Powerlord 05-07-2014 14:25

Re: [TF2] 34+ Players Without Client Crash
 
Quote:

Originally Posted by Oshizu (Post 2134909)
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 :3

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.

Oshizu 05-07-2014 14:33

Re: [TF2] 34+ Players Without Client Crash
 
Quote:

Originally Posted by Powerlord (Post 2134913)
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 :twisted:
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


All times are GMT -4. The time now is 07:35.

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