Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
baiye1000 opened this issue Jan 8, 2024 · 0 comments

Comments

@baiye1000
Copy link

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)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant