Project

Profile

Help

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...

Feature #866262

Server command(s) to create players and assign nations

Added by Louis Moureaux over 2 years ago. Updated almost 2 years ago.

Status:
Closed
Priority:
Normal
Category:
General
Sprint/Milestone:
Start date:
Due date:
% Done:

0%

Estimated time:

Description

At longturn.net the player list for a game is known before it starts. Players can register and choose their nation from the website weeks before the server is started. When the game eventually starts the admin checks the list of players in the database and uses a custom server command to setup the teams and players. It reads a special file format and sets up the game state. The implementation is poor and can leave the server in an inconsistent state.

Currently adding players on the command line is possible using a combination of /create, /aitoggle and /team. Setting the nation is only possible through the /lua command (eg /lua edit.create_player('louis94', find.nation_type('...'))).

I see two possible solutions:

  1. Extend the /create command as follows:
    create <username> [AI type|human] [nation] [team]

    This would break compatibility for any AI module called "human". I'd say that naming an AI this way was a bad idea to begin with :P
  2. Add player management to fcdb. It's not as scary as it sounds: it would require two new lua functions (player:set_team(string), player:set_ai(bool)) and exposing the edit module.

I would strongly prefer something that can land in the 2.6 branch already, since longturn.net will likely be using it for a while. If not possible I can still provide patches for newer versions -- and evaluate how their 2.6 counterpart behaves in production.


Related issues

Related to Freeciv - Feature #768292: Add /playernation command for setting nation and leader nameClosed

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

History

#1 Updated by Marko Lindqvist over 2 years ago

I think Feature #768292 is another approach for this same use-case.

#2 Updated by Louis Moureaux over 2 years ago

Right. The discussion here is a bit more general ("what's the best solution" rather than proposing a specific one), so I don't think it's a pure duplicate.

#3 Updated by Louis Moureaux over 2 years ago

  • Related to Feature #768292: Add /playernation command for setting nation and leader name added

#4 Updated by Marko Lindqvist over 2 years ago

Louis Moureaux wrote:

Right. The discussion here is a bit more general ("what's the best solution" rather than proposing a specific one), so I don't think it's a pure duplicate.

I just updated Feature #768292 with a patch version that could be commit candidate. Now we need to decide if it's the way to go. You know the use-case better than I do, so please comment.

In a way, now one of the pros of Feature #768292 approach is that the patch exist, and there's no need to wait for someone to implement it.

#5 Updated by Louis Moureaux over 2 years ago

After some thinking Feature #768292 would work even without randomization. The dice rolls can be performed by the caller since he knows the parameter space (the options are chosen by the player on a web page and validated before saving).

#6 Updated by Marko Lindqvist over 2 years ago

Do we need something more for this now that Feature #768292 has been pushed?

#7 Updated by Louis Moureaux over 2 years ago

I don't think so. I may have time to try and integrate master with longturn before d3f, will reopen if needed.

edit turns out I cannot close

#8 Updated by Marko Lindqvist almost 2 years ago

  • Category set to General
  • Status changed from New to Closed
  • Assignee set to Marko Lindqvist
  • Sprint/Milestone changed from 2.6.3 to 3.1.0

Also available in: Atom PDF