當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。