add: midi audio player

This commit is contained in:
flswld
2023-01-05 17:21:54 +08:00
parent 27f16d9063
commit ff650d9af7
7 changed files with 250 additions and 123 deletions

View File

@@ -32,7 +32,7 @@ func (w *WorldManager) GetWorldByID(worldId uint32) *World {
return w.worldMap[worldId]
}
func (w *WorldManager) GetWorldMap() map[uint32]*World {
func (w *WorldManager) GetAllWorld() map[uint32]*World {
return w.worldMap
}
@@ -90,6 +90,7 @@ func (w *WorldManager) GetBigWorld() *World {
func (w *WorldManager) InitBigWorld(owner *model.Player) {
w.bigWorld = w.GetWorldByID(owner.WorldId)
w.bigWorld.ChangeToMultiplayer()
go RunPlayAudio()
}
func (w *World) IsBigWorld() bool {
@@ -115,6 +116,14 @@ type World struct {
peerList []*model.Player // 玩家编号列表
}
func (w *World) GetAllPlayer() map[uint32]*model.Player {
return w.playerMap
}
func (w *World) GetAllScene() map[uint32]*Scene {
return w.sceneMap
}
func (w *World) GetNextWorldEntityId(entityType uint16) uint32 {
for {
w.entityIdCounter++
@@ -517,6 +526,14 @@ type Scene struct {
meeoIndex uint32 // 客户端风元素染色同步协议的计数器
}
func (s *Scene) GetAllPlayer() map[uint32]*model.Player {
return s.playerMap
}
func (s *Scene) GetAllEntity() map[uint32]*Entity {
return s.entityMap
}
type AvatarEntity struct {
uid uint32
avatarId uint32