Custom Server Stats

I’m hard at work ripping things apart for the 1.5 update I mentioned in my last post, but in the meantime I wanted to mention some fun new stuff in the smaller 1.4.139 update that just went out: account IDs and server stats buttons.

Account IDs

Some server modders have started to log persistent stats for players on their servers, which I think is AWESOME (stuff like total kills, win/loss percentage, etc).  I think this is a good way to differentiate custom servers and give people a reason to come back to custom servers instead of just playing on default ones.

The only issue here is that I haven’t provided server modders with a good way to identify player accounts consistently in order to store stats for them.  People have been using things like account-display-strings for this purpose (‘Android0301031‘, ‘MyGooglePlayGamesName‘, etc).  While this works, it has a number of problems.  For one, it is possible to link multiple logins together in one account, and this display string will change depending on the login the player is using, even though they are technically all the same account.  Another issue is that some platforms allow changing the displayed name for an account, which would cause the server to lose your previous progress in this case.  Lastly, login names are not guaranteed to be unique, and it would be not be hard for someone to impersonate another player by using their login name.

So in 1.4.139 I’ve provided a better solution for server modders: a bs.Player object now has a get_account_id() method.  This call will return a unique account-id string for any player that will remain consistent no matter which of their linked logins they are using or what their display-names are.  As an added bonus, the game does verification with the bombsquad master-server to ensure a player’s account-id is legit, so it should not be possible to spoof another player.  (Note that the get_account_id() method may return None if the game has not yet been able to verify a player’s identity or if they are not signed in; the server mod should handle this case by ignoring their stats, attempting to fetch their id again later, or simply kicking them from the game).

Server Stat Buttons

The second fun bit of this update is server-stats buttons.  Being able to store player stats consistently is great, but its not terribly useful if nobody can see them.  To help solve this, I’ve added the option in the 1.4.139 dedicated server builds to specify a stats URL for your server which will show up in the server browser as a stats button next to your server name.

If you set up an html page to show your server’s custom stats, (Today’s top kills, etc.), you can use this button to provide a link to it.  Furthermore, if your URL contains ${ACCOUNT}, it will replaced with the account-id of the currently-signed-in account.  This way your server can show stats tailored specifically for the current account.

At the time of this writing, I’ve set up the “FFA US West 1” server with a sample page to show how this all works.  Feel free to locate it in the list and click its stats button.  You should see something like this:

This server specified the following string in its config.py:

config['statsURL'] = 'http://bombsquadgame.com/testserverstats?a=${ACCOUNT}'

When we click on it in the game, our account-id gets substituted into that address, and a browser window is opened to a URL such as this:

http://bombsquadgame.com/testserverstats?a=pb-JjBJIRpSVktDWltH

Then, as you can see in the results, our stats server can make a call to bombsquadgame.com/accountquery to fetch information about that account.  (a display string for it in this case).   I can expand this call to include other account information, so please let me know if there’s anything else you’d like access to.

Anyway, that’s about it.  I’m looking forward to seeing some interesting stats pages!   (though please note that I will curate the list and hide any stats buttons that are hijacked for any purpose other than server stats).

Also a special shout out to Panagiotis Giannoulis, who I worked with to get this system up and running.  Check out his Godfather servers if you get a chance (with nice stats pages coming soon).

Cheers!

 

15 thoughts on “Custom Server Stats”

  1. Kind of a technical question.
    What DDS codecs BombSquad supports? I know about two of them (DXT1 4bit with/without 1bit alpha), but some textures, like the BombSquad logo doesn’t use 1bit alpha. What codec the BombSquad logo uses for its textures?

    1. For Mac/Win/Linux builds the game supports DXT1 for RGB textures (I’m not using the 1-bit alpha option) and DXT5 for RGBA textures. Hope that helps!

      1. For some reason the game keeps crashing whenever I use DXT5, which is kinda bad. Especially when I wanted to edit the icons. I’m using the NVidia Texture Tools for Photoshop to export the textures.

          1. Good to know. If you run into something crashing, feel free to kick one of the files my way to test. Even if the problem is on the file end I’d like to harden the binary to spit out a clean error message instead of crashing.

  2. Can I add external texture to my server?? I tried Putting files in Models folder but it’s not working! Please tell me if anything is possible

    1. I was hoping to make a tutorial on this but haven’t had a chance yet. Basically you could add some code to the server’s game scripts to grab whatever values you want during or after games (perhaps in TeamScoreScreenActivity.showPlayerScores() in bsTeamGame.py) and then dump those to a local json file or push them to a server or whatever. Then your webpage could read and display those values. Hope that helps!

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.