Exemplo n.º 1
0
 def onOpen(self):
     if debug:
         print("[Connection] Connection established!")
     self.block_chat = False  # It will block chat when question are shown
     self.chat = Chat()
     self.solver = Solver()
     """ Game Summary """
     self.gs_enable = readFromConfig("GameSummary", "enable")
     self.gs_prize = readFromConfig("GameSummary", "show_prize")
     self.gs_userids = readFromConfig("GameSummary", "show_userids")
     self.gs_usernames = readFromConfig("GameSummary", "show_usernames")
Exemplo n.º 2
0
 def onOpen(self):
     if debug:
         print("[Connection] Connection established!")
     self.block_chat = True  # It will block chat when question are shown
     self.chat = Chat()
     self.consume = Consumer()
     """ Broadcast Stats """
     self.bs_enable = readFromConfig("BroadcastStats", "enable")
     self.bs_connected = readFromConfig("BroadcastStats", "show_connected")
     self.bs_playing = readFromConfig("BroadcastStats", "show_playing")
     self.bs_eliminated = readFromConfig("BroadcastStats",
                                         "show_eliminated")
     """ Game Summary """
     self.gs_enable = readFromConfig("GameSummary", "enable")
     self.gs_prize = readFromConfig("GameSummary", "show_prize")
     self.gs_userids = readFromConfig("GameSummary", "show_userids")
     self.gs_usernames = readFromConfig("GameSummary", "show_usernames")
Exemplo n.º 3
0
 def __init__(self):
     self.api_shows = readFromConfig("API", "shows_now")
     self.debug = readFromConfig("General", "debug_mode")
     self.server_ip = readFromConfig("General", "server_ip")
Exemplo n.º 4
0
    def __init__(self):
        self.debug = readFromConfig("General", "debug_mode")
        self.google_api_key = readFromConfig("Solver", "google_api_key")
        self.google_cse_id = readFromConfig("Solver", "google_cse_id")
        self.show_advancing_players = readFromConfig("Solver",
                                                     "show_advancing_players")
        self.show_answers = readFromConfig("Solver", "show_answers")
        self.show_answerids = readFromConfig("Solver", "show_answerids")
        self.show_category = readFromConfig("Solver", "show_category")
        self.show_eliminated_players = readFromConfig(
            "Solver", "show_eliminated_players")
        self.show_summary = readFromConfig("Solver", "show_summary")
        self.show_players_answers = readFromConfig("Solver",
                                                   "show_players_answers")
        self.show_question = readFromConfig("Solver", "show_question")
        self.show_questionid = readFromConfig("Solver", "show_questionid")
        self.show_question_count = readFromConfig("Solver",
                                                  "show_question_count")
        self.show_question_number = readFromConfig("Solver",
                                                   "show_question_number")
        self.use_naive = readFromConfig("Solver", 'use_naive')
        self.use_google = readFromConfig("Solver", "use_google")
        self.use_wiki = readFromConfig("Solver", "use_wiki")

        if self.use_naive:
            self.naive = Naive(self.google_api_key, self.google_cse_id,
                               self.debug)
        if self.use_google:
            self.google = Google(self.debug)
        if self.use_wiki:
            self.wiki = Wikipedia(self.debug)
Exemplo n.º 5
0
import json
import sys

from chat import Chat
from config import readFromConfig
from dataclasses import Data
from consumer import Consumer

from autobahn.twisted.websocket import WebSocketClientFactory, WebSocketClientProtocol
from shutil import get_terminal_size
from twisted.internet.protocol import ReconnectingClientFactory

debug = readFromConfig("General", "debug_mode")


class GameProtocol(WebSocketClientProtocol):
    def onOpen(self):
        if debug:
            print("[Connection] Connection established!")
        self.block_chat = True  # It will block chat when question are shown
        self.chat = Chat()
        self.consume = Consumer()
        """ Broadcast Stats """
        self.bs_enable = readFromConfig("BroadcastStats", "enable")
        self.bs_connected = readFromConfig("BroadcastStats", "show_connected")
        self.bs_playing = readFromConfig("BroadcastStats", "show_playing")
        self.bs_eliminated = readFromConfig("BroadcastStats",
                                            "show_eliminated")
        """ Game Summary """
        self.gs_enable = readFromConfig("GameSummary", "enable")
        self.gs_prize = readFromConfig("GameSummary", "show_prize")
Exemplo n.º 6
0
 def __init__(self):
     self.debug = readFromConfig("General", "debug_mode")
     self.show_advancing_players = readFromConfig("Solver",
                                                  "show_advancing_players")
     self.show_answers = readFromConfig("Solver", "show_answers")
     self.show_answerids = readFromConfig("Solver", "show_answerids")
     self.show_category = readFromConfig("Solver", "show_category")
     self.show_eliminated_players = readFromConfig(
         "Solver", "show_eliminated_players")
     self.show_summary = readFromConfig("Solver", "show_summary")
     self.show_players_answers = readFromConfig("Solver",
                                                "show_players_answers")
     self.show_question = readFromConfig("Solver", "show_question")
     self.show_questionid = readFromConfig("Solver", "show_questionid")
     self.show_question_count = readFromConfig("Solver",
                                               "show_question_count")
     self.show_question_number = readFromConfig("Solver",
                                                "show_question_number")
Exemplo n.º 7
0
 def __init__(self):
     self.enable = readFromConfig("Chat", "enable")
     self.show_kicked = readFromConfig("Chat", "show_kicked")
     self.show_message = readFromConfig("Chat", "show_message")
     self.show_usernames = readFromConfig("Chat", "show_usernames")
     self.show_userids = readFromConfig("Chat", "show_userids")