From 0b3961adc438a78ab72b5796bd9cff9a597d7b9f Mon Sep 17 00:00:00 2001 From: hahwu <31872165+hahwu@users.noreply.github.com> Date: Wed, 30 Jul 2025 15:33:55 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=81=E5=8F=B7=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/server/game/BanMgr.go | 11 +++++++++++ src/server/game/admin.go | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/server/game/BanMgr.go b/src/server/game/BanMgr.go index 5a6ee314..82161ef8 100644 --- a/src/server/game/BanMgr.go +++ b/src/server/game/BanMgr.go @@ -43,6 +43,17 @@ func (f *BanMgr) IsBanned(userId int64) bool { return Info.EndTime > GoUtil.Now() || Info.EndTime == -1 // 如果EndTime为0,表示永久封禁 } +func (f *BanMgr) GetBanInfo(userId int64) *BanInfo { + if f.data.(*BanData).NewBanList == nil { + return nil + } + Info, banned := f.data.(*BanData).NewBanList[userId] + if !banned { + return nil + } + return Info +} + func (f *BanMgr) BanUser(userId int64, endTime int64, reason string) { f.data.(*BanData).NewBanList[userId] = &BanInfo{ UserId: userId, diff --git a/src/server/game/admin.go b/src/server/game/admin.go index 83fda4b7..c1bed79c 100644 --- a/src/server/game/admin.go +++ b/src/server/game/admin.go @@ -133,7 +133,7 @@ func AdminPlayerInfo(args []interface{}) error { res["Cumulative"] = player.PlayMod.getBaseMod().Cumulative res["RegisterTime"] = player.GetPlayerBaseMod().GetRegisterTime() res["TodayCumulative"] = player.PlayMod.getBaseMod().TodayCumulative - res["Ban"] = G_GameLogicPtr.BanMgr.IsBanned(player.M_DwUin) + res["Ban"] = G_GameLogicPtr.BanMgr.GetBanInfo(player.M_DwUin).EndTime if online { res["Cumulative"] = int64(player.PlayMod.getBaseMod().Cumulative) + GoUtil.Now() - int64(player.PlayMod.getBaseMod().LoginTime) res["TodayCumulative"] = int64(player.PlayMod.getBaseMod().TodayCumulative) + GoUtil.Now() - int64(player.PlayMod.getBaseMod().LoginTime)