-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Description
def reqCreateAvatar(self,name,roleType):
"""
创建客户端对应实体
"""
if len(self.characters)>= 3:
DEBUG_MSG("Account[%i].request avatar is more than three,Please detele one of them then create and another" % self.id)
avatarinfo = TAvatarInfo()
avatarinfo.extend(0,"",0,0)
self.client.onCreateAvatarResult(3,avatarinfo)
return
spaceUType = GlobalConst.g_demoMaps.get(self.getClientDatas()[0],1)
spaceData = d_spaces.datas.get(spaceUType)
props = {
"name" :name,
"roleType" :roleType,
"level" :1,
"spaceUType" :spaceUType,
"direction" :(0,0,0),
"position" :spaceData.get("spawnPos",(0,0,0))
}
avatar=KBEngine.createEntityLocally("Avatar",props)
if avatar:
avatar.writeToDB(self._onAvatarSaved)
Metadata
Metadata
Assignees
Labels
No labels