Exemplo n.º 1
0
Arquivo: main.py Projeto: h4ck1t/PitE
# from source import server
import server

if __name__ == "__main__":
    host = 'localhost'
    port = 50001
    data_size = 1024
    server = server.GameServer(host, port, data_size)
    server.handle_connection()
Exemplo n.º 2
0
LOG = logging.getLogger()

if __name__ == "__main__":
    # Create ui
    ui = gui.MainWindow()
    # Set icon
    # https://cdn2.iconfinder.com/data/icons/games-and-sports-vol-2/32/Game_sports_calculate_counting_crosswords_numbers_sudoku-512.png
    #ui.tk.call('wm',
    #            'iconphoto',
    #            ui._w,
    #            Image("photo", file="icon.png"))
    # Create game
    game = s.Game()

    # Pre-set server with game
    server = s.GameServer(game)

    # Create client
    # TODO: remove syncIO dependency for GUI
    sync_io = SyncConsoleAppenderRawInputReader()
    client = c.Client(sync_io)

    # Set UI for client
    client.set_gui(ui)
    ui.set_client(client)

    # Give to UI possibility to host a server
    ui.set_server(server)
    # Start the app
    ui.mainloop()
Exemplo n.º 3
0
import os
import sys
import tornado.web
import tornado.websocket
import tornado.ioloop
import json
import random
import server
from message import *

server_name = ["Wahaha", "Gahaha", "Papapa", "Wuwuwu", "Yinyinyin"]
ws_host = 'localhost:7777'

ioloop = tornado.ioloop.IOLoop.instance()
server = server.GameServer(ioloop, 5)


class IndexHandler(tornado.web.RequestHandler):
    def get(self):
        self.render("index.html", rooms=server.get_room_list())


class GameHandler(tornado.web.RequestHandler):
    def post(self, room_id):
        username = self.get_argument("username")
        self.render("panel.html",
                    room_id=room_id,
                    username=username,
                    host=ws_host)
Exemplo n.º 4
0
#!/usr/bin/python3

import server

if __name__ == '__main__':
    s = server.GameServer()
    s.start()
Exemplo n.º 5
0
def main():

    game_server = server.GameServer()
    game_server.start()