
186.206.173.35
He has a dynamic IP so it changes pretty frequently, but it's a start.
Actually, how hard would it be to throw together a request in C++ in the game? libxml2 already gives us the ability to request web pages, does it also allow us to request plain text files? If it does, we might could hack something together that works from the server.Light wrote:On top of that, we could do a real-time check if you think it's a useful idea. It wouldn't really hurt anything, and would possibly give us the ability to have even better features.
I spent my morning trying to overcome that fundamental flaw, and the truth is, we'll have to have a lot more in place before we can sync banlists like I proposed, so I'm going to agree with you that it should all be handled through a web front-end.One thing that you've mentioned above that I'm against though is banning through the game (adding to banlist from in-game). At least, it sounded like you were saying that. I think that would be a bad idea because we could either have people spoof what we're using to check, or if we make it something they can't spoof, they could intercept. I think it has to be handled outside of the game. This is only because untrusted people can run the script on their servers, and we don't want trusted people attempting to log in there and give access to the system.
Would the script block the server from continuing to the next round in case there's a timeout trying to reach the webserver?So, yeah! We could have a real-time check with a backup that all goes on inside the script, and requires nothing more than a spawn_script command in their config.
Code: Select all
{"VERSION":1}
Code: Select all
{"VERSION":1,"USER_LEVEL":"USER_LEVEL Kira@lt 1\n","BAN":"BAN_IP 186.206.173.35 525425 DoS Attack\n"}
Code: Select all
// File Names
$file_user_level = "police_user_level.cfg";
$file_ban = "police_ban.cfg";
$file_override = "police_override.cfg";
Code: Select all
INCLUDE police_user_level.cfg
INCLUDE police_ban.cfg
It's mixed into my site's database, along with using a custom database class for mysqli and whatnot. The naming is also a little different than I mentioned, but wasn't about to start writing out my database layout in public. I'm also not sure why the database table names would matter for anyone but me? The script sees nothing but the arrays I return, unless you were talking about key names. I have a script on my server that puts everything together for you, so in a sense you're using it like an API.Lucifer wrote:Ahhh, man, that's some out-of-the-box thinking there. It hadn't even occurred to me that doing it this way would let Player Police demote players' userlevels.
The three files I listed need to be included as I listed. That's necessary so that private servers that want to use the system but also want to customize it are able to do so. Putting the INCLUDE in everytime.cfg and one of the other server config files will make sure that even when your server is unavailable, the current cached files will be used.
I would prefer the tables renamed to something resembling the ones I described, and I'd like to see the schema and discuss it. It may sound like painting the bike shed, but it's not. The script should use the information in the database to generate the files, but the database needs to reflect the information in it, not the files it will be used to generate.
Do you have a place you can put a bzr branch where I can check it out and play with it?
It's not the names that matter so much as the layout. It looks like what you've described has a table where you put config items, which may be useful, but relying on such a table gives long-term problems when it's time to add new features to the system. The database should not be aware of how armagetron config files are made. The script is responsible for generating the config files. If you really did lay it out that way but simply chose awkward table names, then we're golden, except that I'll ask for more descriptive table names.Light wrote: It's mixed into my site's database, along with using a custom database class for mysqli and whatnot. The naming is also a little different than I mentioned, but wasn't about to start writing out my database layout in public. I'm also not sure why the database table names would matter for anyone but me? The script sees nothing but the arrays I return, unless you were talking about key names. I have a script on my server that puts everything together for you, so in a sense you're using it like an API.
There are two scripts. One of them are on my webserver that you are querying, and the other is on your server. You query my script, it gives you all of the information, your script would save it and run it. That's about it. The player tracking and police commands would also be done in the game server script, but that's not set up right now.Lucifer wrote:It's not the names that matter so much as the layout. It looks like what you've described has a table where you put config items, which may be useful, but relying on such a table gives long-term problems when it's time to add new features to the system. The database should not be aware of how armagetron config files are made. The script is responsible for generating the config files. If you really did lay it out that way but simply chose awkward table names, then we're golden, except that I'll ask for more descriptive table names.
Code: Select all
# This is the file that creates the Player Police, which are a group of global moderators
# who can moderate any server that subscribes to the Player Police.
# Global IDs have to be accepted for the system to work.
GLOBAL_ID 1
# All default access levels are ignored. The Player Police use completely different
# access levels.
# Level Meaning Details
# 0 Owner The owner of the server. Commands entered on the
# server console are executed with these rights.
#
# 5 Admin A server administrator. By default, almost as
# powerful as the owner himself.
#
# 9 Detective The highest-ranked of the Player Police. Using
# a web interface, he can globally ban players by
# username or IP. He can also ban players on a server,
# but it only takes effect on that server. Has all
# other powers.
#
# 10 Moderator A server moderator. Is still allowed to use /admin,
# but is restricted to player management commands. Generally,
# a Moderator local to the server is equal to a Detective,
# but has no powers on other servers.
#
# 14 Sheriff The middle ranked Player Police. He has the same powers
# on a server as a Detective, but cannot issue global bans.
#
# 17 Deputy The lowest-ranked Player Police. He has limited powers
# on a server.
#
# 20 Referee For organized matches, can be elected to use team and
# match management commands.
#
# 25 Team Leader Leader of a team. By default, no admin rights at all.
#
# 30 Team Member Member of a team. Local team accounts get this level.
#
# 35 Local User Players with local accounts get this level.
#
# 40 Remote User Players with remote accounts get this level by default.
#
# 45 Fallen from Grace Authenticated players who abused default rights given
# to them.
# 50 Shunned Same, only worse :)
#
# 55 Authenticated Minimal level authenticated players can get.
#
# 100 Program Unauthenticated players.
# The following directives are documented in settings_authentication.cfg. These
# are the changes needed to support the Player Police.
ACCESS_LEVEL_ADMIN 5
ACCESS_LEVEL_RTFM 5
ACCESS_LEVEL_OP 25
ACCESS_LEVEL_OP_MAX 5
ACCESS_LEVEL_TEAM 25
ACCESS_LEVEL_PLAY 100
ACCESS_LEVEL_PLAY_SLIDERS 20
ACCESS_LEVEL_PLAY_SLIDING 100
ACCESS_LEVEL_PLAY_INVITED 100
ACCESS_LEVEL_CHAT 100
ACCESS_LEVEL_SHOUT 100
ACCESS_LEVEL_CHAT_TIMEOUT 60
ACCESS_LEVEL_AUTOKICK_IMMUNITY 25
ACCESS_LEVEL_SPY_TEAM 5
ACCESS_LEVEL_SPY_MSG 0
ACCESS_LEVEL_SHUFFLE_UP 30
# Issuing each vote type also requires a certain access level. By
# default (for unchanged behavior relative to previous versions),
# kick and suspend votes are available for everyone.
# The Player Police system may, at any time, decide to change this to
# authenticated users.
ACCESS_LEVEL_VOTE_REMOVE 100
ACCESS_LEVEL_VOTE_KICK 100
ACCESS_LEVEL_VOTE_INCLUDE 5
ACCESS_LEVEL_VOTE_COMMAND 5
ACCESS_LEVEL_VOTE_INCLUDE_EXECUTE 5
ACCESS_LEVEL_VOTE_COMMAND_EXECUTE 5
# This is where the ability to execute commands is set.
ACCESS_LEVEL PLAYER_MESSAGE 5
ACCESS_LEVEL KICK 17
ACCESS_LEVEL BAN 14
ACCESS_LEVEL KICK_TO 17
ACCESS_LEVEL MOVE_TO 17
ACCESS_LEVEL SUSPEND 17
ACCESS_LEVEL UNSUSPEND 17
ACCESS_LEVEL KILL 17
ACCESS_LEVEL SILENCE 17
ACCESS_LEVEL VOICE 17
ACCESS_LEVEL ALLOW_RENAME_PLAYER 17
ACCESS_LEVEL DISALLOW_RENAME_PLAYER 17
ACCESS_LEVEL RENAME 17
ACCESS_LEVEL CONSOLE_MESSAGE 17
ACCESS_LEVEL CENTER_MESSAGE 17
ACCESS_LEVEL ALLOW_TEAM_CHANGE_PLAYER 25
ACCESS_LEVEL DISALLOW_TEAM_CHANGE_PLAYER 25
# This file is downloaded from the player police server.
INCLUDE Player_police_users.cfg
# This file is where you will override player police settings as needed to
# use the system in the way you want to use it.
INCLUDE Player_police_local.cfg
We don't have /police commands, and the idea is to use what's already there so that minimal changes to the game are needed. Since it turns out we have more hooks than I knew about, we can probably do this without requiring code changes on the server.Light wrote: I would think a local ban is something you should be able to do, but I would still suggest going more for /police commands and not taking over rank permissions on the servers people host. Also, we could make a command for the configs to update instead of waiting the whole 5 mins, which would then reset the 5 mins. That way if they updated it on the server, they could sync it to the current server immediately. May make more sense for user levels and whatnot than a ban, but still works as an example.
I'm not sure what you mean about configs alongside the police setup. I added the INCLUDE Player_police.cfg line to the end of the armathentication file, so server admins can override any Player Police settings they want. I also realize right now that I wrote the documentation wrong, and need to change it to say "Add this line to server_info.cfg" instead.I don't like the idea of requiring configs alongside the police setup. I would think their servers should have any configs they want, allowing any number of ranks with the permissions they want, but be able to implement the police without screwing any of it up. I would really be minimal on any settings changes, if any.
If police servers ran a script, it could easily be a part of that.Lucifer wrote:We can look at making /police commands in 0.5, but I really don't want to add more todo items to the 0.4 release list. That's why we're sticking with what is already there to implement this.