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


Python Channel.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     self.nickName = "anonymous"
     self.inGame = False
     self.game = None
     self.gameClient = None
     self.uuid = uuid.uuid1()
     Channel.__init__(self, *args, **kwargs)
开发者ID:borgaster,项目名称:GameServerClient,代码行数:9,代码来源:PlayerServer.py

示例2: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
	def __init__(self, *args, **kwargs):
		self.entity = None
		self.loggedIn = False
		
		Channel.__init__(self, *args, **kwargs)
		
		self.Send(messages.Chat("You are connected. Use /login <name> <pass> to login."))
开发者ID:emragins,项目名称:tribal,代码行数:9,代码来源:channel.py

示例3: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     Channel.__init__(self, *args, **kwargs)
     self.id = str(self._server.next_id())
     self._player_pos = [0, 0]
     self.p1 = None
     self.sprite = Starship()  # Each player needs a sprite representation
     self.bullets = pygame.sprite.Group()  # Each player has their own list of bullets
开发者ID:jamesmack,项目名称:tiny-space-battles,代码行数:9,代码来源:server.py

示例4: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     Channel.__init__(self, *args, **kwargs)
     pygame.sprite.Sprite.__init__(self)
     self.bar = Bar()
     self.tirCompteurTmp = outils.FREQUENCE_TIR
     self.shotAllowed = True
     self.tir_sprites = Tirs()
     self.joueur = outils.J1
开发者ID:sylvainmetayer,项目名称:pygame,代码行数:10,代码来源:serveur.py

示例5: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     print "initializing Player copy in Server"
     Channel.__init__(self, *args, **kwargs)
     self.id = str(self._server.NextId())
     intid = int(self.id)
     self._server.addPlayer()
     self.spaceship = SpaceshipModel()
     self.active=True
开发者ID:bravelittlescientist,项目名称:asteroid-lander,代码行数:10,代码来源:GameServer.py

示例6: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
    def __init__(self , *args, **kwargs):
        Channel.__init__(self, *args, **kwargs)
	self.id = str(self._server.NextId())
        intid = int(self.id)
        self.name    = "Player " + str(self.id)
        self.events  = {"up":0,"left":0,"right":0}
        self.updateT = 40
        self.area    = "lobby" 
开发者ID:shahidgadda,项目名称:head_soccer_network,代码行数:10,代码来源:friendly_server.py

示例7: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
	def __init__(self, *args, **kwargs):
		self.pos=[screenSize[0]/2,screenSize[1]/2]
		self.move=[0,0]
		self.maxhealth=10
		self.health=5
		self.shootDirection=()
		self.bulletTimer=time.time()
		Channel.__init__(self, *args, **kwargs)
开发者ID:scottmackinlay,项目名称:killkillevolution,代码行数:10,代码来源:KKE_server.py

示例8: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        Channel.__init__(self, *args, **kwargs)
#         self.Send({"action":"world","world":pickle.dumps(self._server.world)})
        self.Send({"action":"world","world":[[(self._server.world[i][j].id, self._server.world[i][j].metadata) for j in range(WORLD_HEIGHT)] for i in range(WORLD_WIDTH)]})
        self.pos = [0,0]
        self.health = 100
        self.uuid = uuid4().hex
        self.Send({"action":"uuid","uuid":self.uuid})
        self.name = ""
开发者ID:evantygf,项目名称:BlockFun,代码行数:11,代码来源:server.py

示例9: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
 def __init__(self, *args, **kwargs):
     Channel.__init__(self, *args, **kwargs)
     self.functions = {
         'new_id': self._server.get_id,
         'add_entity': self._server.add_entity,
         'remove_entity': self._server.remove_entity,
     }
     self.player = Player(self.functions)
     self.functions['add_entity'](self.player, etype='collided')
开发者ID:StephenCarlson,项目名称:simplydogfighting,代码行数:11,代码来源:server.py

示例10: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
	def __init__(self, *args, **kwargs):
		Channel.__init__(self, *args, **kwargs)
		self.nickname = "anonymous"
		self.id = str(self._server.NextId())
		intid = int(self.id)
		self.color = [randint(0,255),randint(0,255),randint(0,255), 255 ] #tuple([randint(0, 127) for r in range(3)])
		self.cards = []
		self.tokens = []
		self.acts = []
		self.mss = []
