Implementing the TF2 matchmaker for community servers. So mappers can test their VScripts in a Casual-like environment.
Note
This extension does not work on 32bit servers due to Valve not providing binaries.
Valve server binaries and community server binaries are the same, this means all the functionality used for Casual mode exists on community server as well, we just have to enable it.
The best way to enable it is to fake a matchmaker backend for our community server, resulting in it acting like a Valve Casual server. This is the most hands-off approach causing the server to handle everything the exact same way a Valve server would.
Some UI elements on the client will be wrong, this is because the server doesn't have full control over what the client sees, instead the client uses some GC data to set things like competitive high skill door texture, etc. This has no impact on server functionality but keep that in mind if you see things slightly different compared to regular matches.
Using this extension I was able to replicate the original Afterlife bug causing the round to never end, a Casual server exclusive bug, nobody was able to replicate it on a Community server.
- Install MetaMod and SourceMod
- Build the extension or download it from the
Releases/Actionstab and put it into the SourceMod extensions folder together with the gamedata - Start the server with the following
autoexec.cfgas a base - Create a match definition see the cfg/casual_example.txt file
- Start a match using
sm_casual_match_create cfg/casual_example.txt - Connect using
connect IP:PORT
Important
Setting sv_password will forcefully reset tf_mm_servermode!
Meaning you cannot set a password for the server.
(I don't like AMBuild)
cmake -S . -B ./build -DCMAKE_BUILD_TYPE=Releasecmake --build ./build -j 24 --config Release
sm_casual_gc_debug 0: If non-zero will log server GC behavioursm_casual_gc_delay 500: Fake delay in milliseconds to simulate network latencysm_casual_gc_fake_down 0: If non-zero we will tell the server the GC is downsm_casual_mm_debug 0: If non-zero will log matchmaking behavioursm_casual_mm_force_connection_source matchmaking: Forcefully sets the connection source, ignored if empty. In regular matchmaking players connect using 'connect IP:PORT matchmaking'.
sm_casual_gc_test: Sends a test GC message to the server, you should see a 'GC sent malformed CGCUpdateItemSchema message' logsm_casual_itemschema_test_next_maps: Test the next maps algorithmsm_casual_itemschema_add_custom_map: Adds support for a custom mapsm_casual_kick_client: Admin remove a client from a match by their SteamIDsm_casual_match_create: Creates a new match, see 'cfg/casual_example.txt' for detailssm_casual_match_add_player: Add a player to a matchsm_casual_match_remove_player: Remove a player from a match, this implies the user has disconnected and abandoned the match
In order to support custom maps you have to first run the sm_casual_itemschema_add_custom_map command. For example sm_casual_itemschema_add_custom_map plr_highertower. You can then use plr_highertower in the sm_casual_match_create file.
If you are using a Steam workshop map, you can also use the workshop ID, for example sm_casual_itemschema_add_custom_map workshop/899335714.
Note
Players will not see the map name or map image in the map voting screen, they will also not be able to vote. This is because the map definition is missing on the client. You can safely ignore this, the server will simply reload the map at the end of the vote.
Currently this extension only provides commands for the server console, a future release will add SourceMod functions so you can write simple plugins to control the match.