Jump to content

How to ban a player when he's not currently online


Recommended Posts

SAS_Storebror
Posted

Hi folks,

 

We've got an idiot a player on our server who should receive a temporary ban for constantly violating our server rules.

However, as luck would have it, he's always online when I'm not, so I can't just hit the "ban" button on DServer right now.

I thought I could find a config file somewhere on DServer that lists all banned players, but couldn't find anything so far.

Test-banned myself, which works, but I somehow get the feeling like the bans are stored on Master Server only. Is this correct?

 

Either case, these two questions come up for me:

  1. How do I ban someone who's currently not on my server?
  2. How do I dynamically adjust the ban timeout without having to restart the whole server (i.e. reload the SFS file)?

 

:drinks:

Mike

Posted
51 minutes ago, SAS_Storebror said:

Either case, these two questions come up for me:

  1. How do I ban someone who's currently not on my server?
  2. How do I dynamically adjust the ban timeout without having to restart the whole server (i.e. reload the SFS file)?

 

  1. You need to use their player GUID, which you get via rcon
  2. I don't think you can. What I do is that I just automatically (using my SturmovikServerControl tool) re-ban players when they log in, until the date/time of end of ban for that player has been reached
SAS_Storebror
Posted

Thanks for the feedback coconut.

Banning a player by GUID (i.e. player ID, profile ID) or name doesn't seem to work when he's offline, status is always 9 = "unknown user".

Doing this "on demand" will probably work, but is your SturmovikServerControl suitable for normal (non-dynamic campaign) dogfight servers as well?

 

:drinks:

Mike

Posted (edited)
14 minutes ago, SAS_Storebror said:

name doesn't seem to work when he's offline, status is always 9 = "unknown user".

Right, now that you mention that it's possible I never tested that. I just expected it to work that way.

 

14 minutes ago, SAS_Storebror said:

Doing this "on demand" will probably work, but is your SturmovikServerControl suitable for normal (non-dynamic campaign) dogfight servers as well?

Yes, the campaign system is an optional plugin, SSC can run without it.

Edited by coconut
SAS_Storebror
Posted

Thanks again for your help coconut.

I finally found time to get SturmovikServerControl up and running, looks quite promising.

I would love to dive into the source code, however even as a professional .Net programmer myself, F# is all greek to me - I'm a C# type of guy you know ;)

Nevertheless, back to topic...

Two things:

  1. I still can't seem to find a way to ban someone who's not online.
    Sure I have the buttons to ban someone for a day or a month if he's online, but what about banning someone just by his name or GUID?
    Tried to enter it in the search field but it yields no results.
  2. I understand that SturmovikServerControl consumes DServer's logfiles.
    IL2 Stats does the same.
    If I leave "LogDirectory" empty, will SturmovikServerControl leave logs completely untouched?
    Otherwise, if I leave "CompactedLogDirectory" and/or "ProcessedLogDirectory", will SturmovikServerControl at least leave the logfiles where they are?

:friends:

Mike

Posted

1 there is a search field in the status page. You must be logged in for it to work

 

2 latest version has the log parsing removed, best to use that one. For older versions, leave these fields empty and that should leave the logs in place. 

SAS_Storebror
Posted

I guess "latest version" refers to 1.11.1.0 as of now, in that case I have it already.

 

I have been logged in when I've searched for the name, however I guess that in order to be aware of that user, SturmovikServerControl must have "seen" him first, meaning that it must have been running while he's been online, correct?

 

:drinks:

Mike

Posted

Latest one is 1.15.0.0, with 1.16.0.0 coming out soon

https://bitbucket.org/johdex/sturmovikservercontrol/downloads/SturmovikServerControl-30772a5f3103d5a7ba1ba2e2bfba3a2ad2b23732-23.zip

Link above is a weekly build, somewhere in between 1.15 and 1.16

I grew tired of manually publishing builds after 1.11, and spent some time automating that, so now it should be easier to get up-to-date versions.

 

Yes, SSC must have been running and connected to DServer when the player in question was online.

 

SAS_Storebror
Posted

Eww...

Immediately after installing that weekly build, I remembered why I'm so reluctant to install anything that hasn't got the "release" status yet.

So, this is what I get after updating:

 

1st run starts like this:

> SturmovikServerControl.exe                                                                                                                        
2018-07-30 13:20:28.6755|INFO|<StartupCode$SturmovikServerControl>.$SturmovikServerControl.Database|Updated database from 0 to 1                    
2018-07-30 13:20:28.7736|INFO|<StartupCode$SturmovikServerControl>.$SturmovikServerControl.Database|Updated database from 1 to 2                    
Failed to load symbols: C:\IL2\SturmovikServerControl\FsPickler.pdb                                                                                 
2018-07-30 13:20:31.5013|INFO|<StartupCode$SturmovikServerControl>.$Main|main: Listening on http://localhost:8083/  
2018-07-30 13:20:31.5013|INFO|<StartupCode$SturmovikServerControl>.$Main|main: Ban checker started                                                  

looks fine to me.

Ctrl+C and restart gets me this:

> SturmovikServerControl.exe
2018-07-30 13:22:46.8798|ERROR|<StartupCode$SturmovikServerControl>.$SturmovikServerControl.Database|Exception while trying to update database: The file 'sscontrol-v0-1.sdf' already exists.

