Server should ignore showDebugMessage

This commit is contained in:
Et0h 2014-11-02 11:08:56 +00:00
parent 1b3e370d6d
commit f1fbd18068

View File

@ -30,7 +30,7 @@ class JSONCommandProtocol(LineReceiver):
if not line:
return
try:
self._client.ui.showDebugMessage("client/server << {}".format(line))
self.showDebugMessage("client/server << {}".format(line))
messages = json.loads(line)
except:
self.dropWithError(getMessage("not-json-server-error").format(line))
@ -40,7 +40,7 @@ class JSONCommandProtocol(LineReceiver):
def sendMessage(self, dict_):
line = json.dumps(dict_)
self.sendLine(line)
self._client.ui.showDebugMessage("client/server >> {}".format(line))
self.showDebugMessage("client/server >> {}".format(line))
def drop(self):
self.transport.loseConnection()
@ -57,6 +57,9 @@ class SyncClientProtocol(JSONCommandProtocol):
self.logged = False
self._pingService = PingService()
def showDebugMessage(self, line):
self._client.ui.showDebugMessage(line)
def connectionMade(self):
self._client.initProtocol(self)
self.sendHello()
@ -243,6 +246,9 @@ class SyncServerProtocol(JSONCommandProtocol):
return f(self, *args, **kwds)
return wrapper
def showDebugMessage(self, line):
pass
def dropWithError(self, error):
print getMessage("client-drop-server-error").format(self.transport.getPeer().host, error)
self.sendError(error)