Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-18 Thread GunChleoc
Review: Approve

I have found some things that still need fixing/improving - most of them on the 
server side. So, I have created a new Metaserver issue:

https://github.com/widelands/widelands_metaserver/issues/63

This branch can go in though :)
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-15 Thread Notabilis
Thanks for the reviews. A metaserver branch with the requested change is open 
at https://github.com/widelands/widelands_metaserver/pull/60 and already 
deployed for testing.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-14 Thread noreply
The proposal to merge lp:~widelands-dev/widelands/bug-1826744-lobby-commands 
into lp:widelands has been updated.

Status: Needs review => Merged

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
-- 
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-14 Thread Toni Förster
Review: Approve

I'm happy :)

@bunnybot merge
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-14 Thread GunChleoc
Yes it should. Are you happy with your testing otherwise?

If so, we should merge this so it will be easier for Notabilis to continue with 
the needed changes on the server.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-14 Thread Toni Förster
But I guess this should be solved on the server side...
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-08 Thread Toni Förster
Review: Approve

LGTM :)

But we need the server to be in place to test this better.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is subscribed to branch 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-05 Thread bunnybot
Continuous integration builds have changed state:

Travis build 5159. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/541867359.
Appveyor build 4941. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1826744_lobby_commands-4941.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-05 Thread Notabilis
Thanks for the reviews. The strings are fixed now. I also "added" the requested 
/ban command (actually, it will simply be forwarded to the metaserver).
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-04 Thread bunnybot
Continuous integration builds have changed state:

Travis build 5151. State: errored. Details: 
https://travis-ci.org/widelands/widelands/builds/541357325.
Appveyor build 4933. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1826744_lobby_commands-4933.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-04 Thread Notabilis
Ah, okay. Now it makes sense. :)
The /help command visible in the diff is within an if-block that only triggers 
for superusers.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-04 Thread Toni Förster
Sorry, I was under the impression that users could use the help command as well.

The it is just /announcement command that needs to be changed :)
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-04 Thread Notabilis
I can rename /announce, no problem. But what is /help supposed to do for normal 
users? They only have /me as a "command". And the /help command for superusers 
is already part of this branch, or do you want something different there?
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-03 Thread bunnybot
Continuous integration builds have changed state:

Travis build 5145. State: passed. Details: 
https://travis-ci.org/widelands/widelands/builds/540930580.
Appveyor build 4927. State: failed. Details: 
https://ci.appveyor.com/project/widelands-dev/widelands/build/_widelands_dev_widelands_bug_1826744_lobby_commands-4927.
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


Re: [Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-03 Thread Toni Förster
Could you change "/announcement" to "/announce"? That's the command for the 
multiplayer lobby.

Also, could you implement /help for the lobby (for users and superusers)?
-- 
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands.

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp


[Widelands-dev] [Merge] lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands

2019-06-03 Thread Notabilis
Notabilis has proposed merging 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands.

Commit message:
Adding support for /warn and /kick commands of superusers in the internet 
gaming lobby.

Requested reviews:
  Widelands Developers (widelands-dev)
Related bugs:
  Bug #1826744 in widelands: "Implement lobby commands"
  https://bugs.launchpad.net/widelands/+bug/1826744

For more details, see:
https://code.launchpad.net/~widelands-dev/widelands/bug-1826744-lobby-commands/+merge/368285

/warn is sending a system message to a single user.
/kick is banning the IP of the user for 24 hours to avoid immediate reconnects.
-- 
Your team Widelands Developers is requested to review the proposed merge of 
lp:~widelands-dev/widelands/bug-1826744-lobby-commands into lp:widelands.
=== modified file 'src/network/internet_gaming.cc'
--- src/network/internet_gaming.cc	2019-06-02 09:29:59 +
+++ src/network/internet_gaming.cc	2019-06-03 19:31:05 +
@@ -459,14 +459,15 @@
 			return;
 
 		} else if (cmd == IGPCMD_ERROR) {
-			std::string errortype = packet.string();
+			const std::string errortype = packet.string();
 			if (errortype != IGPCMD_LOGIN && errortype != IGPCMD_PWD_CHALLENGE) {
 log("InternetGaming: Strange ERROR in connecting state: %s\n", errortype.c_str());
 throw WLWarning(
    _("Mixed up"), _("The metaserver sent a strange ERROR during connection"));
 			}
 			// Clients login request got rejected
-			logout(packet.string());
+			const std::string message = packet.string();
+			logout(message);
 			set_error();
 			return;
 
@@ -682,6 +683,14 @@
 }
 			}
 
+			else if (subcmd == IGPCMD_CMD) {
+// Something went wrong with the command
+message += _("Command could not be executed.");
+message =
+   (boost::format("%s %s") % message % InternetGamingMessages::get_message(reason))
+	  .str();
+			}
+
 			else if (subcmd == IGPCMD_GAME_OPEN) {
 // Something went wrong with the newly opened game
 message = InternetGamingMessages::get_message(reason);
@@ -901,6 +910,15 @@
 		// beginning
 		// with a "/" - let's see...
 
+		if (msg == "/help") {
+			format_and_add_chat("", "", true, _("Supported admin commands:"));
+			format_and_add_chat("", "", true, _("/motd   sets a permanent greeting message"));
+			format_and_add_chat("", "", true, _("/announcement   send a one time system message"));
+			format_and_add_chat("", "", true, _("/warnsend a private system message to the given user"));
+			format_and_add_chat("", "", true, _("/kick   removes the given user or game from the metaserver"));
+			return;
+		}
+
 		// Split up in "cmd" "arg"
 		std::string cmd, arg;
 		std::string temp = msg.substr(1);  // cut off '/'
@@ -944,6 +962,15 @@
 			m.string(arg);
 			net->send(m);
 			return;
+		} else if (!arg.empty() && (cmd == "warn" || cmd == "kick")) {
+			// warn a user by sending a private system message or
+			// kick a user or game from the metaserver
+			SendPacket m;
+			m.string(IGPCMD_CMD);
+			m.string(cmd);
+			m.string(arg);
+			net->send(m);
+			return;
 		} else {
 			// let everything else pass
 			goto normal;

=== modified file 'src/network/internet_gaming_protocol.h'
--- src/network/internet_gaming_protocol.h	2019-06-01 16:31:13 +
+++ src/network/internet_gaming_protocol.h	2019-06-03 19:31:05 +
@@ -299,6 +299,15 @@
 static const std::string IGPCMD_CHAT = "CHAT";
 
 /**
+ * Sent by the client to issue a superuser command.
+ *
+ * The client sends this message to the metaserver with the following payload:
+ * \li string:the command
+ * \li string:arbitrary parameters.
+ */
+static const std::string IGPCMD_CMD = "CMD";
+
+/**
  * Sent by the metaserver to inform the client, that the list of games was changed. No payload is
  * sent,
  * as e.g. clients in a game are not really interested about other games and we want to keep traffic

___
Mailing list: https://launchpad.net/~widelands-dev
Post to : widelands-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~widelands-dev
More help   : https://help.launchpad.net/ListHelp