예제 #1
0
def send_figure_change(old_figure_type, new_figure_type):
    storage.gameload('figure-unselect', {
        'figure': old_figure_type,
    })
    storage.gameload('figure-select', {
        'figure': new_figure_type,
    })
예제 #2
0
def send_step(i, j, order_data):
    storage.gameload(
        'step',
        {
            'i': i,
            'j': j,
            # 'id': autosend,
            'skin': order_data['skin'],
        })
예제 #3
0
def start_server(callback):
    storage.run_server()
    res = storage.gameload('wait', {
        'host': storage.server_url,
        'level': storage.level,
    })
    if res['status'] == 'Connected':
        print(storage)
        storage.swap['session_id'] = res['session_id']
        storage.swap['field'] = res['field']
        storage.swap['players'] = res['players']

    callback.Call(res)
예제 #4
0
def get_field_skin(callback):
    res = storage.gameload('get-field-skin', {})
    callback.Call(res['skin'])
예제 #5
0
def send_disconnect():
    storage.gameload('disconnect', {})
    storage.connection_process.terminate()
예제 #6
0
def send_unready():
    storage.gameload('unready', {})
예제 #7
0
def send_ready():
    storage.gameload('ready', {})
예제 #8
0
def send_figure_unselect(figure_type):
    storage.gameload('figure-unselect', {
        'figure': figure_type,
    })
예제 #9
0
def get_connections_state(callback):
    res = storage.gameload('get-connections-state', {})
    callback.Call(res)
예제 #10
0
def stop_server():
    storage.gameload('unwait', {})
    storage.stop_server()