Apply .gitignore rules
This commit is contained in:
@@ -0,0 +1,69 @@
|
||||
package managecenterModel
|
||||
|
||||
import "goutil/stringUtil"
|
||||
|
||||
// 大区对象
|
||||
type Area struct {
|
||||
// 大区Id
|
||||
AreaId int32 `json:"AreaId"`
|
||||
|
||||
//大区名字
|
||||
AreaName string `json:"AreaName"`
|
||||
|
||||
//客户端显示名字
|
||||
ClientName string `json:"ClientName"`
|
||||
|
||||
//区服范围
|
||||
ServerRange string `json:"ServerRange"`
|
||||
|
||||
//资源包下载地址
|
||||
ResourceURL string `json:"ResourceURL"`
|
||||
|
||||
//推荐服开关:0关闭,1:打开
|
||||
RecommendStitch int32 `json:"RecommendStitch"`
|
||||
|
||||
//推荐最大注册人数
|
||||
MaxRegistration int32 `json:"MaxRegistration"`
|
||||
|
||||
//限制注册的开关
|
||||
RegRestrictionSwitch int32 `json:"RegRestrictionSwitch"`
|
||||
|
||||
//玩家数量大于该数量,自动开服
|
||||
AutoOpenServerPlayers int32 `json:"AutoOpenServerPlayers"`
|
||||
|
||||
//大区维护状态(1:正常;2:维护)
|
||||
AreaMaintainStatus int32 `json:"AreaMaintainStatus"`
|
||||
|
||||
//维护消息
|
||||
AreaMaintainMsg string `json:"AreaMaintainMsg"`
|
||||
|
||||
//大区页签集合
|
||||
AreaLabelList []*AreaLabel `json:"AreaLabelList"`
|
||||
}
|
||||
|
||||
//
|
||||
//检测服务器是否在大区的区间范围
|
||||
func (this *Area) CheckServerIdIsInRange(serverId int32) (isVaild bool) {
|
||||
isVaild = false
|
||||
for _, serverRangeItem := range stringUtil.Split(this.ServerRange, []string{","}) {
|
||||
serverRange, _ := stringUtil.SplitToInt32Slice(serverRangeItem, "-")
|
||||
lower := serverRange[0]
|
||||
upper := serverRange[1]
|
||||
|
||||
//如果范围大小顺序不对,则换位
|
||||
if lower > upper {
|
||||
temp := lower
|
||||
lower = upper
|
||||
upper = temp
|
||||
}
|
||||
|
||||
//如果服务器在该大区的任意区服区间,则返回true
|
||||
if serverId >= lower && serverId <= upper {
|
||||
isVaild = true
|
||||
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
return
|
||||
}
|
||||
Reference in New Issue
Block a user