本文整理汇总了Python中panda3d.core.QueuedConnectionManager.startConnection方法的典型用法代码示例。如果您正苦于以下问题:Python QueuedConnectionManager.startConnection方法的具体用法?Python QueuedConnectionManager.startConnection怎么用?Python QueuedConnectionManager.startConnection使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类panda3d.core.QueuedConnectionManager
的用法示例。
在下文中一共展示了QueuedConnectionManager.startConnection方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: login
# 需要导入模块: from panda3d.core import QueuedConnectionManager [as 别名]
# 或者: from panda3d.core.QueuedConnectionManager import startConnection [as 别名]
class login(DirectObject):
TEXT_COLOR = (1,1,1,1)
FONT_TYPE_01 = 0
TEXT_SHADOW_COLOR = (0,0,0,0.5)
usernameInput = ""
passwordInput = ""
frame = DirectFrame()
username = OnscreenText()
password = OnscreenText()
cpassword = OnscreenText()
failed = OnscreenText()
userTextbox = DirectEntry()
passTextbox = DirectEntry()
submitBtn = DirectButton()
registerBtn = DirectButton()
cancelBtn = DirectButton()
registerUsername = ""
registerPassword = ""
registerCPassword = ""
regInputUser = DirectEntry()
regInputPass = DirectEntry()
regInputCPass = DirectEntry()
regRegisterBtn = DirectButton()
regCancelBtn = DirectButton()
#character selection varaiables
createCharacter = DirectButton()
deleteCharacter = DirectButton()
selectCharacter = OnscreenText()
selectCharacterTextbox = DirectEntry()
selectCharacterInput=''
referenceForSelection = OnscreenText()
myScrolledList = DirectScrolledList()
submitBtn = DirectButton()
cancelBtn = DirectButton()
#character deletion varaiables
selectCharactertodelete = OnscreenText()
deleteBtn = DirectButton()
delCancelBtn = DirectButton()
CharacterToDeleteTextbox = DirectEntry()
referenceForDeletion = OnscreenText()
CharacterToDeleteInput = ' '
#character creation varaiables
v=[0]
v1=[0]
nameOfChar = OnscreenText()
nameOfCharTextbox = DirectEntry()
factionSelection = OnscreenText()
nameOfCharInput =''
def __init__(self):
print 'Loading Login...'
# self.cManager = ConnectionManager()
# self.startConnection()
self.cManager = QueuedConnectionManager()
self.cListener = QueuedConnectionListener(self.cManager, 0)
self.cReader = QueuedConnectionReader(self.cManager, 0)
self.cWriter = ConnectionWriter(self.cManager, 0)
frame = DirectFrame(frameColor=(0, 0, 0, 1), #(R,G,B,A)
frameSize=(-1, 1, -1, 1),#(Left,Right,Bottom,Top)
pos=(-0.5, 0, 0.5))
self.connection = self.cManager.openTCPClientConnection(Constants.SERVER_IP,
Constants.SERVER_PORT,
1000)
if self.connection:
self.cReader.addConnection(self.connection)
taskMgr.add(self.updateRoutine, 'updateRoutine-Connection', -39)
taskMgr.doMethodLater(5, self.checkConnection, 'checkConnection')
self.createLoginWindow()
def startConnection(self):
"""Create a connection to the remote host.
If a connection cannot be created, it will ask the user to perform
additional retries.
"""
if self.cManager.connection == None:
if not self.cManager.startConnection():
return False
return True
#.........这里部分代码省略.........