From 6cf683249fd3825ffa4744a69b6cc40b0052f6e1 Mon Sep 17 00:00:00 2001 From: lwl0608 Date: Mon, 6 May 2024 14:15:00 +0800 Subject: [PATCH] unlock vip --- dbstruct/vas_mysql.go | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/dbstruct/vas_mysql.go b/dbstruct/vas_mysql.go index 16070b43..bfabfa98 100644 --- a/dbstruct/vas_mysql.go +++ b/dbstruct/vas_mysql.go @@ -979,6 +979,9 @@ type ZoneUnlock struct { } func (p *ZoneUnlock) IsUnlockAdmission() bool { + if p.IsVIP() { + return true + } if ValidZoneUnlockType[p.GetAdmissionUnlockType()] && (p.GetAdmissionUntil() == -1 || p.GetAdmissionUntil() >= time.Now().Unix()) { return true @@ -987,6 +990,9 @@ func (p *ZoneUnlock) IsUnlockAdmission() bool { } func (p *ZoneUnlock) IsUnlockIronfanship() bool { + if p.IsVIP() { + return true + } if ValidZoneUnlockType[p.GetIronfanshipUnlockType()] && p.IsUnlockAdmission() && (p.GetIronfanshipUntil() == -1 || p.GetIronfanshipUntil() >= time.Now().Unix()) { return true @@ -995,6 +1001,9 @@ func (p *ZoneUnlock) IsUnlockIronfanship() bool { } func (p *ZoneUnlock) IsUnlockSuperfanship() bool { + if p.IsVIP() { + return true + } if ValidZoneUnlockType[p.GetSuperfanshipUnlockType()] && p.IsUnlockAdmission() && (p.GetSuperfanshipUntil() == -1 || p.GetSuperfanshipUntil() >= time.Now().Unix()) { return true @@ -1002,6 +1011,13 @@ func (p *ZoneUnlock) IsUnlockSuperfanship() bool { return false } +func (p *ZoneUnlock) IsVIP() bool { + if p.GetOid5() == "vip" { + return true + } + return false +} + func (p *ZoneUnlock) GetId() int64 { if p != nil && p.AdmissionCt != nil { return *p.AdmissionCt @@ -1023,6 +1039,13 @@ func (p *ZoneUnlock) GetZid() int64 { return 0 } +func (p *ZoneUnlock) GetOid5() string { + if p != nil && p.Oid5 != nil { + return *p.Oid5 + } + return "" +} + func (p *ZoneUnlock) GetConsume() int64 { if p != nil && p.Consume != nil { return *p.Consume