Auto -re-/set defaults on first player join

Make suggestions for improving one of the best games on the net!
Post Reply
Misadventure
Private First Class
Private First Class
Posts: 9
Joined: Fri Jul 03, 2009 1:30 pm

Auto -re-/set defaults on first player join

Post by Misadventure » Mon Aug 26, 2019 6:50 pm

I arrived at a map earlier where players and admin were trying to fix some server variables that appear to have been adjusted earlier through a poll.

It occurred to me that when a first player joins (or last player leaves) a map, the server could automatically set all variables back to their defaults. Any poll changes then only persist as long as players are active on the map and do not remain for later players. Self fixing!

User avatar
The Noah
Private First Class
Private First Class
Posts: 62
Joined: Mon Jul 11, 2016 9:38 pm
Location: GitHub
Contact:

Re: Auto -re-/set defaults on first player join

Post by The Noah » Mon Aug 26, 2019 7:57 pm

I agree. Although I think /poll set should just be removed or defaulted to not being allowed.

User avatar
tainn
Private First Class
Private First Class
Posts: 171
Joined: Sun Nov 18, 2018 7:25 pm
Location: zone of the phantoms

Re: Auto -re-/set defaults on first player join

Post by tainn » Mon Aug 26, 2019 9:54 pm

I believe someone has actually written a script that did just that; reset all server variables once no players were on the map. It was either that or restarting the entire server with the default values. Uncertain.

User avatar
allejo
Breaker of Builds
Breaker of Builds
Posts: 764
Joined: Sun Feb 17, 2008 10:01 pm
Location: /dev/null
Contact:

Re: Auto -re-/set defaults on first player join

Post by allejo » Tue Aug 27, 2019 4:52 am

serverControl allows you to reset the server by it shutting down and letting a bash script restart it; look at the `ResetServerOnce*` settings. Without restarting the server, a simple plug-in (or PR to serverControl) could be added to just make a call to bz_resetALLBZDBVars.
Here's my personal website and my open source projects are available on GitHub; I work on a lot of cool things.

Image

User avatar
blast
General
General
Posts: 4744
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Auto -re-/set defaults on first player join

Post by blast » Tue Aug 27, 2019 11:07 am

It would probably be the ResetServerAlwaysFile actually, since that would restart the server every time it emptied. ResetServerOnceFile is more when you want to restart a server for maintenance (such as upgrading to a new bzfs binary) after it has emptied.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

Misadventure
Private First Class
Private First Class
Posts: 9
Joined: Fri Jul 03, 2009 1:30 pm

Re: Auto -re-/set defaults on first player join

Post by Misadventure » Mon Sep 02, 2019 11:44 am

Many thx for the pointers. I've just suggested it to one owner where a problem occurred recently.

/poll set can be fun & educational sometimes, but yes, should probably be concsiously enabled by an owner.

User avatar
Zehra
Private First Class
Private First Class
Posts: 620
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic

Re: Auto -re-/set defaults on first player join

Post by Zehra » Wed Sep 04, 2019 7:24 pm

The Noah wrote:
Mon Aug 26, 2019 7:57 pm
I agree. Although I think /poll set should just be removed or defaulted to not being allowed.
In versions 2.4.12 and upwards, poll set is not enabled by default.

Code: Select all

BZFlag 2.4.12  "Silence is Golden" (2017-10-29)
-----------------------------------------------

* Allow API to trigger CTF capture event - Vladimir Jimenez
* Allow setting default values for BZDB from API - Vladimir Jimenez
* Add bzu_getTeamFromFlag() convenience function - Vladimir Jimenez
* Add new functions to the bz_APIStringList - Vladimir Jimenez
* Add string utility functions to the API and TextUtils - Vladimir Jimenez
* Fixed an issue with ASCII characters from modified non-ASCII keys in SDL 2
    - Joshua Bodine
