Beispiel #1
0
import plugins
import packetFactory
import data.clients
import data.players

from PSO2DataTools import replace_irc_with_pso2, replace_pso2_with_irc
from config import YAMLConfig
import config
from commands import Command

ircSettings = YAMLConfig(
    "cfg/gchat-irc.config.yml", {
        'enabled': False,
        'nick': "PSO2IRCBot",
        'server': '',
        'port': 6667,
        'channel': "",
        'output': True,
        'autoexec': []
    }, True)

ircMode = ircSettings.get_key('enabled')
ircOutput = ircSettings.get_key('output')
ircNick = ircSettings.get_key('nick')
ircServer = (ircSettings.get_key('server'), ircSettings.get_key('port'))
ircChannel = ircSettings.get_key('channel')

gchatSettings = YAMLConfig("cfg/gchat.config.yml", {
    'displayMode': 0,
    'prefix': ''
}, True)
Beispiel #2
0
import commands
from config import YAMLConfig
import json
import os
import packetFactory
from packetFactory import SystemMessagePacket
import plugins
whitelist = []

ircSettings = YAMLConfig("cfg/pso2proxy.whitelist.config.yml",
                         {'enabled': True}, True)

whitelistmode = ircSettings.get_key('enabled')


@plugins.on_start_hook
def load_whitelist():
    global whitelist
    if not os.path.exists("cfg/pso2proxy.whitelist.json"):
        f = open("cfg/pso2proxy.whitelist.json", "w")
        f.write(json.dumps(whitelist))
        f.close()
        print('[Whitelist] Blank whitelist created.')
    else:
        f = open("cfg/pso2proxy.whitelist.json", "r")
        whitelist = json.loads(f.read())
        f.close()
        print("[Whitelist] Loaded %i whitelisted SEGA IDs." % len(whitelist))


def save_whitelist():
Beispiel #3
0
import plugins
import packetFactory
import data.clients
import data.players

from PSO2DataTools import replace_irc_with_pso2, replace_pso2_with_irc
from config import YAMLConfig
import config
from commands import Command

ircSettings = YAMLConfig("cfg/gchat-irc.config.yml",
                         {'enabled': False, 'nick': "PSO2IRCBot", 'server': '', 'port': 6667, 'channel': "", 'output': True, 'autoexec': []}, True)

ircMode = ircSettings.get_key('enabled')
ircOutput = ircSettings.get_key('output')
ircNick = ircSettings.get_key('nick')
ircServer = (ircSettings.get_key('server'), ircSettings.get_key('port'))
ircChannel = ircSettings.get_key('channel')

gchatSettings = YAMLConfig("cfg/gchat.config.yml", {'displayMode': 0, 'bubblePrefix': '', 'systemPrefix': '{whi}', 'prefix': ''}, True)

if ircMode:
    from twisted.words.protocols import irc
    from twisted.internet import reactor, protocol
    ircBot = None

    # noinspection PyUnresolvedReferences
    class GChatIRC(irc.IRCClient):
        currentPid = 0
        userIds = {}
Beispiel #4
0
import commands
from config import YAMLConfig
import data.clients
import packetFactory
from PSO2DataTools import check_pso2_with_irc
from PSO2DataTools import split_cmd_msg
import struct
import time
from twisted.internet import threads
from unicodescript import script

import plugins as p

plugin_config = YAMLConfig("cfg/translator.config.yml", {
    "translationService": 0,
    "msTranslateID": '',
    "msTranslateSecret": ''
})
if plugin_config['translationService'] == 1 and plugin_config[
        'msTranslateID'] != '' and plugin_config['msTranslateSecret'] != '':
    import microsofttranslator
    provider = "Bing"
    translator = microsofttranslator.Translator(
        plugin_config['msTranslateID'], plugin_config['msTranslateSecret'])
    lastKeyTime = time.time()
else:
    import goslate
    provider = "Google"
    translator = goslate.Goslate()