开发者ID:mcgillij,项目名称:REZD,代码行数:12,代码来源:GameServer.py

示例11: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
	def __init__(self, *args, **kwargs):
		# ID is the non-secret session ID which we share with other connected clients
		self.ID = None
		# player ID is a secret, persistent (across game sessions) uuid only known by this particular client
		self.playerID = None
		# which level this player is currently in
		self.level = None
		# this player's last known state, such as last move performed, position etc.
		self.state = {}
		self.state["chat"] = {}
		self.lastUpdate = 0
		Channel.__init__(self, *args, **kwargs)
开发者ID:chr15m,项目名称:Infinite8BitPlatformer,代码行数:14,代码来源:I8BPServer.py

示例12: DoConnect

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
	def DoConnect(self, address=None):
		if address:
			self.address = address
		try:
			Channel.__init__(self, map=self._map)
			self.create_socket(socket.AF_INET, socket.SOCK_STREAM)
			self.setsockopt(socket.IPPROTO_TCP, socket.TCP_NODELAY, 1)
			self.connect(self.address)
		except socket.gaierror as e:
			self.queue.append({"action": "error", "error": e.args})
		except socket.error as e:
			self.queue.append({"action": "error", "error": e.args})
开发者ID:selster,项目名称:podsixnet,代码行数:14,代码来源:EndPoint.py

示例13: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
    def __init__(self , *args, **kwargs):
        Channel.__init__(self, *args, **kwargs)
        self.id = str(self._server.NextId())
        self.status = "checkData"
        self.ip = "nn"
        self.conn = "nn"
        self.name = "noName"
        self.head = Heads.heads[random.randrange(len(Heads.heads))]

        self.RoomDef = None
        #### UDP ####
        self.udpAddr = -1
开发者ID:shahidgadda,项目名称:head_soccer_network,代码行数:14,代码来源:server.py

示例14: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
    def __init__(self , *args, **kwargs):
        Channel.__init__(self, *args, **kwargs)
        self.id = str(self._server.NextId())
        self.status = "checkData"
        self.ip = "nn"
        self.conn = "nn"
        self.name = "noName"
        self.guest = False
        self.head = Heads.heads[random.randrange(len(Heads.heads))]

        self.RoomDef = None
        #### UDP ####
        self.udpAddr = -1

        ### NEXT CC, FOR PING CALCULATOR
        self.nextCC = False
开发者ID:shahidgadda,项目名称:head_soccer_network,代码行数:18,代码来源:server.py

示例15: __init__

# 需要导入模块: from PodSixNet.Channel import Channel [as 别名]
# 或者: from PodSixNet.Channel.Channel import __init__ [as 别名]
    def __init__(self, *args, **kwargs):
        self.account = "anonymous"
        Channel.__init__(self, *args, **kwargs)

        self.map = map = shared.MapGen(30,30)
        map.Gen(4, 5, 5, 3, 3, 3)
        self.MobMgr = shared.MobManager(self)
        self.SkillMgr = shared.SkillManager()
        self.SkillMgr.AddSkill(shared.SkillPresets["Fireball"]())
        self.SkillMgr.lmbSkill = self.SkillMgr.originalSkills[0]
        self.MissileMgr = shared.MissileManager()


        self.x = 0
        self.y = 0
        self.pX = 0
        self.pY = 0

        randRoom = self.map.rooms[random.randint(0, len(self.map.rooms)-1)]
        randX = random.randint(randRoom[0], randRoom[0]+randRoom[2]-1)
        randY = random.randint(randRoom[1], randRoom[1]+randRoom[3]-1)
        self.pX = self.x = randX
        self.pY = self.y = randY
        self.moveD = 150
        self.moveW = 0

        self.mobMoveD = 2000
        self.mobMoveW = 0

        self.misMoveD = 100
        self.misMoveW = 0

        self.skillD = 300
        self.skillW = 0


        self.pl = shared.ServerPlayer("Player")
开发者ID:perezkarjee,项目名称:pymusicsequencer,代码行数:39,代码来源:simpleMultiServer.py


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