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, })
def send_step(i, j, order_data): storage.gameload( 'step', { 'i': i, 'j': j, # 'id': autosend, 'skin': order_data['skin'], })
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)
def get_field_skin(callback): res = storage.gameload('get-field-skin', {}) callback.Call(res['skin'])
def send_disconnect(): storage.gameload('disconnect', {}) storage.connection_process.terminate()
def send_unready(): storage.gameload('unready', {})
def send_ready(): storage.gameload('ready', {})
def send_figure_unselect(figure_type): storage.gameload('figure-unselect', { 'figure': figure_type, })
def get_connections_state(callback): res = storage.gameload('get-connections-state', {}) callback.Call(res)
def stop_server(): storage.gameload('unwait', {}) storage.stop_server()