node_state.go 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. // Code generated by excel export. DO NOT EDIT.
  2. package data
  3. import (
  4. "f1-game/internal/types"
  5. )
  6. var NodeState = &nodeStateConfig{}
  7. func init() {
  8. _allList = append(_allList, NodeState)
  9. }
  10. type (
  11. NodeStateRow struct {
  12. State int32 `json:"state"` // 节点启动后默认状态 0:开放,1:维护,2:关闭
  13. GmEnable bool `json:"gmEnable"` // 是否启用GM
  14. MaxOfOnline int64 `json:"maxOfOnline"` // 最高在线人数
  15. MaxOfPlayer int64 `json:"maxOfPlayer"` // 最大注册玩家数
  16. UpdateGameNodeInterval int64 `json:"updateGameNodeInterval"` // 更新游戏节点的间隔时间(秒)
  17. IpList types.List[string] `json:"ipList"` // ip 白名单
  18. UidList types.List[int64] `json:"uidList"` // uid 白名单
  19. }
  20. nodeStateConfig struct {
  21. baseConfig
  22. NodeStateRow
  23. }
  24. )
  25. func (p *nodeStateConfig) Name() string {
  26. return "node_state"
  27. }
  28. func (p *nodeStateConfig) Init() {
  29. }
  30. func (p *nodeStateConfig) OnLoad(maps interface{}, reload bool) (int, error) {
  31. if reload && p.denyLoad {
  32. return 0, nil
  33. }
  34. err := DecodeData(maps, &p.NodeStateRow)
  35. return 1, err
  36. }
  37. // func (p *nodeStateConfig) OnAfterLoad(_ bool) {
  38. // }