当前位置: 首页>>代码示例>>Python>>正文


Python Protocol.packTLV方法代码示例

本文整理汇总了Python中ggpo.common.protocol.Protocol.packTLV方法的典型用法代码示例。如果您正苦于以下问题:Python Protocol.packTLV方法的具体用法?Python Protocol.packTLV怎么用?Python Protocol.packTLV使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ggpo.common.protocol.Protocol的用法示例。


在下文中一共展示了Protocol.packTLV方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: sendAuth

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendAuth(self, username, password):
     self.username = username
     try:
         port = self.udpSock.getsockname()[1]
     except:
         port=6009
     authdata = Protocol.packTLV(username) + Protocol.packTLV(password) + Protocol.packInt(port) + Protocol.packInt(copyright.versionNum())
     self.sendAndRemember(Protocol.AUTH, authdata)
开发者ID:pond3r,项目名称:pyqtggpo,代码行数:10,代码来源:controller.py

示例2: sendAcceptChallenge

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendAcceptChallenge(self, name):
     isFbaPresent = self.checkInstallation()
     isRomPresent = self.checkRom()
     if not isRomPresent or not isFbaPresent:
         return
     if name in self.challengers:
         self.sendAndRemember(Protocol.ACCEPT_CHALLENGE, Protocol.packTLV(name) + Protocol.packTLV(self.rom))
         self.challengers.remove(name)
开发者ID:pond3r,项目名称:pyqtggpo,代码行数:10,代码来源:controller.py

示例3: sendChallenge

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendChallenge(self, name):
     self.sendCancelChallenge()
     isFbaPresent = self.checkInstallation()
     isRomPresent = self.checkRom()
     if not isRomPresent or not isFbaPresent:
         return
     if (name==self.username):
         self.runFBA(self.channel)
     else:
         self.sendAndRemember(Protocol.SEND_CHALLENGE, Protocol.packTLV(name) + Protocol.packTLV(self.rom))
         self.challenged = name
开发者ID:pond3r,项目名称:pyqtggpo,代码行数:13,代码来源:controller.py

示例4: sendJoinChannelRequest

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendJoinChannelRequest(self, channel=None):
     if channel:
         self.channel = channel
         Settings.setValue(Settings.SELECTED_CHANNEL, channel)
         if channel in self.channels:
             if channel != 'lobby':
                 self.rom = self.channels[channel]['rom']
         else:
             logdebug().error("Invalid channel {}".format(channel))
     self.sendAndRemember(Protocol.JOIN_CHANNEL, Protocol.packTLV(self.channel))
开发者ID:pond3r,项目名称:pyqtggpo,代码行数:12,代码来源:controller.py

示例5: sendJoinChannelRequest

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
    def sendJoinChannelRequest(self, channel=None):
        if channel:
            self.channel = channel
            Settings.setValue(Settings.SELECTED_CHANNEL, channel)
            if channel in self.channels:
                if channel != 'lobby':
                    self.rom = self.channels[channel]['rom']
                else:
                    self.rom = ''
            else:
                logdebug().error("Invalid channel {}".format(channel))

        if (int(self.channelport)!=int(self.channels[channel]['port'])):
            self.switchingServer=True
            self.channelport = int(self.channels[channel]['port'])
            Settings.setValue(Settings.PORT, self.channelport)
            self.tcpSock.close()
            self.sequence = 0x1
            self.connectTcp()
            self.sendWelcome()
            self.sendAuth(self.username, self.password)
            if Settings.value(Settings.AWAY):
                self.sendToggleAFK(1)
        self.sendAndRemember(Protocol.JOIN_CHANNEL, Protocol.packTLV(self.channel))
开发者ID:TrueFocus,项目名称:pyqtggpo,代码行数:26,代码来源:controller.py

示例6: sendSpectateRequest

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendSpectateRequest(self, name):
     isFbaPresent = self.checkInstallation()
     isRomPresent = self.checkRom()
     if not isRomPresent or not isFbaPresent:
         return
     self.sendAndRemember(Protocol.SPECTATE, Protocol.packTLV(name))
开发者ID:pond3r,项目名称:pyqtggpo,代码行数:8,代码来源:controller.py

示例7: sendDeclineChallenge

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendDeclineChallenge(self, name):
     self.sendAndRemember(Protocol.DECLINE_CHALLENGE, Protocol.packTLV(name))
     if name in self.challengers:
         self.challengers.remove(name)
开发者ID:pond3r,项目名称:pyqtggpo,代码行数:6,代码来源:controller.py

示例8: sendChat

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendChat(self, line):
     if self.channel == 'unsupported' and self.unsupportedRom:
         line = '[' + self.unsupportedRom + '] ' + line
     line = line.encode('utf-8')
     self.sendAndRemember(Protocol.CHAT, Protocol.packTLV(line))
开发者ID:pond3r,项目名称:pyqtggpo,代码行数:7,代码来源:controller.py

示例9: sendCancelChallenge

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendCancelChallenge(self, name=None):
     if (name is None and self.challenged) or (name and name == self.challenged):
         self.sendAndRemember(Protocol.CANCEL_CHALLENGE, Protocol.packTLV(self.challenged))
         self.challenged = None
开发者ID:pond3r,项目名称:pyqtggpo,代码行数:6,代码来源:controller.py

示例10: sendSpectateRequest

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendSpectateRequest(self, name):
     self.sendAndRemember(Protocol.SPECTATE, Protocol.packTLV(name))
开发者ID:marcelosjrp,项目名称:pyqtggpo,代码行数:4,代码来源:controller.py

示例11: sendChallenge

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendChallenge(self, name):
     self.sendCancelChallenge()
     self.sendAndRemember(Protocol.SEND_CHALLENGE, Protocol.packTLV(name) + Protocol.packTLV(self.rom))
     self.challenged = name
开发者ID:marcelosjrp,项目名称:pyqtggpo,代码行数:6,代码来源:controller.py

示例12: sendAuth

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendAuth(self, username, password):
     self.username = username
     authdata = Protocol.packTLV(username) + Protocol.packTLV(password) + "\x00\x00\x17\x79"
     self.sendAndRemember(Protocol.AUTH, authdata)
开发者ID:marcelosjrp,项目名称:pyqtggpo,代码行数:6,代码来源:controller.py

示例13: sendAcceptChallenge

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendAcceptChallenge(self, name):
     if name in self.challengers:
         self.sendAndRemember(Protocol.ACCEPT_CHALLENGE, Protocol.packTLV(name) + Protocol.packTLV(self.rom))
         self.challengers.remove(name)
开发者ID:marcelosjrp,项目名称:pyqtggpo,代码行数:6,代码来源:controller.py

示例14: sendCancelChallenge

# 需要导入模块: from ggpo.common.protocol import Protocol [as 别名]
# 或者: from ggpo.common.protocol.Protocol import packTLV [as 别名]
 def sendCancelChallenge(self, name=None):
     if (name is None and self.challenged) or (name and name == self.challenged):
         self.sigStatusMessage.emit("Cancelling challenge")
         self.sendAndRemember(Protocol.CANCEL_CHALLENGE, Protocol.packTLV(self.challenged))
         self.challenged = None
开发者ID:TrueFocus,项目名称:pyqtggpo,代码行数:7,代码来源:controller.py


注:本文中的ggpo.common.protocol.Protocol.packTLV方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。