AllowIPStrings 检查一组IP是否被允许访问
(ipStrings []string, serverId int64)
| 74 | |
| 75 | // AllowIPStrings 检查一组IP是否被允许访问 |
| 76 | func AllowIPStrings(ipStrings []string, serverId int64) bool { |
| 77 | if len(ipStrings) == 0 { |
| 78 | return true |
| 79 | } |
| 80 | for _, ip := range ipStrings { |
| 81 | isAllowed, _, _ := AllowIP(ip, serverId) |
| 82 | if !isAllowed { |
| 83 | return false |
| 84 | } |
| 85 | } |
| 86 | return true |
| 87 | } |
| 88 | |
| 89 | func IsZero(ipBytes []byte) bool { |
| 90 | return len(ipBytes) == 0 |