gs

package
v1.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 31, 2024 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Ticker                 = 5   // 定时器间隔时间 / s
	AutoUpDataPlayerTicker = 120 // 定时执行玩家数据保存间隔时间 / s
)

Variables

View Source
var PLAYERNUM int64 // 玩家人数

Functions

This section is empty.

Types

type GamePlayer added in v1.2.1

type GamePlayer struct {
	LastActiveTime int64 // 最近一次的保存时间
	// contains filtered or unexported fields
}

gate申请离线玩家

1.先通知gate离线玩家 2.拉取redis状态 3.验证是否可以保存数据然后保存数据 4.可保存数据情况下删除redis状态 5.删除玩家内存

type GameServer

type GameServer struct {
	Config     *config.Config
	Store      *db.Store
	Port       string
	InnerAddr  string
	OuterAddr  string
	AppId      uint32
	GSListener *gunet.TcpListener

	Ticker *time.Ticker

	Stop chan struct{}
	// contains filtered or unexported fields
}

func NewGameServer

func NewGameServer(cfg *config.Config, appid string) *GameServer

func (*GameServer) AddPlayerStatus added in v1.2.1

func (s *GameServer) AddPlayerStatus(g *GamePlayer) error

func (*GameServer) AutoUpDataPlayer

func (s *GameServer) AutoUpDataPlayer()

func (*GameServer) Close added in v1.2.1

func (s *GameServer) Close() error

func (*GameServer) DelItem added in v1.2.1

func (s *GameServer) DelItem(serviceMsg pb.Message)

func (*GameServer) GetPlayerNum added in v1.2.1

func (s *GameServer) GetPlayerNum() int64

func (*GameServer) GlobalRotationEvent4h added in v1.2.1

func (s *GameServer) GlobalRotationEvent4h()

func (*GameServer) GlobalRotationEvent5s added in v1.2.1

func (s *GameServer) GlobalRotationEvent5s()

func (*GameServer) GmGive

func (s *GameServer) GmGive(serviceMsg pb.Message)

func (*GameServer) GmMaxCurAvatar added in v1.2.2

func (s *GameServer) GmMaxCurAvatar(serviceMsg pb.Message)

func (*GameServer) GmMission added in v1.2.3

func (s *GameServer) GmMission(serviceMsg pb.Message)

func (*GameServer) GmWorldLevel

func (s *GameServer) GmWorldLevel(serviceMsg pb.Message)

func (*GameServer) StartGameServer

func (s *GameServer) StartGameServer() error

type NodeService added in v1.2.1

type NodeService struct {
	// contains filtered or unexported fields
}

func (*NodeService) GameToNodePingReq added in v1.2.1

func (n *NodeService) GameToNodePingReq()

func (*NodeService) GameToNodePingRsp added in v1.2.1

func (n *NodeService) GameToNodePingRsp(serviceMsg pb.Message)

func (*NodeService) ServiceConnectionReq added in v1.2.1

func (n *NodeService) ServiceConnectionReq()

向node注册

func (*NodeService) ServiceConnectionRsp added in v1.2.1

func (n *NodeService) ServiceConnectionRsp(serviceMsg pb.Message)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL