重构
This commit is contained in:
@@ -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))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user