Enable chat by default

This commit is contained in:
Et0h 2016-07-04 00:09:36 +01:00
parent 23c1496ce4
commit bc07383d13
6 changed files with 9 additions and 9 deletions

View File

@ -379,7 +379,7 @@ de = {
"server-salt-argument" : u"zufällige Zeichenkette, die zur Erstellung von Passwörtern verwendet wird",
"server-disable-ready-argument" : u"Bereitschaftsfeature deaktivieren",
"server-motd-argument": u"Pfad zur Datei, von der die Nachricht des Tages geladen wird",
"server-chat-argument" : "Should chat be enabled?", # TODO: Translate
"server-chat-argument" : "Should chat be disabled?", # TODO: Translate
"server-messed-up-motd-unescaped-placeholders": u"Die Nachricht des Tages hat unmaskierte Platzhalter. Alle $-Zeichen sollten verdoppelt werden ($$).",
"server-messed-up-motd-too-long": u"Die Nachricht des Tages ist zu lang - Maximal {} Zeichen, aktuell {}.",

View File

@ -380,7 +380,7 @@ en = {
"server-salt-argument" : "random string used to generate managed room passwords",
"server-disable-ready-argument" : u"disable readiness feature",
"server-motd-argument": "path to file from which motd will be fetched",
"server-chat-argument" : "Should chat be enabled?",
"server-chat-argument" : "Should chat be disabled?",
"server-messed-up-motd-unescaped-placeholders": "Message of the Day has unescaped placeholders. All $ signs should be doubled ($$).",
"server-messed-up-motd-too-long": u"Message of the Day is too long - maximum of {} chars, {} given.",

View File

@ -379,7 +379,7 @@ ru = {
"server-salt-argument" : u"генерировать пароли к управляемым комнатам на основании указанной строки (соли)",
"server-disable-ready-argument" : u"отключить статусы готов/не готов",
"server-motd-argument" : u"путь к файлу, из которого будет извлекаться MOTD-сообщение",
"server-chat-argument" : "Should chat be enabled?", # TODO: Translate
"server-chat-argument" : "Should chat be disabled?", # TODO: Translate
"server-messed-up-motd-unescaped-placeholders" : u"MOTD-сообщение содержит неэкранированные спец.символы. Все знаки $ должны быть продублированы ($$).",
"server-messed-up-motd-too-long" : u"MOTD-сообщение слишком длинное: максимальная длина - {} символ(ов), текущая длина - {} символ(ов).",

View File

@ -355,7 +355,7 @@ class SyncServerProtocol(JSONCommandProtocol):
self._logged = True
self.sendHello(version)
def handleChat(self,chatMessage):
if self._factory.chat:
if not self._factory.disableChat:
self._factory.sendChat(self._watcher,chatMessage)
def setWatcher(self, watcher):

View File

@ -14,7 +14,7 @@ import argparse
from syncplay.utils import RoomPasswordProvider, NotControlledRoom, RandomStringGenerator, meetsMinVersion
class SyncFactory(Factory):
def __init__(self, password='', motdFilePath=None, isolateRooms=False, salt=None, disableReady=False,chat =False):
def __init__(self, password='', motdFilePath=None, isolateRooms=False, salt=None, disableReady=False,disableChat=False):
self.isolateRooms = isolateRooms
print getMessage("welcome-server-notification").format(syncplay.version)
if password:
@ -26,7 +26,7 @@ class SyncFactory(Factory):
self._salt = salt
self._motdFilePath = motdFilePath
self.disableReady = disableReady
self.chat=chat
self.disableChat = disableChat
if not isolateRooms:
self._roomManager = RoomManager()
else:
@ -47,7 +47,7 @@ class SyncFactory(Factory):
features["isolateRooms"] = self.isolateRooms
features["readiness"] = not self.disableReady
features["managedRooms"] = True
features["chat"] = self.chat
features["chat"] = not self.disableChat
return features
def getMotd(self, userIp, username, room, clientVersion):
@ -524,6 +524,6 @@ class ConfigurationGetter(object):
self._argparser.add_argument('--password', metavar='password', type=str, nargs='?', help=getMessage("server-password-argument"))
self._argparser.add_argument('--isolate-rooms', action='store_true', help=getMessage("server-isolate-room-argument"))
self._argparser.add_argument('--disable-ready', action='store_true', help=getMessage("server-disable-ready-argument"))
self._argparser.add_argument('--chat', action='store_true', help=getMessage("server-chat-argument"))
self._argparser.add_argument('--disable-chat', action='store_true', help=getMessage("server-chat-argument"))
self._argparser.add_argument('--salt', metavar='salt', type=str, nargs='?', help=getMessage("server-salt-argument"))
self._argparser.add_argument('--motd-file', metavar='file', type=str, nargs='?', help=getMessage("server-motd-argument"))

View File

@ -19,5 +19,5 @@ from syncplay.server import SyncFactory, ConfigurationGetter
if __name__ == '__main__':
argsGetter = ConfigurationGetter()
args = argsGetter.getConfiguration()
reactor.listenTCP(int(args.port), SyncFactory(args.password, args.motd_file, args.isolate_rooms, args.salt, args.disable_ready,args.chat))
reactor.listenTCP(int(args.port), SyncFactory(args.password, args.motd_file, args.isolate_rooms, args.salt, args.disable_ready,args.disable_chat))
reactor.run()