HostedRedmine.com has moved to the Planio platform. All logins and passwords remained the same. All users will be able to login and use Redmine just as before. "Read more...":https://support.plan.io/news/187
Feature #766520
closedAdd fcdb hook for checking if player delegation is allowed
0%
Description
Longturn.org and fcweb both could use this.
Files
Related issues
Updated by Jacob Nevins over 4 years ago
- Related to Feature #657143: fcdb: allow database.lua to set user's cmdlevel, delegation etc added
Updated by Jacob Nevins over 4 years ago
Previous vague thoughts on the topic in feature #657143.
Updated by Marko Lindqvist over 4 years ago
The code is being added for "/take" and not for "/delegate take" command. Why is that?
Updated by Zoltán Žarkov over 4 years ago
On lt.org you set delegations from the web site, so the freeciv server just needs logic to handle /take. I think there are a lot more fcdb script calls to be added like getting userlevel, so I will make a more extensive patch.
Updated by Zoltán Žarkov over 4 years ago
- Related to Task #656466: S3_0 datafile format freeze (d3f) added
Updated by Zoltán Žarkov over 4 years ago
I think anything that changes the behavior of database.lua counts as datafile breaking, and I'm changing the return API for some things in there.
Updated by Zoltán Žarkov over 4 years ago
- Blocked by Feature #769078: Change call signature for luascript funcs to allow any return values added
Updated by Zoltán Žarkov over 4 years ago
- File 0002-Add-fcdb-calls-for-checking-if-take-and-delegate-to-.patch 0002-Add-fcdb-calls-for-checking-if-take-and-delegate-to-.patch added
Background- fcweb game 0x10 is a 2-team 23h turn game where each team has a captain that is allowed to do /delegate to for any of their teammates in the case of unexpected idleness. Additionally, all players may /observe any of their teammates but no other players. These are the changes to enable these sorts of behaviors in fcdb lua scripts.
- Add fcdb functions to check if /delegate to and /take are allowed.
- Add lua environment function for checking connection's player
- Add lua environment function for checking player's team.
Updated by Zoltán Žarkov over 4 years ago
- File 0002-Add-fcdb-calls-for-checking-if-take-and-delegate-to-.patch 0002-Add-fcdb-calls-for-checking-if-take-and-delegate-to-.patch added
I have split the lua environment functions out of this patch.
Updated by Zoltán Žarkov over 4 years ago
- File 0002-Add-fcdb-checks-to-delegate-and-take.patch 0002-Add-fcdb-checks-to-delegate-and-take.patch added
Rebased
Updated by Zoltán Žarkov over 4 years ago
- File 0001-Add-fcdb-checks-to-delegate-and-take.patch 0001-Add-fcdb-checks-to-delegate-and-take.patch added
Rebased again.
Updated by Marko Lindqvist over 4 years ago
Zoltán Žarkov wrote:
On lt.org you set delegations from the web site, so the freeciv server just needs logic to handle /take. I think there are a lot more fcdb script calls to be added like getting userlevel, so I will make a more extensive patch.
Regardless where the delegation is first set, shouldn't this be "take" subcommand of "/delegate" and not completely separate command of "/take"? Even if it's ok for lt use-case, it doesn't seem like a right to do in our (upstream) code. There's a difference between "/take" and "/delegate take" and we don't want to lose ability to do "/take" semantics by making it behave like "/delegate take". Or have I misunderstood something completely?
Updated by Zoltán Žarkov over 4 years ago
- "delegate to" calls a lua function user_delegate_to to check permission if its a connection other than the assigned user or console.
- "take" and "observe" commands call lua user_take through is_allowed_to_take
Updated by Zoltán Žarkov over 4 years ago
- File 0001-Add-fcdb-check-to-delegate-to-subcommand.patch 0001-Add-fcdb-check-to-delegate-to-subcommand.patch added
Just "delegate to"
Updated by Marko Lindqvist over 4 years ago
script_fcdb_call("user_delegate_to", caller, dplayer, &ret) seems to be missing API_TYPE_STRING (password?) parameter defined for "user_delegate_to" in script_fcdb.c.
Updated by Zoltán Žarkov over 4 years ago
- File 0001-Add-fcdb-check-to-delegate-to-subcommand.patch 0001-Add-fcdb-check-to-delegate-to-subcommand.patch added
Added- the string parameter is username.
Updated by Marko Lindqvist over 4 years ago
- Status changed from New to Resolved
- Sprint/Milestone set to 3.0.0
Updated by Zoltán Žarkov over 4 years ago
- File 0005-Add-fcdb-check-to-delegate-to-subcommand.patch 0005-Add-fcdb-check-to-delegate-to-subcommand.patch added
S3_0 rebase
Updated by Zoltán Žarkov over 4 years ago
- File 0005-Add-fcdb-check-to-delegate-to-subcommand.patch 0005-Add-fcdb-check-to-delegate-to-subcommand.patch added
Rebase of the correct patch
Updated by Marko Lindqvist over 4 years ago
- Category set to Server
- Assignee changed from Zoltán Žarkov to Marko Lindqvist
Updated by Marko Lindqvist over 4 years ago
So database.lua does not implement user_delegate_to, but we rely on behavior being correct in complete lack of the function. I think I would prefer trivial user_delegate_to implementation to provide "no special permission", but that can wait to a new ticket (assuming current implementation does the right thing)
Updated by Marko Lindqvist over 4 years ago
Have you successfully tested all of these cases:
- Permission is not granted when fcdb support is not built in at all (not built in by default in S3_0)
- Permission is not granted when "user_delegate_to" does not grant it
- Permission is granted when "user_delegate_to" grants it
I'm failing to get "user_delegate_to" to ever grant permissions, but there might be something wrong in my setup.
Updated by Marko Lindqvist over 4 years ago
Just noticed that I had got:
1: in luascript_func_call_valist() [../../../../src/common/scriptcore/luascript_func.c::206]: assertion 'fcl' failed.
This is when I have fcdb support built in (so it really tries to call user_delegate_to when I request delegation) but not set player auth to use runtime.
Updated by Marko Lindqvist over 4 years ago
You probably need to check srvarg.fcdb_enabled before calling script_fcdb_call()
Updated by Marko Lindqvist over 4 years ago
- Status changed from Resolved to In Progress
Updated by Marko Lindqvist over 4 years ago
- Assignee changed from Marko Lindqvist to Zoltán Žarkov
Updated by Zoltán Žarkov over 4 years ago
- File 0001-Add-fcdb-check-to-delegate-to-subcommand.patch 0001-Add-fcdb-check-to-delegate-to-subcommand.patch added
- File 0002-Add-fcdb-check-to-delegate-to-subcommand.patch 0002-Add-fcdb-check-to-delegate-to-subcommand.patch added
Properly tested with HAVE_FCDB false, srvarg fcdb disabled, and enabled.
Updated by Marko Lindqvist over 4 years ago
- Status changed from In Progress to Resolved
- Assignee changed from Zoltán Žarkov to Marko Lindqvist
Updated by Zoltán Žarkov over 4 years ago
- File 0002-Add-fcdb-check-to-delegate-to-subcommand.patch 0002-Add-fcdb-check-to-delegate-to-subcommand.patch added
- File 0001-Add-fcdb-check-to-delegate-to-subcommand.patch 0001-Add-fcdb-check-to-delegate-to-subcommand.patch added
Added comment for fcdb function.
Updated by Marko Lindqvist over 4 years ago
- Status changed from Resolved to Closed