Merge branch 'develop' into sdk

This commit is contained in:
hahwu 2025-07-30 16:11:34 +08:00
commit 014f155980
2 changed files with 13 additions and 2 deletions

View File

@ -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 &BanInfo{}
}
Info, banned := f.data.(*BanData).NewBanList[userId]
if !banned {
return &BanInfo{}
}
return Info
}
func (f *BanMgr) BanUser(userId int64, endTime int64, reason string) {
f.data.(*BanData).NewBanList[userId] = &BanInfo{
UserId: userId,

View File

@ -26,7 +26,7 @@ var AdminFuncMap = map[string]func([]interface{}) error{
"ReqReloadServerMail": ReqReloadServerMail,
"ReqReload": ReqReload,
"ReqAdminGm": ReqAdminGm,
"ReqAdminBan": ReqAdminGm,
"ReqAdminBan": ReqAdminBan,
}
func AdminProcess(Func string, args []interface{}) {
@ -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)