本文整理汇总了Python中twisted.internet.protocol.Factory.positions方法的典型用法代码示例。如果您正苦于以下问题:Python Factory.positions方法的具体用法?Python Factory.positions怎么用?Python Factory.positions使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类twisted.internet.protocol.Factory
的用法示例。
在下文中一共展示了Factory.positions方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: message
# 需要导入模块: from twisted.internet.protocol import Factory [as 别名]
# 或者: from twisted.internet.protocol.Factory import positions [as 别名]
c.message(data) #post message for all clients to see
except Exception as e:
print "Error({0}): ".format(e)
pass
def message(self, message): #helper method to send text to all clients
self.transport.write(message + '\n')
if __name__ == '__main__':
factory = Factory()
factory.protocol = TCPServer
factory.clients = []
factory.counter = 0
factory.positions = {}
# Preguntamos si es juego o test
mode = raw_input('[S/s] Server Mode / [] Test Mode:')
is_game = False
if mode == "s" or mode == "S":
is_game = True
print(is_game)
factory.is_game = is_game
factory.maps = []
factory.users_port = {}
factory.RealObjects = {}