本文整理汇总了Python中client.core.Executive.call方法的典型用法代码示例。如果您正苦于以下问题:Python Executive.call方法的具体用法?Python Executive.call怎么用?Python Executive.call使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类client.core.Executive
的用法示例。
在下文中一共展示了Executive.call方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: on_item_dblclick
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
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)
示例2: __init__
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
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)
示例3: on_click
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
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: on_enter
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
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)
示例5: func
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
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, [])
示例6: __init__
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
def __init__(self, *args, **kwargs):
Screen.__init__(self, *args, **kwargs)
self.bg = common_res.bg_gamehall.get()
self.gamelist = self.GameList(self)
chat = self.chat_box = GameHallScreen.ChatBox(parent=self)
chat.text = u"您现在处于游戏大厅!\n"
self.playerlist = GameHallScreen.OnlineUsers(parent=self)
self.noticebox = GameHallScreen.NoticeBox(parent=self)
self.statusbox = GameHallScreen.StatusBox(parent=self)
VolumeTuner(parent=self, x=850, y=660)
b = Button(parent=self, x=750, y=660, width=80, height=35, color=Colors.orange, caption=u"卡牌查看器")
@b.event
def on_click():
openurl("http://thb.io")
Executive.call("get_hallinfo", ui_message, None)
示例7: do_connect
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
def do_connect(self, addr):
for b in self.buttons:
b.state = Button.DISABLED
Executive.call('connect_server', ui_message, addr, ui_message)
示例8: do_connect
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
def do_connect(self, addr):
Executive.call("connect_server", ui_message, addr, ui_message)
示例9: on_confirm
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
def on_confirm(val):
val and Executive.call("auth", ui_message, ["-1", "guest"])
示例10: on_click
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
def on_click():
Executive.call("quick_start_game", ui_message, "THBattle")
示例11: on_confirm
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
def on_confirm(val):
if val:
Executive.call('exit_game', ui_message, [])
示例12: int
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
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")
示例13: int
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
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')
示例14: do_login
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
def do_login(self):
u, pwd = self.txt_username.text, self.txt_pwd.text
Executive.call('auth', ui_message, [u, pwd])
示例15: start_ui
# 需要导入模块: from client.core import Executive [as 别名]
# 或者: from client.core.Executive import call [as 别名]
def start_ui():
# ATI workarounds
import pyglet
from pyglet import gl
@hook(gl)
def glDrawArrays(ori, *a, **k):
from pyglet.gl import glBegin, glEnd, GL_QUADS
glBegin(GL_QUADS)
glEnd()
return ori(*a, **k)
# ---------------
from client.ui.base import init_gui, ui_schedule, ui_message
init_gui()
# This forces all game resources to initialize,
# else they will be imported firstly by GameManager,
# then resources will be loaded at a different thread,
# resulting white planes.
# UPDATE: no more threading now, but retain notice above.
from client.ui.resource import resource
import gamepack
gamepack.init_ui_resources()
from client.ui.resloader import Resource
Resource.load_resources()
from client.ui.base.baseclasses import main_window
main_window.set_icon(resource.icon)
main_window.set_visible(True)
# custom errcheck
import pyglet.gl.lib as gllib
orig_errcheck = gllib.errcheck
import ctypes
def my_errcheck(result, func, arguments):
from pyglet import gl
error = gl.glGetError()
if error and error != 1286:
# HACK: The 1286(INVALID_FRAMEBUFFER_OPERATION) error again!
# This time I DIDN'T EVEN USE FBO! ATI!!
msg = ctypes.cast(gl.gluErrorString(error), ctypes.c_char_p).value
raise gl.GLException((error, msg))
return result
gllib.errcheck = my_errcheck
# ------------------------------------
from screens import UpdateScreen, ServerSelectScreen
us = UpdateScreen()
us.switch()
from client.core import Executive
sss = ServerSelectScreen()
errmsgs = {
'update_disabled': u'自动更新已被禁止',
'error': u'更新过程出现错误,您可能无法正常进行游戏!',
}
def display_box(msg):
from client.ui.controls import ConfirmBox
b = ConfirmBox(msg, parent=us)
@b.event
def on_confirm(val):
sss.switch()
def update_callback(msg):
# executes in logic thread
# well, intented to be
# ui and logic now run in the same thread.
from options import options
if msg == 'up2date':
ui_schedule(sss.switch)
elif msg == 'update_disabled' and options.fastjoin:
import gevent
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, [])
gevent.spawn(func)
elif msg in errmsgs:
ui_schedule(display_box, errmsgs[msg])
else:
os.execv(sys.executable, [sys.executable] + sys.argv)
#.........这里部分代码省略.........