From b0f39590d1359063e69f7c19eb9b90420a2e3e5e Mon Sep 17 00:00:00 2001 From: liwei1dao Date: Mon, 13 Feb 2023 14:16:25 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=8A=E4=BC=A0pvp=E4=BB=A3=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modules/pvp/core.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/modules/pvp/core.go b/modules/pvp/core.go index 6ecb013fc..f0682b548 100644 --- a/modules/pvp/core.go +++ b/modules/pvp/core.go @@ -7,6 +7,7 @@ import ( "sync" ) +///Pvp 战斗对象 type BattleItem struct { Id string //战斗id Ptype pb.PvpType //pvp类型 @@ -14,9 +15,13 @@ type BattleItem struct { Red *pb.PvpUserInfo //红方id RedSession comm.IUserSession //红方连接对象 Redformation *pb.BattleFormation //红方阵型列表 + RedOffline bool //红方离线 Blue *pb.PvpUserInfo //蓝方id BlueSession comm.IUserSession //蓝方连接对象 Blueformation *pb.BattleFormation //蓝方阵型列表 + BlueOffline bool //蓝方离线 readytimer *timewheel.Task //准备倒计时定时器 + operatetimer *timewheel.Task //操作倒计时定时器 + curroperate int32 //当前操作玩家 1 红方 2 蓝方 lock sync.Mutex //战斗锁 防止计时器和消息同时操作对象 }