Opened 10 years ago

Closed 10 years ago

Last modified 7 years ago

#2447 closed enhancement (fixed)

[PATCH] Require that all users confirm game settings before host can start game.

Reported by: scythetwirler Owned by: scythetwirler
Priority: Must Have Milestone: Alpha 16
Component: UI & Simulation Keywords: patch
Cc: Patch:

Description

We should have some kind of confirmation screen that all players accept the current configuration of map, civs, teams etc.

This will probably also involve including some kind of kicking capability for the host so that clients that want to abuse the system by rejecting all settings every time and preventing the game from starting can be dealt with.

This confirmation should not inhibit the client's ability to actually view the settings that they are about to confirm/reject.

Attachments (8)

ready.patch (15.4 KB ) - added by scythetwirler 10 years ago.
Side effect: deletes the player name column because it wouldn't fit otherwise.
readyv2.patch (27.4 KB ) - added by scythetwirler 10 years ago.
readyv3.patch (26.3 KB ) - added by scythetwirler 10 years ago.
readyv4.patch (29.8 KB ) - added by scythetwirler 10 years ago.
gear.png (19.8 KB ) - added by scythetwirler 10 years ago.
Enrique's gear icon.
gear-press.png (19.8 KB ) - added by scythetwirler 10 years ago.
Enrique's gear icon
2014-04-26-101300_1920x1080_scrot.jpg (425.1 KB ) - added by scythetwirler 10 years ago.
readyv5.patch (35.6 KB ) - added by scythetwirler 10 years ago.
Updated with i18n.

Download all attachments as: .zip

Change History (35)

comment:1 by scythetwirler, 10 years ago

Summary: Force all users to confirm game settings before host can start game.Require that all users confirm game settings before host can start game.

comment:2 by scythetwirler, 10 years ago

Owner: set to scythetwirler
Status: newassigned

comment:3 by scythetwirler, 10 years ago

Keywords: patch review added
Summary: Require that all users confirm game settings before host can start game.[PATCH] Require that all users confirm game settings before host can start game.

comment:4 by scythetwirler, 10 years ago

Something's not right with the image scaling of the checkboxes (they get cut off) and I'm not too familiar with that part of the code. Any ideas? EDIT: fixed. Thanks historicbruno!

Last edited 10 years ago by scythetwirler (previous) (diff)

by scythetwirler, 10 years ago

Attachment: ready.patch added

Side effect: deletes the player name column because it wouldn't fit otherwise.

comment:5 by Josh, 10 years ago

Keywords: review removed

We shouldn't be communicating important data using hidden chat messages, we have an existing system for sending that data. I've started working on extending the C++ API to supports a per-user "status".

comment:6 by scythetwirler, 10 years ago

Uploaded a new version that uses the network C++ API.

comment:7 by scythetwirler, 10 years ago

Keywords: review added

by scythetwirler, 10 years ago

Attachment: readyv2.patch added

comment:8 by Josh, 10 years ago

Keywords: review removed

The patch is well coded, but I think the separation between ReadyData and PlayerAssignments is synthetic. In most occasions where g_PlayerAssignments would be accessed or changed, g_ReadyData would be as well. Separating them allows more surface for bugs to appear and creates repetitive logic. In the worst case, combining the objects and messages results in the ReadyData field being unused sometimes. I really dislike asking people to go rewrite working code, but I think the benefits are worthwhile in this case. If I remember correctly, a great computer science professor at Stanford said something like, "the mark of a true programmer is not in how well the code works, but in how well others can read and understand it."

by scythetwirler, 10 years ago

Attachment: readyv3.patch added

comment:9 by scythetwirler, 10 years ago

Keywords: review added

ReadyData and PlayerAssignments have been merged in this patch.

Last edited 10 years ago by scythetwirler (previous) (diff)

comment:10 by scythetwirler, 10 years ago

There's some remnants of the checkbox GUI code commented out that I'll take out if this current GUI is accepted.

by scythetwirler, 10 years ago

Attachment: readyv4.patch added

comment:11 by scythetwirler, 10 years ago

Keywords: review removed

TODO: Convert the changes to be internationalization-friendly (also make an updated diff after the internationalization commit).

