This commit is contained in:
1
2025-08-28 21:35:56 +00:00
parent 00f38b8c53
commit 79361e68cd
29 changed files with 253 additions and 232 deletions

View File

@@ -1,7 +1,7 @@
package maps
import (
"blazing/common/data/entity"
"blazing/common/data/socket"
"blazing/common/socket/handler"
"blazing/logic/service/space"
"blazing/modules/blazing/model"
@@ -26,7 +26,7 @@ type InInfo struct {
func (t *InInfo) Broadcast(mapid uint32, o OutInfo) {
space.GetSpace(mapid).Range(func(playerID uint32, player *entity.Player) bool {
space.GetSpace(mapid).Range(func(playerID uint32, player *socket.Player) bool {
t.Head.Result = 0
player.SendPack(t.Head.Pack(&o))
@@ -35,7 +35,7 @@ func (t *InInfo) Broadcast(mapid uint32, o OutInfo) {
}
// 刷怪具体实现
func (t *InInfo) SpawnMonsters(c *entity.Player, isfrist bool) {
func (t *InInfo) SpawnMonsters(c *socket.Player, isfrist bool) {
// 获取当前地图的怪物配置
// if c == nil || mservice.NewMonsterService().GetId(c.MapId) == 0 { //用户离线
@@ -52,7 +52,7 @@ func (t *InInfo) SpawnMonsters(c *entity.Player, isfrist bool) {
}
// 创建数据包
tt := handler.NewTomeeHeader(2004, c.UserID)
tt := handler.NewTomeeHeader(2004, c.Info.UserID)
if isfrist {
t.monsters = generateThreeUniqueNumbers()
@@ -60,7 +60,7 @@ func (t *InInfo) SpawnMonsters(c *entity.Player, isfrist bool) {
t.monsters, _, _ = replaceOneNumber(t.monsters)
}
t1 := t.genMonster(c.MapId)
t1 := t.genMonster(c.Info.UserID)
c.SendPack(tt.Pack(&t1))
}