Merge branch 'dev-lwl/fix'

This commit is contained in:
lwl0608 2024-05-06 14:15:13 +08:00
commit 3561769427
1 changed files with 23 additions and 0 deletions

View File

@ -979,6 +979,9 @@ type ZoneUnlock struct {
} }
func (p *ZoneUnlock) IsUnlockAdmission() bool { func (p *ZoneUnlock) IsUnlockAdmission() bool {
if p.IsVIP() {
return true
}
if ValidZoneUnlockType[p.GetAdmissionUnlockType()] && if ValidZoneUnlockType[p.GetAdmissionUnlockType()] &&
(p.GetAdmissionUntil() == -1 || p.GetAdmissionUntil() >= time.Now().Unix()) { (p.GetAdmissionUntil() == -1 || p.GetAdmissionUntil() >= time.Now().Unix()) {
return true return true
@ -987,6 +990,9 @@ func (p *ZoneUnlock) IsUnlockAdmission() bool {
} }
func (p *ZoneUnlock) IsUnlockIronfanship() bool { func (p *ZoneUnlock) IsUnlockIronfanship() bool {
if p.IsVIP() {
return true
}
if ValidZoneUnlockType[p.GetIronfanshipUnlockType()] && p.IsUnlockAdmission() && if ValidZoneUnlockType[p.GetIronfanshipUnlockType()] && p.IsUnlockAdmission() &&
(p.GetIronfanshipUntil() == -1 || p.GetIronfanshipUntil() >= time.Now().Unix()) { (p.GetIronfanshipUntil() == -1 || p.GetIronfanshipUntil() >= time.Now().Unix()) {
return true return true
@ -995,6 +1001,9 @@ func (p *ZoneUnlock) IsUnlockIronfanship() bool {
} }
func (p *ZoneUnlock) IsUnlockSuperfanship() bool { func (p *ZoneUnlock) IsUnlockSuperfanship() bool {
if p.IsVIP() {
return true
}
if ValidZoneUnlockType[p.GetSuperfanshipUnlockType()] && p.IsUnlockAdmission() && if ValidZoneUnlockType[p.GetSuperfanshipUnlockType()] && p.IsUnlockAdmission() &&
(p.GetSuperfanshipUntil() == -1 || p.GetSuperfanshipUntil() >= time.Now().Unix()) { (p.GetSuperfanshipUntil() == -1 || p.GetSuperfanshipUntil() >= time.Now().Unix()) {
return true return true
@ -1002,6 +1011,13 @@ func (p *ZoneUnlock) IsUnlockSuperfanship() bool {
return false return false
} }
func (p *ZoneUnlock) IsVIP() bool {
if p.GetOid5() == "vip" {
return true
}
return false
}
func (p *ZoneUnlock) GetId() int64 { func (p *ZoneUnlock) GetId() int64 {
if p != nil && p.AdmissionCt != nil { if p != nil && p.AdmissionCt != nil {
return *p.AdmissionCt return *p.AdmissionCt
@ -1023,6 +1039,13 @@ func (p *ZoneUnlock) GetZid() int64 {
return 0 return 0
} }
func (p *ZoneUnlock) GetOid5() string {
if p != nil && p.Oid5 != nil {
return *p.Oid5
}
return ""
}
func (p *ZoneUnlock) GetConsume() int64 { func (p *ZoneUnlock) GetConsume() int64 {
if p != nil && p.Consume != nil { if p != nil && p.Consume != nil {
return *p.Consume return *p.Consume