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-salt-argument" : u"zufällige Zeichenkette, die zur Erstellung von Passwörtern verwendet wird",
"server-disable-ready-argument" : u"Bereitschaftsfeature deaktivieren", "server-disable-ready-argument" : u"Bereitschaftsfeature deaktivieren",
"server-motd-argument": u"Pfad zur Datei, von der die Nachricht des Tages geladen wird", "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-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 {}.", "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-salt-argument" : "random string used to generate managed room passwords",
"server-disable-ready-argument" : u"disable readiness feature", "server-disable-ready-argument" : u"disable readiness feature",
"server-motd-argument": "path to file from which motd will be fetched", "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-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.", "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-salt-argument" : u"генерировать пароли к управляемым комнатам на основании указанной строки (соли)",
"server-disable-ready-argument" : u"отключить статусы готов/не готов", "server-disable-ready-argument" : u"отключить статусы готов/не готов",
"server-motd-argument" : u"путь к файлу, из которого будет извлекаться MOTD-сообщение", "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-unescaped-placeholders" : u"MOTD-сообщение содержит неэкранированные спец.символы. Все знаки $ должны быть продублированы ($$).",
"server-messed-up-motd-too-long" : u"MOTD-сообщение слишком длинное: максимальная длина - {} символ(ов), текущая длина - {} символ(ов).", "server-messed-up-motd-too-long" : u"MOTD-сообщение слишком длинное: максимальная длина - {} символ(ов), текущая длина - {} символ(ов).",

View File

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

View File

@ -14,7 +14,7 @@ import argparse
from syncplay.utils import RoomPasswordProvider, NotControlledRoom, RandomStringGenerator, meetsMinVersion from syncplay.utils import RoomPasswordProvider, NotControlledRoom, RandomStringGenerator, meetsMinVersion
class SyncFactory(Factory): 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 self.isolateRooms = isolateRooms
print getMessage("welcome-server-notification").format(syncplay.version) print getMessage("welcome-server-notification").format(syncplay.version)
if password: if password:
@ -26,7 +26,7 @@ class SyncFactory(Factory):
self._salt = salt self._salt = salt
self._motdFilePath = motdFilePath self._motdFilePath = motdFilePath
self.disableReady = disableReady self.disableReady = disableReady
self.chat=chat self.disableChat = disableChat
if not isolateRooms: if not isolateRooms:
self._roomManager = RoomManager() self._roomManager = RoomManager()
else: else:
@ -47,7 +47,7 @@ class SyncFactory(Factory):
features["isolateRooms"] = self.isolateRooms features["isolateRooms"] = self.isolateRooms
features["readiness"] = not self.disableReady features["readiness"] = not self.disableReady
features["managedRooms"] = True features["managedRooms"] = True
features["chat"] = self.chat features["chat"] = not self.disableChat
return features return features
def getMotd(self, userIp, username, room, clientVersion): 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('--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('--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('--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('--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")) 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__': if __name__ == '__main__':
argsGetter = ConfigurationGetter() argsGetter = ConfigurationGetter()
args = argsGetter.getConfiguration() 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() reactor.run()