Documentation ¶
Index ¶
- func NewFlags() []cli.Flag
- type AccountManager
- func (am *AccountManager) AccountExecute(sock transport.Socket, execHandler player.ExecutorHandler) error
- func (am *AccountManager) AccountLogon(ctx context.Context, userID int64, accountID int64, accountName string, ...) error
- func (am *AccountManager) BroadCast(msg proto.Message)
- func (am *AccountManager) CreatePlayer(acct *player.Account, name string) (*player.Player, error)
- func (am *AccountManager) Exit()
- func (am *AccountManager) GetAccountByID(acctId int64) *player.Account
- func (am *AccountManager) GetAccountBySock(sock transport.Socket) *player.Account
- func (am *AccountManager) GetAllAccounts() []*player.Account
- func (am *AccountManager) GetLitePlayer(playerId int64) (player.LitePlayer, error)
- func (am *AccountManager) GetPlayerByAccount(acct *player.Account) (*player.Player, error)
- func (am *AccountManager) Main(ctx context.Context) error
- func (am *AccountManager) OnLitePlayerEvicted(key lru.Key, value interface{})
- func (am *AccountManager) Run(ctx context.Context) error
- func (am *AccountManager) SelectPlayer(acct *player.Account, id int64) (*player.Player, error)
- type Game
- type GinServer
- type MC_AccountTest
- type MicroService
- type MsgHandler
- type PubSub
- type RpcHandler
- func (h *RpcHandler) CallGetGateStatus(ctx context.Context) (*pbGate.GetGateStatusReply, error)
- func (h *RpcHandler) CallGetRemoteLitePlayer(playerID int64) (*pbGame.GetRemoteLitePlayerReply, error)
- func (h *RpcHandler) CallStartStageCombat(p *player.Player) (*pbCombat.StartStageCombatReply, error)
- func (h *RpcHandler) CallSyncPlayerInfo(userId int64, info *player.LitePlayer) (*pbGate.SyncPlayerInfoReply, error)
- func (h *RpcHandler) CallUpdateUserInfo(c *player.Account) (*pbGate.GateEmptyMessage, error)
- func (h *RpcHandler) GetRemoteLitePlayer(ctx context.Context, req *pbGame.GetRemoteLitePlayerRequest, ...) error
- func (h *RpcHandler) UpdatePlayerExp(ctx context.Context, req *pbGame.UpdatePlayerExpRequest, ...) error
- type TcpServer
- type WsServer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type AccountManager ¶
func NewAccountManager ¶
func NewAccountManager(g *Game, ctx *cli.Context) *AccountManager
func (*AccountManager) AccountExecute ¶
func (am *AccountManager) AccountExecute(sock transport.Socket, execHandler player.ExecutorHandler) error
add handler to account's execute channel, will be dealed by account's run goroutine
func (*AccountManager) AccountLogon ¶
func (*AccountManager) BroadCast ¶
func (am *AccountManager) BroadCast(msg proto.Message)
func (*AccountManager) CreatePlayer ¶
func (*AccountManager) Exit ¶
func (am *AccountManager) Exit()
func (*AccountManager) GetAccountByID ¶
func (am *AccountManager) GetAccountByID(acctId int64) *player.Account
func (*AccountManager) GetAccountBySock ¶
func (am *AccountManager) GetAccountBySock(sock transport.Socket) *player.Account
func (*AccountManager) GetAllAccounts ¶
func (am *AccountManager) GetAllAccounts() []*player.Account
func (*AccountManager) GetLitePlayer ¶
func (am *AccountManager) GetLitePlayer(playerId int64) (player.LitePlayer, error)
func (*AccountManager) GetPlayerByAccount ¶
func (*AccountManager) OnLitePlayerEvicted ¶
func (am *AccountManager) OnLitePlayerEvicted(key lru.Key, value interface{})
func (*AccountManager) SelectPlayer ¶
todo omitempty
type Game ¶
type Game struct { ID int16 SectionID int16 sync.RWMutex // contains filtered or unexported fields }
type GinServer ¶
type GinServer struct {
// contains filtered or unexported fields
}
func NewGinServer ¶
type MC_AccountTest ¶
type MC_AccountTest struct { AccountId int64 `protobuf:"varint,1,opt,name=account_id,json=accountId,proto3" json:"account_id,omitempty"` Name string `protobuf:"bytes,2,opt,name=name,proto3" json:"name,omitempty"` }
func (*MC_AccountTest) GetName ¶
func (msg *MC_AccountTest) GetName() string
type MicroService ¶
type MicroService struct {
// contains filtered or unexported fields
}
func NewMicroService ¶
func NewMicroService(g *Game, c *ucli.Context) *MicroService
func (*MicroService) Run ¶
func (s *MicroService) Run() error
type MsgHandler ¶
type MsgHandler struct {
// contains filtered or unexported fields
}
func NewMsgHandler ¶
func NewMsgHandler(g *Game) *MsgHandler
type PubSub ¶
type PubSub struct {
// contains filtered or unexported fields
}
func (*PubSub) PubStartGate ¶
/////////////////////////////////// publish handle ///////////////////////////////////
func (*PubSub) PubSyncPlayerInfo ¶
type RpcHandler ¶
type RpcHandler struct {
// contains filtered or unexported fields
}
func NewRpcHandler ¶
func NewRpcHandler(g *Game) *RpcHandler
func (*RpcHandler) CallGetGateStatus ¶
func (h *RpcHandler) CallGetGateStatus(ctx context.Context) (*pbGate.GetGateStatusReply, error)
/////////////////////////////////////////// rpc call ///////////////////////////////////////////
func (*RpcHandler) CallGetRemoteLitePlayer ¶
func (h *RpcHandler) CallGetRemoteLitePlayer(playerID int64) (*pbGame.GetRemoteLitePlayerReply, error)
func (*RpcHandler) CallStartStageCombat ¶
func (h *RpcHandler) CallStartStageCombat(p *player.Player) (*pbCombat.StartStageCombatReply, error)
func (*RpcHandler) CallSyncPlayerInfo ¶
func (h *RpcHandler) CallSyncPlayerInfo(userId int64, info *player.LitePlayer) (*pbGate.SyncPlayerInfoReply, error)
func (*RpcHandler) CallUpdateUserInfo ¶
func (h *RpcHandler) CallUpdateUserInfo(c *player.Account) (*pbGate.GateEmptyMessage, error)
func (*RpcHandler) GetRemoteLitePlayer ¶
func (h *RpcHandler) GetRemoteLitePlayer(ctx context.Context, req *pbGame.GetRemoteLitePlayerRequest, rsp *pbGame.GetRemoteLitePlayerReply) error
/////////////////////////////////////////// rpc receive ///////////////////////////////////////////
func (*RpcHandler) UpdatePlayerExp ¶
func (h *RpcHandler) UpdatePlayerExp(ctx context.Context, req *pbGame.UpdatePlayerExpRequest, rsp *pbGame.UpdatePlayerExpReply) error
type TcpServer ¶
type TcpServer struct {
// contains filtered or unexported fields
}
func NewTcpServer ¶
Source Files ¶
Click to show internal directories.
Click to hide internal directories.