widelands-dev team mailing list archive
-
widelands-dev team
-
Mailing list archive
-
Message #03516
[Merge] lp:~widelands-dev/widelands/remove_hosting_limitation into lp:widelands
SirVer has proposed merging lp:~widelands-dev/widelands/remove_hosting_limitation into lp:widelands.
Requested reviews:
Widelands Developers (widelands-dev)
Related bugs:
Bug #1413331 in widelands: "Remove arbitrary limitation of players in games"
https://bugs.launchpad.net/widelands/+bug/1413331
For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/remove_hosting_limitation/+merge/247221
Remove arbitrary limitations for players/observers in games.
--
Your team Widelands Developers is requested to review the proposed merge of lp:~widelands-dev/widelands/remove_hosting_limitation into lp:widelands.
=== modified file 'src/network/internet_gaming.cc'
--- src/network/internet_gaming.cc 2014-11-11 10:47:56 +0000
+++ src/network/internet_gaming.cc 2015-01-21 20:59:32 +0000
@@ -42,7 +42,6 @@
m_reg (false),
m_port (INTERNET_GAMING_PORT),
m_clientrights (INTERNET_CLIENT_UNREGISTERED),
- m_maxclients (1),
m_gameip (""),
clientupdateonmetaserver (true),
gameupdateonmetaserver (true),
@@ -72,7 +71,6 @@
m_port = INTERNET_GAMING_PORT;
m_clientname = "";
m_clientrights = INTERNET_CLIENT_UNREGISTERED;
- m_maxclients = 1;
m_gamename = "";
m_gameip = "";
clientupdateonmetaserver = true;
@@ -656,7 +654,7 @@
SendPacket s;
s.string(IGPCMD_GAME_OPEN);
s.string(m_gamename);
- s.string(boost::lexical_cast<std::string>(m_maxclients));
+ s.string("1024"); // Used to be maxclients, no longer used.
s.send(m_sock);
dedicatedlog("InternetGaming: Client opened a game with the name %s.\n", m_gamename.c_str());
m_state = IN_GAME;
=== modified file 'src/network/internet_gaming.h'
--- src/network/internet_gaming.h 2014-09-20 09:37:47 +0000
+++ src/network/internet_gaming.h 2015-01-21 20:59:32 +0000
@@ -90,16 +90,9 @@
bool update_for_clients();
const std::vector<InternetClient> & clients();
- /// \returns the maximum allowed number of clients in a game (players + spectators)
- uint32_t max_clients() {return INTERNET_GAMING_MAX_CLIENTS_PER_GAME;}
-
- /// sets the maximum number of players that may be in the game
- void set_local_maxclients(uint32_t mp) {m_maxclients = mp;}
-
/// sets the name of the local server as shown in the games list
void set_local_servername(const std::string & name) {m_gamename = name;}
-
/// \returns the name of the local server
std::string & get_local_servername() {return m_gamename;}
@@ -173,7 +166,6 @@
/// informations of the clients game
std::string m_gamename;
- uint32_t m_maxclients;
std::string m_gameip;
/// Metaserver informations
=== modified file 'src/network/internet_gaming_protocol.h'
--- src/network/internet_gaming_protocol.h 2014-09-20 09:37:47 +0000
+++ src/network/internet_gaming_protocol.h 2015-01-21 20:59:32 +0000
@@ -69,15 +69,6 @@
static const std::string INTERNET_GAMING_METASERVER = "widelands.org";
#define INTERNET_GAMING_PORT 7395
-
-/// The maximum number of clients (players + spectators) per game
-#define INTERNET_GAMING_MAX_CLIENTS_PER_GAME 32
-
-
-
-
-
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* CLIENT RIGHTS *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
@@ -87,10 +78,6 @@
static const std::string INTERNET_CLIENT_SUPERUSER = "SUPERUSER";
static const std::string INTERNET_CLIENT_BOT = "BOT";
-
-
-
-
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* COMMUNICATION PROTOCOL BETWEEN CLIENT AND METASERVER *
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
=== modified file 'src/ui_fsmenu/internet_lobby.cc'
--- src/ui_fsmenu/internet_lobby.cc 2014-12-06 12:22:35 +0000
+++ src/ui_fsmenu/internet_lobby.cc 2015-01-21 20:59:32 +0000
@@ -65,16 +65,6 @@
(this,
get_w() * 17 / 25, get_h() * 63 / 100,
_("Name of your server:")),
- m_maxclients
- (this,
- get_w() * 17 / 25, get_h() * 73 / 100,
- _("Maximum of players:")),
-
-// Spinboxes
- maxclients
- (this,
- get_w() * 17 / 25, get_h() * 77 / 100, m_butw, m_buth * 7 / 10,
- 7, 1, 7), // start/min./max. value dummy initializations
// Buttons
joingame
@@ -140,8 +130,6 @@
m_opengames .set_font(m_fn, m_fs, UI_FONT_CLR_FG);
m_clients .set_font(m_fn, m_fs, UI_FONT_CLR_FG);
m_servername.set_font(m_fn, m_fs, UI_FONT_CLR_FG);
- m_maxclients.set_font(m_fn, m_fs, UI_FONT_CLR_FG);
- maxclients .set_font(m_fn, m_fs, UI_FONT_CLR_FG);
std::string server = s.get_string("servername", "");
servername .set_text (server);
servername .changed.connect
@@ -212,12 +200,7 @@
const std::string & metaserver = s.get_string("metaserver", INTERNET_GAMING_METASERVER.c_str());
uint32_t port = s.get_natural("metaserverport", INTERNET_GAMING_PORT);
-
- if (InternetGaming::ref().login(nickname, password, reg, metaserver, port))
- {
- // Update of server spinbox
- maxclients.set_interval(1, InternetGaming::ref().max_clients());
- }
+ InternetGaming::ref().login(nickname, password, reg, metaserver, port);
}
@@ -447,8 +430,6 @@
// Set up the game
InternetGaming::ref().set_local_servername(servername.text());
- uint32_t max = static_cast<uint32_t>(get_maxclients());
- InternetGaming::ref().set_local_maxclients(max);
// Start the game
NetHost netgame(InternetGaming::ref().get_local_clientname(), true);
=== modified file 'src/ui_fsmenu/internet_lobby.h'
--- src/ui_fsmenu/internet_lobby.h 2014-11-13 08:39:14 +0000
+++ src/ui_fsmenu/internet_lobby.h 2015-01-21 20:59:32 +0000
@@ -41,11 +41,6 @@
void think() override;
- /// \returns the maximum number of clients that may connect
- int32_t get_maxclients() {
- return maxclients.get_value();
- }
-
private:
uint32_t m_butx;
uint32_t m_butw;
@@ -56,8 +51,6 @@
std::string m_fn;
UI::Textarea title, m_clients, m_opengames;
UI::Textarea m_servername;
- UI::Textarea m_maxclients;
- UI::SpinBox maxclients;
UI::Button joingame, hostgame, back;
UI::EditBox servername;
UI::Table<const InternetClient * const> clientsonline;
=== modified file 'src/wlapplication.cc'
--- src/wlapplication.cc 2015-01-14 06:56:13 +0000
+++ src/wlapplication.cc 2015-01-21 20:59:32 +0000
@@ -385,7 +385,6 @@
const std::string & server = s.get_string ("servername", name.c_str());
const bool registered = s.get_bool ("registered", false);
const std::string & pwd = s.get_string ("password", "");
- uint32_t maxcl = s.get_natural("maxclients", 8);
for (;;) { // endless loop
if (!InternetGaming::ref().login(name, pwd, registered, meta, port)) {
dedicatedlog("ERROR: Could not connect to metaserver (reason above)!\n");
@@ -405,7 +404,6 @@
}
InternetGaming::ref().set_local_servername(realservername);
- InternetGaming::ref().set_local_maxclients(maxcl);
NetHost netgame(name, true);
Follow ups