[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [pbmserv-dev] just want to bounce this off you all...



On Fri, 9 Nov 2001, Douglas Zander wrote:

> Hello developers,
>   I was thinking of developing a command for multiplayer games called,
> "waitlist" and I wish to ask if this seems like a good idea or if there
> is anything I am missing.

I like the idea.

> The idea is to include in the "::UnknownCommand"
> routine a new command "waitlist" that would create a file in the game's
> directory that would hold a list of names of players who are waiting for
> opponents.

This would be useful for many games, so putting it in UnknownCommand seems
strange.  Instead of creating Yahtzee::UnknownCommand,
Tanbo::UnknownCommand, ETC::UnknownCommand, you could just define a new
command in game.cpp, and it would apply to all games.

> When a player sends in the waitlist command, she would be added
> to the end of the list and then the program would check if there are the
> required number of players needed to start a new game.  If there are say,
> 6 player's names on the list for a six-player game then it would create
> a string of those names (and erase the six players from the waitlist) and
> send that string of six names to the "Challenge" command to start a new game.
> If less than the required names were on the list then it would simply notify
> the player that they were placed on the list and to please wait.

Sounds good.

> I am
> thinking the waitlist may hold other information that the player may wish
> to add: how many games she wants to be included in,

Where would her name go on the list each time a game starts?
You could at least randomize the order when re-placing them on the list.

How about dropping the option to say "I want 6 games", and instead allow
them to have their name on the list more than once.  That way they have to
send the waitlist command 6 times if they want six games.  The real
benefit of that is that you no longer have to worry about creating
multiple games from a single waitlist command, since each command can only
create at most one game.

> her preferences for command-line parameters/options,

So it would have to find X players with matching parameters?

This could get very complex.  Someone will want to say "I don't want to
play a game with the -long option".  Someone else will want to specify a
range of acceptable board sizes, etc.

What if they ask for invalid options?

> her preferences for how many players in
> the game (2-player game, 4-player game, or any number of players).

A range?  More than 2?

> I believe this would be much easier to program in than my previous ideas. :-)
> Some questions I have though: 1) if the first four players to be placed on
> the waitlist asked for 6 games of 4-players each, how would I prevent it from
> sending in 6 challenges with the same four players?
> For that matter, how
> would I start more than 1 challenge?  Does the challenge command return from
> its routine with an exit value?  2) If the name of the game were for example
> "Yahtzee" would I need to specifically call the routine as:
> Yahtzee::Challenge(stringofplayers);
> or just call it as
> Challenge(stringofplayers);

The Challenge routine takes (argc,argv) parameters, just like main().  So
create an array of strings with the player names and parameters, and pass
that to Challenge.

> Thanks for any ideas you may contribute before I try this out on my
> test-server.

Have you thought of a syntax which will support all those ideas?


~ John Williams