Broomish

SAPP map_skip can be abused

Hi all,

 

I think there is a problem with SAPP's "map_skip" where servers which have enabled map_skip can be abused.

 

The problem is the game being skipped before it even starts.

 

As a player on the server, this is what you see:

1) Game ends, view Post Game carnage report as normal

2) Players vote for next map (where map vote is enabled)

3) As soon as the next game is supposed to start, it ends immediately and players are put onto the "Waiting for next game screen"

 

 

I have seen this on my own server and I have some logs! (In the logs below I have redacted players name and IP addresses and cd keys). The player who was causing the game to restart I have renamed to "NaughtyPlayer")

 

 

These are the haloceded logs

 

Spoiler

2021-02-26 02:37:42     PCR_TEAM        Team 0  Laps    10
2021-02-26 02:37:42     PCR_TEAM        Team 1  Laps    4
2021-02-26 02:37:42     PCR_PLAYER      Place 1         Player 4 "" Team 0  Kills 12        Assists 0       Deaths 2        Laps 2
2021-02-26 02:37:42     PCR_PLAYER      Place 2         Player 6 ""        Team 0  Kills 8 Assists 2       Deaths 3        Laps 2
2021-02-26 02:37:42     PCR_PLAYER      Place 3         Player 16 ""    Team 0  Kills 2 Assists 2       Deaths 2        Laps 2
2021-02-26 02:37:42     PCR_PLAYER      Place 4         Player 14 ""  Team 1  Kills 1 Assists 0       Deaths 4        Laps 2
2021-02-26 02:37:42     PCR_PLAYER      Place 5         Player 3 ""     Team 0  Kills 4 Assists 0       Deaths 1        Laps 1
2021-02-26 02:37:42     PCR_PLAYER      Place 6         Player 8 ""  Team 0  Kills 4 Assists 3       Deaths 2        Laps 1
2021-02-26 02:37:42     PCR_PLAYER      Place 7         Player 5 ""  Team 0  Kills 2 Assists 2       Deaths 4        Laps 1
2021-02-26 02:37:42     PCR_PLAYER      Place 8         Player 1 "NaughtyPlayer"  Team 0  Kills 1 Assists 1       Deaths 4        Laps 1
2021-02-26 02:37:42     PCR_PLAYER      Place 9         Player 11 ""    Team 1  Kills 5 Assists 0       Deaths 3        Laps 1
2021-02-26 02:37:42     PCR_PLAYER      Place 10        Player 7 ""        Team 1  Kills 2 Assists 1       Deaths 5        Laps 1
2021-02-26 02:37:42     PCR_PLAYER      Place 11        Player 9 ""  Team 0  Kills 8 Assists 1       Deaths 3        Laps 0
2021-02-26 02:37:42     PCR_PLAYER      Place 12        Player 12 ""      Team 1  Kills 6 Assists 0       Deaths 6        Laps 0
2021-02-26 02:37:42     PCR_PLAYER      Place 13        Player 13 "" Team 1  Kills 4 Assists 0       Deaths 5        Laps 0
2021-02-26 02:37:42     PCR_PLAYER      Place 14        Player 10 ""   Team 1  Kills 1 Assists 3       Deaths 6        Laps 0
2021-02-26 02:37:42     PCR_PLAYER      Place 15        Player 15 "" Team 1  Kills 1 Assists 4       Deaths 8        Laps 0
2021-02-26 02:37:42     PCR_PLAYER      Place 16        Player 2 ""        Team 1  Kills 0 Assists 1       Deaths 6        Laps 0
2021-02-26 02:38:00     GAMEINFO        SETTINGS        MAP     infinity        MODE    Race_Taxi_Any_Order
2021-02-26 02:38:00     QUIT    <No Player>     machine 7 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 9 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 10 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 1 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 2 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 12 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 13 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 3 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 6 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 8 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 11 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 4 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 14 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 15 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 16 ()
2021-02-26 02:38:00     QUIT    <No Player>     machine 5 ()
2021-02-26 02:38:01     JOIN    SUCCESS "NaughtyPlayer"   player 1        machine 1       ()   cdkey 
2021-02-26 02:38:01     TEAMS   JOIN    "NaughtyPlayer"   player 1        team 0
2021-02-26 02:38:01     PCR_TEAM        Team 1  Laps    0
2021-02-26 02:38:01     PCR_TEAM        Team 0  Laps    0
2021-02-26 02:38:17     QUIT    <No Player>     machine 11 ()
2021-02-26 02:38:18     GAMEINFO        SETTINGS        MAP     gephyrophobia   MODE    Race_Taxi_Normal
2021-02-26 02:38:18     QUIT    <No Player>     machine 8 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 2 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 3 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 5 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 6 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 10 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 12 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 13 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 1 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 7 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 9 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 14 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 4 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 15 ()
2021-02-26 02:38:18     QUIT    <No Player>     machine 16 ()
2021-02-26 02:38:19     JOIN    SUCCESS "NaughtyPlayer"   player 1        machine 1       ()   cdkey 
2021-02-26 02:38:19     TEAMS   JOIN    "NaughtyPlayer"   player 1        team 0
2021-02-26 02:38:19     JOIN    SUCCESS "" player 2        machine 2       ()   cdkey 
2021-02-26 02:38:19     TEAMS   JOIN    "" player 2        team 1
2021-02-26 02:38:20     JOIN    SUCCESS ""      player 3        machine 3       ()   cdkey
2021-02-26 02:38:20     TEAMS   JOIN    ""      player 3        team 0
2021-02-26 02:38:20     JOIN    SUCCESS ""   player 4        machine 5       ()  cdkey
2021-02-26 02:38:20     TEAMS   JOIN    ""   player 4        team 0
2021-02-26 02:38:20     JOIN    SUCCESS "" player 5        machine 6       ()   cdkey
2021-02-26 02:38:20     TEAMS   JOIN    "" player 5        team 1
2021-02-26 02:38:20     JOIN    SUCCESS ""  player 6        machine 4       ()   cdkey
2021-02-26 02:38:20     TEAMS   JOIN    ""  player 6        team 0
2021-02-26 02:38:20     JOIN    SUCCESS ""   player 7        machine 7       ()  cdkey 
2021-02-26 02:38:20     TEAMS   JOIN    ""   player 7        team 0
2021-02-26 02:38:20     PCR_TEAM        Team 0  Laps    0
2021-02-26 02:38:20     PCR_TEAM        Team 1  Laps    0
2021-02-26 02:38:20     PCR_PLAYER      Place 1 Player 1 "NaughtyPlayer"  Team 0  Kills 0 Assists 0       Deaths 0        Laps 0
2021-02-26 02:38:20     CHAT    GLOBAL  NaughtyPlayer     skip
2021-02-26 02:38:20     CHAT    GLOBAL  NaughtyPlayer     skip
2021-02-26 02:38:20     CHAT    GLOBAL  NaughtyPlayer     skip
2021-02-26 02:38:26     QUIT    <No Player>     machine 10 ()
2021-02-26 02:38:28     CHAT    GLOBAL  NaughtyPlayer     4
2021-02-26 02:38:37     CHAT    GLOBAL  NaughtyPlayer     skip
2021-02-26 02:38:37     GAMEINFO        SETTINGS        MAP     infinity        MODE    Race_Taxi_Any_Order
2021-02-26 02:38:37     QUIT    <No Player>     machine 7 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 2 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 5 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 6 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 11 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 1 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 8 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 4 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 9 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 3 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 12 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 13 ()
2021-02-26 02:38:37     QUIT    <No Player>     machine 14 ()
2021-02-26 02:38:38     JOIN    SUCCESS "NaughtyPlayer"   player 1        machine 1       ()   cdkey 
2021-02-26 02:38:38     TEAMS   JOIN    "NaughtyPlayer"   player 1        team 0
2021-02-26 02:38:38     JOIN    SUCCESS "" player 2        machine 2       ()   cdkey
2021-02-26 02:38:38     TEAMS   JOIN    "" player 2        team 1
2021-02-26 02:38:39     JOIN    SUCCESS ""   player 3        machine 4       ()  cdkey
2021-02-26 02:38:39     TEAMS   JOIN    ""   player 3        team 0
2021-02-26 02:38:39     JOIN    SUCCESS "" player 4        machine 5       ()   cdkey
2021-02-26 02:38:39     TEAMS   JOIN    "" player 4        team 1
2021-02-26 02:38:39     PCR_TEAM        Team 0  Laps    0
2021-02-26 02:38:39     PCR_TEAM        Team 1  Laps    0
2021-02-26 02:38:39     PCR_PLAYER      Place 1 Player 2 ""        Team 1  Kills 0 Assists 0       Deaths 0        Laps 0
2021-02-26 02:38:39     PCR_PLAYER      Place 1 Player 1 "NaughtyPlayer"  Team 0  Kills 0 Assists 0       Deaths 0        Laps 0
2021-02-26 02:38:39     CHAT    GLOBAL  NaughtyPlayer     skip
2021-02-26 02:38:39     CHAT    GLOBAL  NaughtyPlayer     skip
2021-02-26 02:38:39     CHAT    GLOBAL  NaughtyPlayer     skip
2021-02-26 02:38:42     QUIT    <No Player>     machine 12 ()
2021-02-26 02:38:43     QUIT    <No Player>     machine 10 ()
2021-02-26 02:38:44     QUIT    <No Player>     machine 9 ()
2021-02-26 02:38:44     CHAT    GLOBAL  NaughtyPlayer     t
2021-02-26 02:38:47     QUIT    <No Player>     machine 5 ()
2021-02-26 02:38:47     CHAT    GLOBAL  NaughtyPlayer     4
2021-02-26 02:38:56     GAMEINFO        SETTINGS        MAP     infinity        MODE    Race_Taxi_Any_Order
2021-02-26 02:38:56     QUIT    <No Player>     machine 2 ()
2021-02-26 02:38:56     QUIT    <No Player>     machine 6 ()
2021-02-26 02:38:56     QUIT    <No Player>     machine 1 ()
2021-02-26 02:38:56     QUIT    <No Player>     machine 7 ()
2021-02-26 02:38:56     QUIT    <No Player>     machine 9 ()
2021-02-26 02:38:56     QUIT    <No Player>     machine 3 ()
2021-02-26 02:38:56     QUIT    <No Player>     machine 5 ()
2021-02-26 02:38:56     QUIT    <No Player>     machine 8 ()
2021-02-26 02:38:56     QUIT    <No Player>     machine 11 ()
2021-02-26 02:38:57     QUIT    <No Player>     machine 4 ()
 

 

 

