封号功能
This commit is contained in:
parent
9faaaf86e2
commit
0b3961adc4
@ -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,
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user