地牢场景传送

This commit is contained in:
flswld
2023-03-24 17:37:20 +08:00
parent 729efa900e
commit e3242cf894
11 changed files with 243 additions and 123 deletions

View File

@@ -207,6 +207,8 @@ func (w *WorldManager) GetMultiplayerWorldNum() uint32 {
type EnterSceneContext struct {
OldSceneId uint32
OldPos *model.Vector
OldRot *model.Vector
Uid uint32
}
// World 世界数据结构
@@ -258,6 +260,23 @@ func (w *World) AddEnterSceneContext(ctx *EnterSceneContext) uint32 {
return w.enterSceneToken
}
func (w *World) GetLastEnterSceneContextBySceneIdAndUid(sceneId uint32, uid uint32) *EnterSceneContext {
for token := w.enterSceneToken; token >= 5000; token -= 100 {
ctx, exist := w.enterSceneContextMap[token]
if !exist {
continue
}
if ctx.OldSceneId != sceneId {
continue
}
if ctx.Uid != uid {
continue
}
return ctx
}
return nil
}
func (w *World) GetWorldLevel() uint8 {
return w.worldLevel
}