mail[Wesnoth-commits] r24773 - in /trunk/src/server: game.cpp server.cpp


Others Months | Index by Date | Thread Index
>>   [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Header


Content

Posted by soliton . de on March 18, 2008 - 04:57:
Author: soliton
Date: Tue Mar 18 04:57:31 2008
New Revision: 24773

URL: http://svn.gna.org/viewcvs/wesnoth?rev=24773&view=rev
Log:
* add lobby chat logging back
* also allow /query status <ownnick> command

Modified:
    trunk/src/server/game.cpp
    trunk/src/server/server.cpp

Modified: trunk/src/server/game.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/game.cpp?rev=24773&r1=24772&r2=24773&view=diff
==============================================================================
--- trunk/src/server/game.cpp (original)
+++ trunk/src/server/game.cpp Tue Mar 18 04:57:31 2008
@@ -675,6 +675,15 @@
                t_string str(msg.begin(), msg.end());
                chat_message::truncate_message(str);
                message->set_attr_dup("message", str.c_str());
+       }
+       // Only log in the lobby_.
+       if (owner_ != 0) {
+       } else if (msg.size() >= 3 && simple_wml::string_span(msg.begin(), 3) 
== "/me") {
+               LOG_GAME << network::ip_address(user->first) << "\t<"
+                       << user->second.name() << 
simple_wml::string_span(msg.begin() + 3, msg.size() - 3) << ">\n";
+        } else {
+               LOG_GAME << network::ip_address(user->first) << "\t<"
+                       << user->second.name() << "> " << msg << "\n";
        }
 
        send_data(data, user->first);

Modified: trunk/src/server/server.cpp
URL: 
http://svn.gna.org/viewcvs/wesnoth/trunk/src/server/server.cpp?rev=24773&r1=24772&r2=24773&view=diff
==============================================================================
--- trunk/src/server/server.cpp (original)
+++ trunk/src/server/server.cpp Tue Mar 18 04:57:31 2008
@@ -751,7 +751,8 @@
                response << help_msg;
        } else if (command == "status") {
                response << process_command(command.to_string() + " " + 
pl->second.name());
-       } else if (command == "metrics" || command == "motd" || command == 
"wml") {
+       } else if (command == "status " + pl->second.name() || command == 
"metrics"
+       || command == "motd" || command == "wml") {
                response << process_command(command.to_string());
        } else if (command == admin_passwd_) {
                LOG_SERVER << "New Admin recognized:" << "\tIP: "
@@ -799,6 +800,7 @@
                                (*g)->send_server_message(parameters.c_str());
                        }
                }
+               LOG_SERVER << "<server> " + parameters + "\n";
                out << "message '" << parameters << "' relayed to players\n";
        } else if (command == "status") {
                out << "STATUS REPORT\n";




Related Messages


Powered by MHonArc, Updated Tue Mar 18 09:40:56 2008