unlock vip

This commit is contained in:
lwl0608 2024-05-06 14:15:00 +08:00
parent 7aff32ca0f
commit 6cf683249f
1 changed files with 23 additions and 0 deletions

View File

@ -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