本文整理汇总了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)
示例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."))
示例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
示例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
示例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
示例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"
示例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)
示例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 = ""
示例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')
示例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 = []
示例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)
示例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})
示例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
示例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
示例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")