These are the SAPP logs of the same time:

Spoiler

2021-02-26 02:37:59  QUIT             Player Quit, Name: NaughtyPlayer  PlayerNumber: 0
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 1
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 2
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 3
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 4
2021-02-26 02:37:59  QUIT             Player Quit, Name:  PlayerNumber: 5
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 6
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 7
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 8
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 9
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 10
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 11
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 12
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 13
2021-02-26 02:37:59  QUIT             Player Quit, Name:   PlayerNumber: 14
2021-02-26 02:37:59  QUIT             Player Quit, Name:  PlayerNumber: 15
2021-02-26 02:38:00  NEW GAME         Map: infinity  GameType: Race_Taxi_Any_Order
2021-02-26 02:38:01  JOIN             Player Joined, Name: NaughtyPlayer  PlayerNumber: 0  IP:  CD-Key Hash: 
2021-02-26 02:38:01  CHAT             [GLOBAL] NaughtyPlayer: skip
2021-02-26 02:38:18  QUIT             Player Quit, Name: NaughtyPlayer  PlayerNumber: 0
2021-02-26 02:38:18  NEW GAME         Map: gephyrophobia  GameType: Race_Taxi_Normal
2021-02-26 02:38:19  JOIN             Player Joined, Name: NaughtyPlayer  PlayerNumber: 0  IP:  CD-Key Hash: 
2021-02-26 02:38:19  JOIN             Player Joined, Name:   PlayerNumber: 1  IP:  CD-Key Hash: 
2021-02-26 02:38:20  JOIN             Player Joined, Name:   PlayerNumber: 2  IP:   CD-Key Hash: 
2021-02-26 02:38:20  JOIN             Player Joined, Name:  PlayerNumber: 3  IP:   CD-Key Hash: 
2021-02-26 02:38:20  JOIN             Player Joined, Name:   PlayerNumber: 4  IP:   CD-Key Hash: 
2021-02-26 02:38:20  JOIN             Player Joined, Name:   PlayerNumber: 5  IP:   CD-Key Hash: 
2021-02-26 02:38:20  JOIN             Player Joined, Name:   PlayerNumber: 6  IP:   CD-Key Hash: 
2021-02-26 02:38:20  CHAT             [GLOBAL] NaughtyPlayer: skip
2021-02-26 02:38:20  CHAT             [GLOBAL] NaughtyPlayer: skip
2021-02-26 02:38:20  CHAT             [GLOBAL] NaughtyPlayer: skip
2021-02-26 02:38:28  CHAT             [GLOBAL] NaughtyPlayer: 4
2021-02-26 02:38:37  CHAT             [GLOBAL] NaughtyPlayer: skip
2021-02-26 02:38:37  QUIT             Player Quit, Name: NaughtyPlayer  PlayerNumber: 0
2021-02-26 02:38:37  QUIT             Player Quit, Name:   PlayerNumber: 1
2021-02-26 02:38:37  QUIT             Player Quit, Name:   PlayerNumber: 2
2021-02-26 02:38:37  QUIT             Player Quit, Name:   PlayerNumber: 3
2021-02-26 02:38:37  QUIT             Player Quit, Name:   PlayerNumber: 4
2021-02-26 02:38:37  QUIT             Player Quit, Name:   PlayerNumber: 5
2021-02-26 02:38:37  QUIT             Player Quit, Name:   PlayerNumber: 6
2021-02-26 02:38:37  NEW GAME         Map: infinity  GameType: Race_Taxi_Any_Order
2021-02-26 02:38:38  JOIN             Player Joined, Name: NaughtyPlayer  PlayerNumber: 0  IP:  CD-Key Hash: 
2021-02-26 02:38:38  JOIN             Player Joined, Name:   PlayerNumber: 1  IP:   CD-Key Hash: 
2021-02-26 02:38:39  JOIN             Player Joined, Name:   PlayerNumber: 2  IP:   CD-Key Hash: 
2021-02-26 02:38:39  JOIN             Player Joined, Name:   PlayerNumber: 3  IP:   CD-Key Hash: 
2021-02-26 02:38:39  CHAT             [GLOBAL] NaughtyPlayer: skip
2021-02-26 02:38:39  CHAT             [GLOBAL] NaughtyPlayer: skip
2021-02-26 02:38:39  CHAT             [GLOBAL] NaughtyPlayer: skip
2021-02-26 02:38:44  CHAT             [GLOBAL] NaughtyPlayer: t
2021-02-26 02:38:47  QUIT             Player Quit, Name:   PlayerNumber: 3
2021-02-26 02:38:47  CHAT             [GLOBAL] NaughtyPlayer: 4
2021-02-26 02:38:56  QUIT             Player Quit, Name: NaughtyPlayer  PlayerNumber: 0
2021-02-26 02:38:56  QUIT             Player Quit, Name:   PlayerNumber: 1
2021-02-26 02:38:56  QUIT             Player Quit, Name:  PlayerNumber: 2
2021-02-26 02:38:56  NEW GAME         Map: infinity  GameType: Race_Taxi_Any_Order

 