Unhandled Exception: System.Exception: Failed to update database ---> System.IO.IOException: The file 'sscontrol-v0-1.sdf' already exists.
   at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
   at System.IO.File.InternalCopy(String sourceFileName, String destFileName, Boolean overwrite, Boolean checkHost)
   at SturmovikServerControl.Database.work@91-12(Entities ctx, Int32 v) in D:\a\1\s\SturmovikServerControl\Database.fs:line 103
   --- End of inner exception stack trace ---
   at SturmovikServerControl.Database.work@91-12(Entities ctx, Int32 v) in D:\a\1\s\SturmovikServerControl\Database.fs:line 115
   at SturmovikServerControl.Database.upgradeDb() in D:\a\1\s\SturmovikServerControl\Database.fs:line 116
   at <StartupCode$SturmovikServerControl>.$Main.main@() in D:\a\1\s\SturmovikServerControl\Main.fs:line 288

Okay... so the program update it's database, but didn't remember doing so already.

I've removed "sscontrol.sdf" and "sscontrol-v0-1.sdf" and now SturmovikServerControl starts again, however the web interface looks completely different and I've got no idea what to do with it anymore.

Please see the attached image for the user interface... no SPS visible anymore, no status, and nothing to login to (entering the password into the right field alone doesn't work).

 

SturmovikServerControl.png

SAS_Storebror
Posted

Think I figured it out myself.

For some reason, per default you get redirected to the "Players' site", but with no trace how to get elsewhere.

After looking at the sourcecode, I've added "/loging" to the url and got to the Admin login.

Ever since then, the "Players' site" has a blue "Admin" link on top, but I cannot logout anymore...

Well then, at least I have my old status page back ;)

 

:drinks:

Mike

Posted

Sorry for then inconvenience, glad you figured it out. I'll try to polish those rough corners.

SAS_Storebror
Posted

No problem coconut, I appreciate that tool very much!

It's a work in progress and a bit tough to get used to in the beginning, but it does it's job quite well.

The ban worked perfectly fine after the regarding player came online.

I only wish it would be possible to set custom ban times, but that's no biggie.

Editing the sdf file is not that hard to do ;)

 

Cheers for the great tool!

:drinks:

Mike

  • 8 months later...
Posted

Hello @coconut and @SAS_Storebror - I also have an idiot that I need to ban, but they are no longer connected to the server. SSC I believe recorded their GUID. The button in the SSC web console doesn't seem to do anything, and if I try to manually ban via rcon that also doesn't seem to work.

 

Forgive me for being very dim, but let's say I just know the player's GUID. Can I ban them via the plain old remote console? Or any other way?

SAS_Storebror
Posted (edited)

This is what I did:

 

  1. Download a viewer/editor for Microsoft SQL Server Compact databases, e.g. CompactView
  2. Run your SQL Compact editor (I'll just call it "CompactView" now) and open up the "sscontrol.sdf" database file in your Sturmovik Server Control folder.
  3. Switch CompactView to "Allow Editing" mode in the upper left corner.
  4. Open up the "PlayerNames" table to find the ID of the player you want to ban (not the GUID, here you need Sturmovik Server Control's internal ID which is just a counter)
  5. Open up the "Bans" table and add an entry accordingly, where "ID" is just a counter, "PlayerGuid" is the "ID" from the "PlayerNames" table, "Expiration" is any given expiration date for the ban, and "Comment" is any comment of your choice for the ban:
    1173269385_SSCBan.PNG.65fa201ea70aa44ec07600075745aebc.PNG

:drinks:

Mike

Edited by SAS_Storebror
screenshot edit
  • Thanks 1
Posted (edited)
On 4/30/2019 at 5:43 AM, Alonzo said:

Hello @coconut and @SAS_Storebror - I also have an idiot that I need to ban, but they are no longer connected to the server. SSC I believe recorded their GUID. The button in the SSC web console doesn't seem to do anything, and if I try to manually ban via rcon that also doesn't seem to work.

 

Forgive me for being very dim, but let's say I just know the player's GUID. Can I ban them via the plain old remote console? Or any other way?

  1. Go to the login page, enter the admin password
  2. Go to the status page. There's a player search function, which uses the player's name or their GUID. Fill in the relevant input field, click search
  3. If the player is found, there should be a number of ban buttons. If this is a really undesirable troll, I suggest "ban century"
  4. There will be no feedback in the UI, which I now realize is confusing, but it should work nevertheless

Next time this player joins, they'll be in for at most one minute, at which point the polling procedure will notice them and ban kick them.

 

This advice was for version 1.19.1.0 of the controller

 

Edited by coconut
  • Thanks 1
  • 3 months later...
616Sqn_SpocksOddSocks
Posted (edited)
On 4/30/2019 at 6:42 AM, SAS_Storebror said:

This is what I did:

 

  1. Download a viewer/editor for Microsoft SQL Server Compact databases, e.g. CompactView
  2. Run your SQL Compact editor (I'll just call it "CompactView" now) and open up the "sscontrol.sdf" database file in your Sturmovik Server Control folder.
  3. Switch CompactView to "Allow Editing" mode in the upper left corner.
  4. Open up the "PlayerNames" table to find the ID of the player you want to ban (not the GUID, here you need Sturmovik Server Control's internal ID which is just a counter)
  5. Open up the "Bans" table and add an entry accordingly, where "ID" is just a counter, "PlayerGuid" is the "ID" from the "PlayerNames" table, "Expiration" is any given expiration date for the ban, and "Comment" is any comment of your choice for the ban:
    1173269385_SSCBan.PNG.65fa201ea70aa44ec07600075745aebc.PNG

:drinks:

Mike

Very helpful information, not just for amending a ban, but for being able to check it's in place as well. However, just from checking, it appears that the PlayerGuid is actually the ID from the PlayerGuid table, but doesn't necessarily match the id number on the PlayerName table. Just thought that might be helpful for any one else stumbling across this. I'm not certain where the player name table added someone that isn't on the Guid table, but it seems to have. I don't think it's stopping this from working though, but it might be best not to add one based on the PlayerName table manually, thinking that the IDs on both tables match.

Edited by SpocksOddSocks
Additional info

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
×
×
  • Create New...