Source-1-Games icon indicating copy to clipboard operation
Source-1-Games copied to clipboard

[TF2] [Feature Request] Reveal assigned team information to "status" command response OR extend "tf_lobby_debug" to function for servers not operated by Valve

Open Kacey2k opened this issue 4 months ago • 4 comments

The status command reveals a lot of rich information about the current lobby the user is currently in, however, could benefit from an additional metric indicating what team the player is currently assigned to.

The tf_lobby_debug is a helpful command that explicitly gives away a player's team already in Valve operated matchmaking servers. This command returns no useful data in community servers though. Additionally, it has been observed to not be consistent across all maps/gamemodes, and requires inference to know what the values are actually pointing to.

Example status command output with source timestamps prepending lines:

05/24/2026 - 16:14:57: hostname: Valve Matchmaking Server (srcds3020-dfw2 #134)
05/24/2026 - 16:14:57: version : 10680128/24 10680128 secure
05/24/2026 - 16:14:57: udp/ip  : 169.254.209.203:21056
05/24/2026 - 16:14:57: steamid : [A:1:3189294084:49848] (90286091266475012)
05/24/2026 - 16:14:57: account : not logged in  (No account specified)
05/24/2026 - 16:14:57: map     : ctf_doublecross at: 0 x, 0 y, 0 z
05/24/2026 - 16:14:57: tags    : ctf,hidden,increased_maxplayers,valve
05/24/2026 - 16:14:57: players : 22 humans, 0 bots (32 max)
05/24/2026 - 16:14:57: edicts  : 628 used of 2048 max
05/24/2026 - 16:14:57: # userid name                uniqueid            connected ping loss state
05/24/2026 - 16:14:57: #    225 "Kacey"             [U:1:1511176553]    00:02       63   73 spawning

The command gives us a unique userid, current username, steam3id, elapsed connected time, real network ping, loss data and their current connection status.

It does not reveal the player's team.

These commands are utilized to diagnose, monitor, and interface with TF2 servers in a variety of community projects. Many of which, attempt to ascertain the team all players in the lobby are on as the user plays.

Considering both commands tend to require multiple packet responses to be parsed due to their larger structure, simply adding one more additional metric to status or extending tf_lobby_debug to work on community servers should not be a cause for concern.

Example of proposed status output with team assignment metric:

05/24/2026 - 16:14:57: hostname: Valve Matchmaking Server (srcds3020-dfw2 #134)
05/24/2026 - 16:14:57: version : 10680128/24 10680128 secure
05/24/2026 - 16:14:57: udp/ip  : 169.254.209.203:21056
05/24/2026 - 16:14:57: steamid : [A:1:3189294084:49848] (90286091266475012)
05/24/2026 - 16:14:57: account : not logged in  (No account specified)
05/24/2026 - 16:14:57: map     : ctf_doublecross at: 0 x, 0 y, 0 z
05/24/2026 - 16:14:57: tags    : ctf,hidden,increased_maxplayers,valve
05/24/2026 - 16:14:57: players : 22 humans, 0 bots (32 max)
05/24/2026 - 16:14:57: edicts  : 628 used of 2048 max
05/24/2026 - 16:14:57: # userid name                uniqueid            connected ping loss state team
05/24/2026 - 16:14:57: #    225 "Kacey"             [U:1:1511176553]    00:02       63   73 spawning 1

In this example, you could arbitrarily assign an integer to reflect the current team.

0      =  Spectator / Unassigned / Unkown
1      =  RED
2      =  BLU

Developers could then easily have a reliable metric to determine what team players are on, making community tools and server management utilities more convenient to develop, requiring far less inference in the team-assignment process.

If this command (status) should not be touched due to be wrapped into the legacy Source 1 network commands package, maybe we could simply revisit tf_lobby_debug instead.

If neither option sounds pleasing, perhaps a simple command returning steam IDs and the team could be implemented specifically for revealing team membership across all servers?

Arbitrary team_dump command:

]  team_dump
# uniqueid            team
# [U:1:1234567890]    spec
# [U:1:1234567890]    red
# [U:1:1234567890]    red
# [U:1:1234567890]    blu
# [U:1:1234567890]    none

Kacey2k avatar Jul 21 '26 23:07 Kacey2k

Because the engine implementation of status does not appear in the public Source SDK, I am considering a PR to source-sdk-2013 adding a TF2 client command that prints the already-networked player-resource team data. Would this be an acceptable implementation direction?

Kacey2k avatar Jul 22 '26 19:07 Kacey2k

Considering that "status" is indeed a part of the shared engine and has no game-specific implementations to date, the route of making tf_lobby_debug work on all servers (may need modifications) or getting it to print in console using a different command for server/rcon usage would be a god idea. I'm leaning towards the latter.

Professor-Heavy avatar Jul 22 '26 20:07 Professor-Heavy

Considering that "status" is indeed a part of the shared engine and has no game-specific implementations to date, the route of making tf_lobby_debug work on all servers (may need modifications) or getting it to print in console using a different command for server/rcon usage would be a god idea. I'm leaning towards the latter.

Agreed, I've done some digging around and it seems the strongest option is to create a new command entirely.

tf_lobby_debug seems to not be defined in the public source files but does seem to have some code that might be referenced by it.

Here's one example:

https://github.com/ValveSoftware/source-sdk-2013/blob/master/src/game/shared/tf/tf_lobby_shared.cpp#L239

void CTFLobbyShared::SpewDebugSummary() const
{
	Msg( "CTFLobbyShared: ID:%016llx  %d member(s), %d pending\n",
	     GetGroupID(), GetNumMembers(), GetNumPendingPlayers() );
	for ( int i = 0; i < GetNumMembers(); i++ )
	{
		ConstTFLobbyPlayer details = GetMemberDetails( i );
		Msg( "  Member[%d] %s  team = %s  type = %s\n",
		     i, GetMember( i ).Render(), TF_GC_TEAM_Name( details.GetTeam() ).c_str(),
		     CTFLobbyPlayerProto_Type_Name( details.Proto().type() ).c_str() );
	}
	for ( int i = 0; i < GetNumPendingPlayers(); i++ )
	{
		ConstTFLobbyPlayer details = GetPendingPlayerDetails( i );
		Msg( "  Pending[%d] %s  team = %s  type = %s\n",
		     i, GetPendingPlayer( i ).Render(), TF_GC_TEAM_Name( details.GetTeam() ).c_str(),
		     CTFLobbyPlayerProto_Type_Name( details.Proto().type() ).c_str() );
	}
}

Nonetheless, it seems the safest route we can do here is likely creating a new command (unless a Valve developer is equally enthusiastic about revisiting the existing implementation of tf_lobby_debug) that borrows existing resource data to return a simple reply to the console.

Something like (Basically an extension of the example from the original Feature Request):

tf_player_team_debug

Returns a table of data for the current lobby regardless of server type; specifically displaying only team information per-connected-player:

# userid uniqueid             team_id team
# 123    [U:1:1234567890]     2       RED
# 123    [U:1:1234567890]     3       BLU
# 123    [U:1:1234567890]     1       Spectator

Where the team ID points to a specific team name already defined by TF2:

0 = Unassigned
1 = Spectator
2 = RED
3 = BLU

Kacey2k avatar Jul 22 '26 21:07 Kacey2k

Some Progress has been made for a custom command - https://www.youtube.com/watch?v=q7uGnH_7HKo

Kacey2k avatar Jul 23 '26 20:07 Kacey2k