* Fixed compilation on macOS when using autotools/gcc - Mike Miller
* Don't send client queries on behalf of players - Vladimir Jimenez
* Removed pollSet as a default perm in bzfs - Vladimir Jimenez
* Player records canSpawn value no longer always returns true - Vladimir Jimenez
* bz_addURLJob() now supports setting HTTP headers - Vladimir Jimenez
* Made multisampling work on all platforms with SDL 1.2/2 - Joshua Bodine
* Add bz_eMuteEvent and bz_eUnmuteEvent to the API - Vladimir Jimenez
* Add configure --disable-server option - Jeff Makey
* Add bz_isPlayerAutoPilot() to the API - Vladimir Jimenez
* Add bz_eAutoPilotEvent to the API - Vladimir Jimenez
* Add bz_getServerOwner() API function - Vladimir Jimenez
* The _maxFlagGrabs BZDB setting is no longer a random number - Vladimir Jimenez
* Add API access for the handicap system - Jeff Myers, Vladimir Jimenez
* Remove Xcode references to deployment targets except for main project
    - Joshua Bodine
* Allow silencing unregistered players in the client - Scott Wichser
* Fix the /silence and /unsilence client commands - Scott Wichser
allejo wrote:
Tue Aug 27, 2019 4:52 am
serverControl allows you to reset the server by it shutting down and letting a bash script restart it; look at the `ResetServerOnce*` settings. Without restarting the server, a simple plug-in (or PR to serverControl) could be added to just make a call to bz_resetALLBZDBVars.
Are you sure this would do as expected?
Judging by the function name, it seems that it would simply reset all variables to the "defaults", instead of the values which may have been passed.(Not what is wanted in this case.)

It is not too difficult to write a plug-in which does perform a reset when the player count reaches zero.
So I may do so myself in the future. Or offer help to anyone who does wish to do so.

-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
There's always something to remember and it's been a game I love. ~Zehra
The time spent is a time which can never be regained, so it's a time to enjoy. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

See where I've last been active at Strayers.

User avatar
blast
General
General
Posts: 4744
Joined: Fri Mar 21, 2003 3:49 pm
Location: playing.cxx
Contact:

Re: Auto -re-/set defaults on first player join

Post by blast » Wed Sep 04, 2019 9:46 pm

Unless I'm mistaken, I'm pretty sure that BZDB values set at startup are set to be the default value. So a '/reset *', for instance, will reset all settings back to what the server config or world had defined.
"In addition to knowing the secrets of the Universe, I can assure you that I am also quite potty trained." -Koenma (Yu Yu Hakusho)

Image

Bertman
Private First Class
Private First Class
Posts: 229
Joined: Sun Jan 11, 2015 3:40 am

Re: Auto -re-/set defaults on first player join

Post by Bertman » Sat Sep 14, 2019 4:08 pm

The reset will work in cases like this. The incident that started this thread was taken care of by disabling the polls on the server in question to avoid further problems. The bash script for the restart will also work as that is how I have my servers set up... Unfortunately it looks like poll abuse is still a thing, but it only gives temporary satisfaction to those who do abuse it. The tools that are available in BZFS and Linux are more than adequate to take care of these things. That being said, the problem has been solved on the server so go and enjoy the game.

User avatar
Zehra
Private First Class
Private First Class
Posts: 620
Joined: Sun Oct 18, 2015 3:36 pm
Location: Arctic

Re: Auto -re-/set defaults on first player join

Post by Zehra » Sat Sep 14, 2019 11:33 pm

Server owners should already be aware of the permissions from global groups and how to configure them, especially the defaults.
Three simple signs (!, +, -) can be used to deny, grant and omit permissions from various global groups.
Additionally, poll "set" abuse need not be a concern for server owners who have updated to 2.4.12 and above as by default, the pollSet permission is not granted.

For those who may need assistance in setting up permission files for global groups, feel free to private message me.

-Zehra
Those who are critical of me, I'll likely be the same of them. ~Zehra
There's always something to remember and it's been a game I love. ~Zehra
The time spent is a time which can never be regained, so it's a time to enjoy. ~Zehra
The decisions we make are the ones we look forward too and the ones we regret. ~Zehra
There's a difference between knowing my name and knowing me, one shows respect to my name and the other is to who I am. ~Zehra

See where I've last been active at Strayers.

Bertman
Private First Class
Private First Class
Posts: 229
Joined: Sun Jan 11, 2015 3:40 am

Re: Auto -re-/set defaults on first player join

Post by Bertman » Sun Sep 15, 2019 1:33 am

Actual server owners work together pretty well in this game. The collective experience and Linux knowledge among us is pretty good. That's how these sort of problems get resolved pretty quickly. As stated before, the problem has been taken care of.

Post Reply