本文整理汇总了Python中client.core.Executive类的典型用法代码示例。如果您正苦于以下问题:Python Executive类的具体用法?Python Executive怎么用?Python Executive使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Executive类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: __init__
def __init__(self, game_id, *a, **k):
Panel.__init__(
self, width=550, height=340,
zindex=10000,
*a, **k
)
self.game_id = game_id
self.x = (self.overlay.width - 550) // 2
self.y = (self.overlay.height - 340) // 2
self.btncancel = btncancel = Button(
u'取消', parent=self, x=440, y=25, width=90, height=40
)
self.labels = pyglet.graphics.Batch()
Label(
u'旁观游戏', font_size=12, x=275, y=306,
anchor_x='center', anchor_y='bottom',
color=Colors.green.heavy + (255, ),
shadow=(2, 207, 240, 156, 204),
batch=self.labels,
)
@btncancel.event
def on_click():
self.delete()
Executive.call('query_gameinfo', ui_message, game_id)
示例2: on_item_dblclick
def on_item_dblclick(li):
# TODO:
if li.started:
#Executive.call('observe_user', ui_message, li.game_id)
self.ObserveGamePanel(li.game_id, parent=self.overlay)
else:
Executive.call('join_game', ui_message, li.game_id)
示例3: on_click
def on_click():
if self.ready:
Executive.call('cancel_ready', ui_message, [])
self.ready = False
self.btn_getready.caption = u'准备'
self.btn_getready.update()
else:
Executive.call('get_ready', ui_message, [])
#self.btn_getready.state = Button.DISABLED
self.ready = True
self.btn_getready.caption = u'取消准备'
self.btn_getready.update()
示例4: func
def func():
from client.ui.soundmgr import SoundManager
SoundManager.mute()
gevent.sleep(0.3)
sss.switch()
gevent.sleep(0.3)
Executive.connect_server(("127.0.0.1", 9999), ui_message)
gevent.sleep(0.3)
Executive.auth(options.fastjoin, "feisuzhu")
gevent.sleep(0.3)
Executive.quick_start_game()
gevent.sleep(0.3)
Executive.use_ingame_item("imperial-id:boss")
gevent.sleep(0.3)
Executive.get_ready()
示例5: on_enter
def on_enter():
text = unicode(self.inputbox.text)
self.inputbox.text = u''
if not text: return
self.add_history(text)
if text.startswith(u'`') and len(text) > 1:
text = text[1:]
if not text: return
Executive.call('speaker', ui_message, text)
elif text.startswith(u'/'):
from . import commands
cmdline = shlex.split(text[1:])
msg = commands.process_command(cmdline)
msg and self.append(msg)
else:
Executive.call('chat', ui_message, text)
示例6: func
def func():
from client.ui.soundmgr import SoundManager
SoundManager.mute()
gevent.sleep(0.3)
sss.switch()
gevent.sleep(0.3)
Executive.connect_server(('127.0.0.1', 9999), ui_message)
gevent.sleep(0.3)
Executive.auth('Proton1', 'abcde')
gevent.sleep(0.3)
Executive.quick_start_game()
gevent.sleep(0.3)
Executive.get_ready()
示例7: func
def func():
from client.ui.soundmgr import SoundManager
SoundManager.mute()
gevent.sleep(0.3)
ui_schedule(sss.switch)
gevent.sleep(0.3)
Executive.call('connect_server', ui_message, ('127.0.0.1', 9999), ui_message)
gevent.sleep(0.3)
Executive.call('auth', ui_message, ['Proton1', 'abcde'])
gevent.sleep(0.3)
Executive.call('quick_start_game', ui_message, 'THBattle')
gevent.sleep(0.3)
Executive.call('get_ready', ui_message, [])
示例8: __init__
def __init__(self, parent):
Frame.__init__(self, x=750, y=20, width=240, height=180, caption=u"花果子念报", parent=parent)
ta = self.textarea = TextArea(parent=self, x=2, y=10 + 2, width=240 - 4, height=180 - 24 - 2 - 10)
ta.text = u"正在获取最新新闻……"
def update(rst):
if rst:
_, content = rst
try:
ta.text = content.decode("utf-8")
return
except Exception as e:
import traceback
traceback.print_exc(e)
ta.text = u"|R无法显示新闻!|r"
from settings import HALL_NOTICE_URL
Executive.call("fetch_resource", update, HALL_NOTICE_URL)
示例9: use
def use(sku):
from client.core.executive import Executive
Executive.use_ingame_item(sku)
示例10: item_use
def item_use(id):
from client.core.executive import Executive
Executive.item_use(id)
示例11: item_backpack
def item_backpack():
from client.core.executive import Executive
Executive.item_backpack()
示例12: item_lottery
def item_lottery(currency):
from client.core.executive import Executive
Executive.item_lottery(currency)
示例13: on_click
def on_click(s=s, uid=uid, un=uname):
Executive.call("invite_user", ui_message, uid)
self.overlay.chat_box.append(u"|R已经邀请了%s,请等待回应……|r\n" % un)
s.state = Button.DISABLED
示例14: on_confirm
def on_confirm(val):
if val:
Executive.call('exit_game', ui_message, [])
示例15: int
requests.post(
"http://www.thbattle.net/interconnect/crashreport",
data={"gameid": gameid, "active": int(active), "userid": userid, "username": username},
files={"file": content},
)
from client.ui.entry import start_ui
try:
start_ui()
except:
import pyglet
pyglet.app.exit()
if options.fastjoin:
import pdb
pdb.post_mortem()
Executive.call("app_exit")
log.error(u"游戏崩溃,正在报告bug,请稍等下……")
do_crashreport()
raise
Executive.call("app_exit")