| 1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package data
- func (p *nodeStateConfig) OnAfterLoad(_ bool) {
- if p.UpdateGameNodeInterval < 3 {
- p.UpdateGameNodeInterval = 3
- }
- }
- func (p *nodeStateConfig) IsMaxOfOnline(uidCount int64) bool {
- // 如果没有设置最大在线人数,则忽略检查
- if p.MaxOfOnline < 1 {
- return false
- }
- if uidCount >= p.MaxOfOnline {
- return true
- }
- return false
- }
- func (p *nodeStateConfig) IsMaxOfPlayer(count int64) bool {
- if p.MaxOfPlayer < 1 {
- return false
- }
- if count >= p.MaxOfPlayer {
- return true
- }
- return false
- }
- func (p *nodeStateConfig) InWhiteList(ip string, uid int64) bool {
- if p.UidList.Contains(uid) {
- return true
- }
- if p.IpList.Contains(ip) {
- return true
- }
- return false
- }
|