So as you can see there are about three times the game was immediately restarted.

 

It looks like to me that "NaughtyPlayer" is always getting Player 1 slot and is able to type "skip" in the chat before the others can join? I am guessing that at this point SAPP thinks there is only 1 person in the game so one vote to skip is enough.

 

I think that only explains the first occurrence though. On the next 2, it looks like some other players (as well as NaughtyPlayer) have been able to join. But naughty player spamming "skip" in the chat also makes the server restart.

 

Anyway, anyone else ever seen this?

 

 

Does anyone think that it might be possible to write a lua script which does the same as map_skip but with some improvements? For example, maybe there could be a delay before players can vote to skip the map.

 

 

 

Share this post


Link to post
Share on other sites

Tiddy-bits:

Yes, I'm sure it would be possible to write a script to make an improved map skip with a delay.  Figuring out a good delay would be crucial, although something like 5-15 seconds would probably be plenty.  That's an interesting insight into how map skipping is handled by sapp.  I've not seen anything like this, I only recently started a server with both voting and skipping.  But I have used skipping with a fixed mapcycle before. 

 

Sorry that I can't help with sapp's map skip feature or know enough about it, but I can offer this script outline:

 

Detect whether the exact string "skip" was said by any player using   register_callback(cb["EVENT_CHAT"], "OnServerChat")

