Пример #1
0
    def publish(self, nodes=None):
        if nodes is not None:
            self.set_node_data(nodes)

        if not self.code:
            m = ui.Menu.notice('No writable nodes found.')
            m.run()
            return

        saved = self.save(suppress=True)
        if not saved:
            m = ui.Menu.notice('An error occurred while saving.')
            m.run()
            return

        if not is_valid_code(self.code):
            m = ui.Menu.notice('Error: invalid code.')
            m.run()
            return

        passed = tester.run_tester(self)
        if not passed:
            return

        import save
        s = save.get_save()
        s, e = s.publish_card(self)
        self.set_lines(s, e)

        self.published = True
        self.save(suppress=True)

        m = ui.Menu.notice('Card has been published successfully!')
        m.run()
Пример #2
0
def init():
    tester.init()
    node_data.init()
    globals()['SAVE'] = save.get_save()
Пример #3
0
def init():
    globals()['SAVE'] = save.get_save()
    globals()['CUSTOMSHEET'] = Customsheet()
Пример #4
0
def init():
    globals()['SAVE'] = save.get_save()
    game.init()
    spritesheet.init()
    client.init()
Пример #5
0
def init():
    globals()['SAVE'] = save.get_save()
Пример #6
0
def init():
    globals()['SAVE'] = save.get_save()
    globals()['SPRITESHEET'] = Spritesheet()
Пример #7
0
import socket
import json
import os
import time
from _thread import start_new_thread

import game
import save
import exceptions

save.init()
game.init()
SAVE = save.get_save()

confirmation_code = 'thisisthecardgameserver'


def get_port():
    try:
        port = SAVE.get_data('port')
    except:
        port = 5555

    return port


def get_local_ip():
    s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
    s.connect(('8.8.8.8', 80))
    local_ip = s.getsockname()[0]
    s.close()
Пример #8
0
def init():
    globals()['SAVE'] = save.get_save()
    globals()['IMAGE_HANDLER'] = image_handler.get_image_handler()
    globals()['SPRITESHEET'] = spritesheet.get_sheet()
    globals()['CUSTOMSHEET'] = customsheet.get_sheet()
Пример #9
0
def init():
    globals()['SAVE'] = save.get_save()
    node_editor.init()