多人世界队伍

This commit is contained in:
huangxiaolei
2022-12-09 02:01:25 +08:00
parent 3615ad194a
commit 5e8d457344
7 changed files with 325 additions and 58 deletions

View File

@@ -75,6 +75,15 @@ func (p *Player) InitAvatar(avatar *Avatar) {
return
}
func (p *Player) GetAvatarIdByGuid(guid uint64) uint32 {
for avatarId, avatar := range p.AvatarMap {
if guid == avatar.Guid {
return avatarId
}
}
return 0
}
func (p *Player) AddAvatar(avatarId uint32) {
avatarDataConfig, ok := gdc.CONF.AvatarDataMap[int32(avatarId)]
if !ok {

View File

@@ -56,7 +56,6 @@ type Player struct {
EnterSceneToken uint32 `bson:"-"` // 玩家的世界进入令牌
DbState int `bson:"-"` // 数据库存档状态
WorldId uint32 `bson:"-"` // 所在的世界id
PeerId uint32 `bson:"-"` // 多人世界的玩家编号
GameObjectGuidCounter uint64 `bson:"-"` // 游戏对象guid计数器
ClientTime uint32 `bson:"-"` // 玩家客户端的本地时钟
ClientRTT uint32 `bson:"-"` // 玩家客户端往返时延