Announce to all that XYZPlayer has voted to skip the map, and set the index of an array using their player index so that their skip count can't be counted more than once.

Also in the same message tell all players X more votes required to skip to mimic the sapp map skip behavior.

Keep a count of the players currently in the server, and keep a count of which ones have said "skip"

When a player quits remove their vote from the skip count, and reset the array detecting whether that PlayerIndex can perform a skip vote and remove their count from total players

Divide those who wish to skip / current total players

Have a configuration variable for the percentage of skips required to initiate a skip

Multiply the ratio of skips/total by 100 to find the percentage.

If the game has been running for more than 5-15 seconds then honor whether the map should be skipped, and run: execute_command("sv_map_next")

Set the time running by seeing if a new game has started using    register_callback(cb['EVENT_GAME_START'],"OnNewGame")

Then use onTick() to count (incremented tick counter variable/30)  Either 30 or or the tick rate.

Also when the game starts clear out all the arrays and variables that are being used to keep track of everything like the array of players who can perform a skip and number of skip counts etc...

You could set another configuration variable to set the number of seconds the game has to have been running to honor a skip

Alternatively you could make it so nothing actually worked or was kept track of until that time limit was up, and say to the player that they need to wait X seconds before skipping.

Or even have a configuration option at the top of the script to set that alternative behavior.

 

