This commit is contained in:
@@ -3,10 +3,12 @@ package common
|
||||
import (
|
||||
"blazing/common/socket/errorcode"
|
||||
"blazing/logic/service/fight/info"
|
||||
space "blazing/logic/service/space/info"
|
||||
"blazing/modules/player/model"
|
||||
)
|
||||
|
||||
type PlayerI interface {
|
||||
ApplyPetDisplayInfo(*space.SimpleInfo)
|
||||
GetPlayerCaptureContext() *info.PlayerCaptureContext
|
||||
Roll(int, int) (bool, float64, float64)
|
||||
//SendPack(b []byte) error
|
||||
|
||||
@@ -5,6 +5,7 @@ import (
|
||||
"blazing/common/utils"
|
||||
"blazing/logic/service/common"
|
||||
"blazing/logic/service/fight/info"
|
||||
spaceinfo "blazing/logic/service/space/info"
|
||||
"blazing/modules/player/model"
|
||||
)
|
||||
|
||||
@@ -100,3 +101,4 @@ func (p *baseplayer) ItemAdd(ItemId, ItemCnt int64) (result bool) {
|
||||
func (lw *baseplayer) SendLoadPercent(info.LoadPercentOutboundInfo) {
|
||||
|
||||
}
|
||||
func (p *baseplayer) ApplyPetDisplayInfo(out *spaceinfo.SimpleInfo) {}
|
||||
|
||||
@@ -10,10 +10,6 @@ import (
|
||||
"github.com/jinzhu/copier"
|
||||
)
|
||||
|
||||
type petDisplayInfoProvider interface {
|
||||
ApplyPetDisplayInfo(*info.SimpleInfo)
|
||||
}
|
||||
|
||||
// 向其他人广播,不含自己
|
||||
// 广播是c 为空就不特判,发给全体成员广播
|
||||
func (s *Space) Broadcast(c common.PlayerI, cmd uint32, data any) {
|
||||
@@ -57,9 +53,7 @@ func (s *Space) EnterMap(c common.PlayerI) {
|
||||
|
||||
out := info.NewOutInfo()
|
||||
copier.CopyWithOption(out, c.GetInfo(), copier.Option{DeepCopy: true})
|
||||
if provider, ok := c.(petDisplayInfoProvider); ok {
|
||||
provider.ApplyPetDisplayInfo(out)
|
||||
}
|
||||
c.ApplyPetDisplayInfo(out)
|
||||
c.SendPackCmd(2001, out)
|
||||
|
||||
s.Broadcast(c, 2001, out)
|
||||
@@ -68,7 +62,7 @@ func (s *Space) EnterMap(c common.PlayerI) {
|
||||
curmaps, ok := maphot[s.Super]
|
||||
if ok {
|
||||
curmaps.ChangeCount(1)
|
||||
//atomic.AddInt32(maphot[s.Super], 1)
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -78,11 +72,8 @@ func (s *Space) RefreshUserInfo(c common.PlayerI) {
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
if provider, ok := c.(petDisplayInfoProvider); ok {
|
||||
provider.ApplyPetDisplayInfo(¤t)
|
||||
s.UserInfo.Store(c.GetInfo().UserID, current)
|
||||
}
|
||||
c.ApplyPetDisplayInfo(¤t)
|
||||
s.UserInfo.Store(c.GetInfo().UserID, current)
|
||||
}
|
||||
|
||||
func (s *Space) GetInfo(c common.PlayerI) []info.SimpleInfo {
|
||||
|
||||
Reference in New Issue
Block a user