Skip to content

avatar=KBEngine.createEntityLocally("Avatar",props)为什么会连续创建两次 #1594

@baiye1000

Description

@baiye1000

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

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions