Documentation ¶
Index ¶
- Variables
- func BattleGatewayCreateRoomMsg(robot *Robot) error
- func BattleGatewayGetRoomListMsg(robot *Robot) error
- func BattleGatewayJoinBattleRoomMsg(robot *Robot) error
- func BattleGatewayJoinRoomMsg(robot *Robot) error
- func BattleGatewayKCPHeartBeatMsg(robot *Robot) error
- func BattleGatewayKCPVerifyTokenMsg(robot *Robot) error
- func BattleGatewayRoomChooseLevelMsg(robot *Robot) error
- func BattleGatewayTCPHeartBeatMsg(robot *Robot) error
- func BattleGatewayTCPVerifyTokenMsg(robot *Robot) error
- func BattleGatewayTestMsg(robot *Robot) error
- func Disconnect(robot *Robot) error
- func GenerateSessionID() uint32
- func Invalid(robot *Robot) error
- func Offline(robot *Robot) error
- func RoomBattleStartMsg(robot *Robot) error
- func RoomEndMsg(robot *Robot) error
- func RoomExitRoomMsg(robot *Robot) error
- func RoomFrameDataMsg(robot *Robot) error
- func RoomGetRoomUserDetailInformationMsg(robot *Robot) error
- func RoomStartMsg(robot *Robot) error
- func RoomUserReadyMsg(robot *Robot) error
- func WorldCreatUserMsg(robot *Robot) error
- func WorldEnterBattleGatewayMsg(robot *Robot) error
- func WorldGetUserMsg(robot *Robot) error
- func WorldSetPrimaryWeaponMsg(robot *Robot) error
- func WorldSetSecondaryWeaponMsg(robot *Robot) error
- func WorldStageCreateRegionMsg(robot *Robot) error
- func WorldStatRoomEndMsg(robot *Robot) error
- func WorldTaskCompleteMsg(robot *Robot) error
- func WorldUserChatMsg(robot *Robot) error
- func WorldVerifyTokenMsg(robot *Robot) error
- type Profiler
- func (p *Profiler) AddConnectFailedNum(n int)
- func (p *Profiler) AddCurrentUserNum(n int)
- func (p *Profiler) AddCurrentUserTotalNum(n int)
- func (p *Profiler) AddCycleResponseNum(n int)
- func (p *Profiler) AddCycleSendNum(n int)
- func (p *Profiler) AddCycleSuccessSendNum(n int)
- func (p *Profiler) AddErrorNum(n int)
- func (p *Profiler) AddSendNum(n int)
- func (p *Profiler) AddSuccessNum(n int)
- func (p *Profiler) ExecuteCostTime(costMs int)
- func (p *Profiler) ShowLog()
- func (p *Profiler) Watch()
- type Robot
- func (p *Robot) ConnectBGW(OnParsePacket xrtcp.OnUnmarshalPacket, OnPacket xrtcp.OnPacket, ...) error
- func (p *Robot) ConnectWorld(OnParsePacket xrtcp.OnUnmarshalPacket, OnPacket xrtcp.OnPacket, ...) error
- func (p *Robot) Init()
- func (p *Robot) Offline() error
- func (p *Robot) Online(OnParsePacket xrtcp.OnUnmarshalPacket, OnPacket xrtcp.OnPacket, ...) error
- func (p *Robot) ResetBattle()
- func (p *Robot) Send2BGS(pb proto.Message, messageID uint32, sessionID uint32, resultID uint32, ...) error
- func (p *Robot) Send2World(pb proto.Message, messageID uint32, sessionID uint32, resultID uint32, ...) error
- func (p *Robot) StartMessageTicker()
- func (p *Robot) String() string
- type RobotMap
- type RobotMgr
- func (p *RobotMgr) AddBGSRobot(robot *Robot)
- func (p *RobotMgr) AddOfflineRobot(robot *Robot)
- func (p *RobotMgr) AddOnlineRobot(robot *Robot)
- func (p *RobotMgr) DelBGSRobot(robot *Robot)
- func (p *RobotMgr) DelOfflineRobot(robot *Robot)
- func (p *RobotMgr) DelOnlineRobot(robot *Robot)
- func (p *RobotMgr) FindBGSOnline(remote *xrtcp.Remote) *Robot
- func (p *RobotMgr) FindOffline(client *xrtcp.Client) *Robot
- func (p *RobotMgr) FindOnline(remote *xrtcp.Remote) *Robot
- func (p *RobotMgr) Init() error
Constants ¶
This section is empty.
Variables ¶
View Source
var GMessageFuncMap = make(messageFuncMap)
View Source
var GProfiler = NewProfiler()
View Source
var LockOnlineRobot sync.RWMutex
Functions ¶
func BattleGatewayTestMsg ¶
func GenerateSessionID ¶
func GenerateSessionID() uint32
func RoomBattleStartMsg ¶
func RoomEndMsg ¶
func RoomExitRoomMsg ¶
func RoomFrameDataMsg ¶
func RoomStartMsg ¶
func RoomUserReadyMsg ¶
func WorldCreatUserMsg ¶
func WorldGetUserMsg ¶
func WorldStatRoomEndMsg ¶
func WorldTaskCompleteMsg ¶
func WorldUserChatMsg ¶
func WorldVerifyTokenMsg ¶
Types ¶
type Profiler ¶
type Profiler struct { CurrentUserNum int // 当前在线用户数 TotalUserNum int // 本次测试用户总数 ChanUserOffline chan string ChanSendNum chan int ChanSuccessNum chan int ChanErrorNum chan int ChanCycleSuccessSendNum chan int ChanCycleResponseNum chan int ChanCycleSendNum chan int ChanCostTime chan int ChanConnectFailedNum chan int RunTicks int // 运行次数 // contains filtered or unexported fields }
func NewProfiler ¶
func NewProfiler() *Profiler
func (*Profiler) AddConnectFailedNum ¶
func (*Profiler) AddCurrentUserNum ¶
func (*Profiler) AddCurrentUserTotalNum ¶
func (*Profiler) AddCycleResponseNum ¶
func (*Profiler) AddCycleSendNum ¶
func (*Profiler) AddCycleSuccessSendNum ¶
func (*Profiler) AddErrorNum ¶
func (*Profiler) AddSendNum ¶
func (*Profiler) AddSuccessNum ¶
func (*Profiler) ExecuteCostTime ¶
type Robot ¶
type Robot struct { Account string Name string UID uint64 ExistUser bool //是否有创角 ServerId uint32 // 所属服务器ID WorldTCPClient xrtcp.Client WorldIP string WorldPort uint16 WorldToken string BattleGatewayTCPClient xrtcp.Client BattleGatewayInfo *battle_gateway_mgr.BattleGateway // 战斗网关信息. BattleGatewayToken string IsCompleteLogin bool // 是否完成登录流程(包括http登录,连接world服、battle gateway服,并拉取用户数据) IsPause bool // 是否暂停 InRoom uint32 // 是否在房间中 需要用atomic原子操作 所以用了uint32类型 InBattle bool // 战斗中 FrameMillisecond *xrtimer.Millisecond // 发送帧数据定时器 ServerFrameID uint32 // 服务器返回的帧ID LastSendFrameID uint32 // 上次发送给服务器的帧ID FrameHealthUpload uint32 // 服务器返回的帧同步健康值 SendMessageTimeMap sync.Map // 用户发送各个消息的开始时间 LastResultId uint32 // 上个请求结果 DBInventory *common_proto.DBInventory // 用户DB数据 // contains filtered or unexported fields }
func (*Robot) ConnectBGW ¶
func (p *Robot) ConnectBGW(OnParsePacket xrtcp.OnUnmarshalPacket, OnPacket xrtcp.OnPacket, OnDisconnect xrtcp.OnDisconnect) error
func (*Robot) ConnectWorld ¶
func (p *Robot) ConnectWorld(OnParsePacket xrtcp.OnUnmarshalPacket, OnPacket xrtcp.OnPacket, OnDisconnect xrtcp.OnDisconnect) error
func (*Robot) Online ¶
func (p *Robot) Online(OnParsePacket xrtcp.OnUnmarshalPacket, OnPacket xrtcp.OnPacket, OnDisconnect xrtcp.OnDisconnect) error
func (*Robot) ResetBattle ¶
func (p *Robot) ResetBattle()
func (*Robot) Send2World ¶
func (*Robot) StartMessageTicker ¶
func (p *Robot) StartMessageTicker()
type RobotMgr ¶
type RobotMgr struct { TimerMgr xrtimer.Mgr TimeMgr xrutil.TimeMgr EventChan chan interface{} OnlineRobotMap RobotMap //在线 OfflineRobotMap RobotMap //离线 BGSRobotMap RobotMap //在线 ReadyRobotChan chan interface{} //准备就绪(即将上线) robot }
var GRobotMgr RobotMgr
func (*RobotMgr) AddBGSRobot ¶
func (*RobotMgr) AddOfflineRobot ¶
func (*RobotMgr) AddOnlineRobot ¶
func (*RobotMgr) DelBGSRobot ¶
func (*RobotMgr) DelOfflineRobot ¶
func (*RobotMgr) DelOnlineRobot ¶
Click to show internal directories.
Click to hide internal directories.