I may be missing something but that's my thoughts on how it could work.

 

Edit:

Alright, I've got a proof of concept, I did some minor testing and the main bug is that when you disable the built in map skipping in sapp and instead use this script then sapp will tell the player that map skipping is disabled, even though it still technically works.  Use this at your own risk!  I can't guarantee that this will always work, but it did work for the minimal testing that I did with it.

Edit 2:

I forgot a break statement in the script causing it to report the wrong number of votes required for a skip to initiate

 

delay_skip.lua

Edited by mouseboyx
Example Script / Update Script
Broomish, Takka, Enclusion and 1 other like this

Share this post


Link to post
Share on other sites

Thank you mouseboyx for the script!

 

I have made some modifications to cover a few more cases (for example, telling the player they have already voted to skip if they type skip twice)

 

I have also only done minimal testing but as far as I know it works :)

 

By the way, as for the problem of SAPP always saying "Map skipping is disabled!" when using this script and not SAPP's in-built map_skip. If you really wanted to you can edit sapp.dll with a HEX Editor and search for the string and replace it with spaces. (You have to edit the unobfuscated sapp.dll from this post). This is what I have done and it works. You will still see an empty SAPP message in the chat when you type skip but its better than nothing.

 

delay_skip_2.lua

Share this post


Link to post
Share on other sites
19 minutes ago, Broomish said:

Thank you mouseboyx for the script!

 

I have made some modifications to cover a few more cases (for example, telling the player they have already voted to skip if they type skip twice)

 

I have also only done minimal testing but as far as I know it works :)

 

By the way, as for the problem of SAPP always saying "Map skipping is disabled!" when using this script and not SAPP's in-built map_skip. If you really wanted to you can edit sapp.dll with a HEX Editor and search for the string and replace it with spaces. (You have to edit the unobfuscated sapp.dll from this post). This is what I have done and it works. You will still see an empty SAPP message in the chat when you type skip but its better than nothing.

 

delay_skip_2.lua

Great solution to fixing the map skip is disabled message, I wouldn't have thought to do that.  My background is in web development so I'm kind of excited yet under-prepared to work on sapp lua scripts, but I'm learning more all the time though so that's a plus.  I had somewhat vaguely remembered that sapp would tell someone if they had already skipped, but it slipped my mind, thanks for updating the script to a more complete version :)

 

Broomish and Enclusion like this

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.