[Freeciv-Dev] [bug #18426] Allow server operators to restrict settings

2014-01-02 Thread Jacob Nevins
Follow-up Comment #2, bug #18426 (project freeciv):

An idea I had for this: add a Lua function a server operator could edit which
would be able to veto any setting proposed by players. It would be passed the
name and proposed value (as a string) of any setting change, and return a
boolean value whether it's allowed, and return or print a message why not.

Pros:
* Dead easy for us to implement and allows a wide range of policies to be
implemented (compared to us having to have machinery in C to allow operator to
specify min/max for numeric, allowed bits for bitmask settings, sets of
allowed strings for string settings, ... and whatever criteria we provided
would still probably fail to meet someone's needs)
Cons:
* Requires server operators to write code to use this; we can mitigate by
providing examples of common uses (limit maxplayers, limit rulesetdir per
patch #3438).
* Passing string version of value places responsibility on script writer to
validate input, with attendant possibility of mismatch with server's parsing
of input allowing bypassing the validation. We could ameliorate this by
exposing our option parsing functions to the script, and setting things up to
encourage their use.

Might want to expose access level of caller to the script to allow server
operator to implement their own caller access level policy on top of what we
provide.
Probably settings made from the server console or hack-level access should
bypass this, possibly with a warning.

(This ought to run in the same sort of unfettered Lua context as envisaged by
bug #19729, but that's not necessary for initial implementation. However, the
script file should live in the same place as database.lua does today.)

___

Reply to this item at:

  http://gna.org/bugs/?18426

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18426] Allow server operators to restrict settings

2011-08-16 Thread Reinier Post

Follow-up Comment #1, bug #18426 (project freeciv):

This has come up before ...

It would be nice to have a general mechanism for this.

E.g. the server can be made to automatically create, for each numerical
setting, say with name foo, two additional settings, named admin_max_foo and
admin_min_foo, that control its range and can be set only by users with
ALLOW_ADMIN.

A further refinement is to also do this for the other ALLOW_* levels (their
names can be taken from common/connection.h).

This can be done in maybe 30 lines of C code.

___

Reply to this item at:

  http://gna.org/bugs/?18426

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev


[Freeciv-Dev] [bug #18426] Allow server operators to restrict settings

2011-07-26 Thread Jacob Nevins

URL:
  http://gna.org/bugs/?18426

 Summary: Allow server operators to restrict settings
 Project: Freeciv
Submitted by: jtn
Submitted on: Tue Jul 26 23:51:59 2011
Category: general
Severity: 1 - Wish
Priority: 5 - Normal
  Status: None
 Assigned to: None
Originator Email: 
 Open/Closed: Open
 Release: 
 Discussion Lock: Any
Operating System: Any
 Planned Release: 

___

Details:

Over in this forum topic http://forum.freeciv.org/viewtopic.php?t=6894 we
had a server operator who wanted to restrict the 'maxplayers' setting, because
their server had limited resources and couldn't cope with 30 AIs; they wanted
at most 10 players.

Currently, there's no way for server operators to impose this sort of
restriction short of (a) adding a locked setting in their ruleset(s) (from
2.3.x onwards), or (b) recompiling.

We currently have infrastructure for locking settings in rulesets, and I
think it would be fairly trivial to add a server command to do something
similar. However, that would lock 'maxplayers' down to a _single_ setting
(10), whereas what we ideally want is to restrict the range of 'maxplayers'
from 1-30 to 1-10. This would require some complicated syntax, and wouldn't
generalise to enum or string settings.

(Or we could decide that the number of players / AIs is a special case, and
provide some solution that allows operator control of the limit, say an
'admin'-level setting that restricted the max.)




___

Reply to this item at:

  http://gna.org/bugs/?18426

___
  Message sent via/by Gna!
  http://gna.org/


___
Freeciv-dev mailing list
Freeciv-dev@gna.org
https://mail.gna.org/listinfo/freeciv-dev