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


Python PyDatagram.addServerControlHeader方法代码示例

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


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

示例1: clearPostRemove

# 需要导入模块: from PyDatagram import PyDatagram [as 别名]
# 或者: from PyDatagram.PyDatagram import addServerControlHeader [as 别名]
    def clearPostRemove(self):
        """
        Clear all datagrams registered with addPostRemove.

        This is useful if the Panda3D process is performing a clean exit. It may
        clear the "emergency clean-up" post-remove messages and perform a normal
        exit-time clean-up instead, depending on the specific design of the game.
        """

        dg = PyDatagram()
        dg.addServerControlHeader(CONTROL_CLEAR_POST_REMOVE)
        self.send(dg)
开发者ID:ToonTownInfiniteRepo,项目名称:ToontownInfinite,代码行数:14,代码来源:AstronInternalRepository.py

示例2: addPostRemove

# 需要导入模块: from PyDatagram import PyDatagram [as 别名]
# 或者: from PyDatagram.PyDatagram import addServerControlHeader [as 别名]
    def addPostRemove(self, dg):
        """
        Register a datagram with the Message Director that gets sent out if the
        connection is ever lost.

        This is useful for registering cleanup messages: If the Panda3D process
        ever crashes unexpectedly, the Message Director will detect the socket
        close and automatically process any post-remove datagrams.
        """

        dg2 = PyDatagram()
        dg2.addServerControlHeader(CONTROL_ADD_POST_REMOVE)
        dg2.addString(dg.getMessage())
        self.send(dg2)
开发者ID:ToonTownInfiniteRepo,项目名称:ToontownInfinite,代码行数:16,代码来源:AstronInternalRepository.py

示例3: unregisterForChannel

# 需要导入模块: from PyDatagram import PyDatagram [as 别名]
# 或者: from PyDatagram.PyDatagram import addServerControlHeader [as 别名]
    def unregisterForChannel(self, channel):
        """
        Unregister a channel subscription on the Message Director. The Message
        Director will cease to relay messages to this AIR sent on the channel.
        """

        if channel not in self._registeredChannels:
            return
        self._registeredChannels.remove(channel)

        dg = PyDatagram()
        dg.addServerControlHeader(CONTROL_REMOVE_CHANNEL)
        dg.addChannel(channel)
        self.send(dg)
开发者ID:ToonTownInfiniteRepo,项目名称:ToontownInfinite,代码行数:16,代码来源:AstronInternalRepository.py

示例4: registerForChannel

# 需要导入模块: from PyDatagram import PyDatagram [as 别名]
# 或者: from PyDatagram.PyDatagram import addServerControlHeader [as 别名]
    def registerForChannel(self, channel):
        """
        Register for messages on a specific Message Director channel.

        If the channel is already open by this AIR, nothing will happen.
        """

        if channel in self._registeredChannels:
            return
        self._registeredChannels.add(channel)

        dg = PyDatagram()
        dg.addServerControlHeader(CONTROL_ADD_CHANNEL)
        dg.addChannel(channel)
        self.send(dg)
开发者ID:ToonTownInfiniteRepo,项目名称:ToontownInfinite,代码行数:17,代码来源:AstronInternalRepository.py


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