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