- Register HWTeam metatype so HWTeam objects could be passed via queued connections
authorunc0rr
Mon, 20 Feb 2012 21:52:18 +0400
changeset 6721 7dbf8a0c1f5d
parent 6720 84261c3408a6
child 6722 e3a35bc838fb
- Register HWTeam metatype so HWTeam objects could be passed via queued connections - A bit more verbose server message about unknown protocol command
QTfrontend/main.cpp
gameServer/HWProtoInRoomState.hs
--- a/QTfrontend/main.cpp	Mon Feb 20 20:33:26 2012 +0400
+++ b/QTfrontend/main.cpp	Mon Feb 20 21:52:18 2012 +0400
@@ -30,6 +30,7 @@
 
 #include "hwform.h"
 #include "hwconsts.h"
+#include "newnetclient.h"
 
 #include "HWDataManager.h"
 
@@ -151,6 +152,8 @@
 
     Q_INIT_RESOURCE(hedgewars);
 
+    qRegisterMetaType<HWTeam>("HWTeam");
+
     bindir->cd("bin"); // workaround over NSIS installer
 
     if(cConfigDir->length() == 0)
--- a/gameServer/HWProtoInRoomState.hs	Mon Feb 20 20:33:26 2012 +0400
+++ b/gameServer/HWProtoInRoomState.hs	Mon Feb 20 21:52:18 2012 +0400
@@ -286,4 +286,6 @@
     where
         engineMsg cl = toEngineMsg $ B.concat ["b", nick cl, "(team): ", msg, "\x20\x20"]
 
-handleCmd_inRoom _ = return [ProtocolError "Incorrect command (state: in room)"]
+handleCmd_inRoom (s:_) = return [ProtocolError $ "Incorrect command '" `B.append` s `B.append` "' (state: in room)"]
+
+handleCmd_inRoom [] = return [ProtocolError "Empty command (state: in room)"]