comment:12 by scythetwirler, 10 years ago

Keywords: review added

I'd like some people to help test this, as it's difficult to test multiplayer by myself.

comment:13 by sanderd17, 10 years ago

Line 172 of gameSetup.xml has a small mistake in it (325 instead of 315 px). Not your fault, but it will be easier if you fix it (no conflicts).

in reply to:  13 comment:14 by scythetwirler, 10 years ago

Replying to sanderd17:

Line 172 of gameSetup.xml has a small mistake in it (325 instead of 315 px). Not your fault, but it will be easier if you fix it (no conflicts).

Fixed in this version :)

comment:15 by leper, 10 years ago

gamesetup.js:

  • L452: Could just be if(a && b) instead of if (a) if (b).
  • L903: The check for the automatically added " ($number)" string is a hack. (Having a player with a nick with a "(" in it will break it)
  • L1254 and L1268: No need to add trailing whitespace.
  • L1562: Make it else if (a && b)
  • L1575: Same, also move the comment to a new line.
  • L1673: Use if(!a) continue.
  • L1695: Missing semicolon.

NetHost.h:

  • Why is it an i32?

NetServer.cpp:

  • L688: Useless braces.
  • Switch the parameters for ReadyPlayer().

by scythetwirler, 10 years ago

Attachment: gear.png added

Enrique's gear icon.

by scythetwirler, 10 years ago

Attachment: gear-press.png added

Enrique's gear icon

in reply to:  15 comment:16 by scythetwirler, 10 years ago

Replying to leper:

gamesetup.js:

  • L452: Could just be if(a && b) instead of if (a) if (b).
  • L903: The check for the automatically added " ($number)" string is a hack. (Having a player with a nick with a "(" in it will break it)
  • L1254 and L1268: No need to add trailing whitespace.
  • L1562: Make it else if (a && b)
  • L1575: Same, also move the comment to a new line.
  • L1673: Use if(!a) continue.
  • L1695: Missing semicolon.

NetHost.h:

  • Why is it an i32?

NetServer.cpp:

  • L688: Useless braces.

Thanks for the review. These have been resolved.

Replying to leper:

  • Switch the parameters for ReadyPlayer().

I'm not sure what you mean? If you meant swapping the order, I just followed the same order AssignPlayer had.

comment:17 by scythetwirler, 10 years ago

On hold until #2482 is resolved.

comment:18 by scythetwirler, 10 years ago

Keywords: review removed

There's a bug I need to iron out.

comment:19 by scythetwirler, 10 years ago

Keywords: review added

Bug fixed and order of ReadyPlayer parameters swapped.

comment:20 by scythetwirler, 10 years ago

Any objections to committing?

by scythetwirler, 10 years ago

by scythetwirler, 10 years ago

Attachment: readyv5.patch added

Updated with i18n.

comment:21 by Josh, 10 years ago

I haven't gotten the patch working locally yet, but I can't tell how you are supposed to change your ready status from that screenshot?

comment:22 by scythetwirler, 10 years ago

That's from the host's point of view; from a client's perspective, the start game button switches between "I'm ready!" and "I'm not ready".

comment:23 by Josh, 10 years ago

Hmm, I thought we were going for something similar to that checkbox-style system you showed earlier, but I guess this could work.

Also please remove the asterisk before the ready messages. It's inconsistent on the gamesetup screen.

Another thing that wasn't caused by your patch, but could you colorize the other uses of the player name on the gamesetup screen? (for example the player leave/join messages in your screenshot)

comment:24 by scythetwirler, 10 years ago

Resolution: fixed
Status: assignedclosed

In 15006:

Implements ready status into gamesetup. Fixes #2447.

comment:25 by scythetwirler, 10 years ago

Keywords: review removed

comment:26 by scythetwirler, 10 years ago

In 15033:

Don't display I'm ready in single player setup. Refs #2447.

comment:27 by elexis, 7 years ago

In 19396:

Update ready state immediately when receiving the message.

Differential Revision: https://code.wildfiregames.com/D304
Reviewed By: Vladislav
Refs #2447

Note: See TracTickets for help on using tickets.