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