Documentation ¶
Index ¶
- type HandlerPool
- type HandlerService
- func (h *HandlerService) Dispatch(thread int)
- func (h *HandlerService) Docs(getPtrNames bool) (map[string]interface{}, error)
- func (h *HandlerService) DumpServices()
- func (h *HandlerService) Handle(conn acceptor.PlayerConn)
- func (h *HandlerService) Register(comp component.Component, opts []component.Option) error
- func (h *HandlerService) SetHandlerHooks(handlerHooks *pipeline.HandlerHooks)
- type RemoteService
- func (r *RemoteService) AddRemoteBindingListener(bindingListener cluster.RemoteBindingListener)
- func (r *RemoteService) Call(ctx context.Context, req *protos.Request) (*protos.Response, error)
- func (r *RemoteService) DoRPC(ctx context.Context, serverID string, route *route.Route, protoData []byte) (*protos.Response, error)
- func (r *RemoteService) Docs(getPtrNames bool) (map[string]interface{}, error)
- func (r *RemoteService) DumpServices()
- func (r *RemoteService) KickUser(ctx context.Context, kick *protos.KickMsg) (*protos.KickAnswer, error)
- func (r *RemoteService) PushToUser(ctx context.Context, push *protos.Push) (*protos.Response, error)
- func (r *RemoteService) RPC(ctx context.Context, serverID string, route *route.Route, reply proto.Message, ...) error
- func (r *RemoteService) Register(comp component.Component, opts []component.Option) error
- func (r *RemoteService) SessionBindRemote(ctx context.Context, msg *protos.BindMsg) (*protos.Response, error)
- func (h *RemoteService) SetHandlerHooks(handlerHooks *pipeline.HandlerHooks)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerPool ¶
type HandlerPool struct {
// contains filtered or unexported fields
}
HandlerPool ...
func (*HandlerPool) GetHandlers ¶
func (h *HandlerPool) GetHandlers() map[string]*component.Handler
GetHandlers ...
func (*HandlerPool) ProcessHandlerMessage ¶
func (h *HandlerPool) ProcessHandlerMessage( ctx context.Context, rt *route.Route, serializer serialize.Serializer, handlerHooks *pipeline.HandlerHooks, session session.Session, data []byte, msgTypeIface interface{}, remote bool, ) ([]byte, error)
ProcessHandlerMessage ...
type HandlerService ¶
type HandlerService struct {
// contains filtered or unexported fields
}
HandlerService service
func NewHandlerService ¶
func NewHandlerService( packetDecoder codec.PacketDecoder, serializer serialize.Serializer, localProcessBufferSize int, remoteProcessBufferSize int, server *cluster.Server, remoteService *RemoteService, agentFactory agent.AgentFactory, metricsReporters []metrics.Reporter, handlerHooks *pipeline.HandlerHooks, handlerPool *HandlerPool, ) *HandlerService
NewHandlerService creates and returns a new handler service
func (*HandlerService) Dispatch ¶
func (h *HandlerService) Dispatch(thread int)
Dispatch message to corresponding logic handler
func (*HandlerService) Docs ¶
func (h *HandlerService) Docs(getPtrNames bool) (map[string]interface{}, error)
Docs returns documentation for handlers
func (*HandlerService) DumpServices ¶
func (h *HandlerService) DumpServices()
DumpServices outputs all registered services
func (*HandlerService) Handle ¶
func (h *HandlerService) Handle(conn acceptor.PlayerConn)
Handle handles messages from a conn
func (*HandlerService) SetHandlerHooks ¶
func (h *HandlerService) SetHandlerHooks(handlerHooks *pipeline.HandlerHooks)
type RemoteService ¶
type RemoteService struct {
// contains filtered or unexported fields
}
RemoteService struct
func NewRemoteService ¶
func NewRemoteService( rpcClient cluster.RPCClient, rpcServer cluster.RPCServer, sd cluster.ServiceDiscovery, encoder codec.PacketEncoder, serializer serialize.Serializer, router *router.Router, messageEncoder message.Encoder, server *cluster.Server, sessionPool session.SessionPool, handlerHooks *pipeline.HandlerHooks, handlerPool *HandlerPool, ) *RemoteService
NewRemoteService creates and return a new RemoteService
func (*RemoteService) AddRemoteBindingListener ¶
func (r *RemoteService) AddRemoteBindingListener(bindingListener cluster.RemoteBindingListener)
AddRemoteBindingListener adds a listener
func (*RemoteService) DoRPC ¶
func (r *RemoteService) DoRPC(ctx context.Context, serverID string, route *route.Route, protoData []byte) (*protos.Response, error)
DoRPC do rpc and get answer
func (*RemoteService) Docs ¶
func (r *RemoteService) Docs(getPtrNames bool) (map[string]interface{}, error)
Docs returns documentation for remotes
func (*RemoteService) DumpServices ¶
func (r *RemoteService) DumpServices()
DumpServices outputs all registered services
func (*RemoteService) KickUser ¶
func (r *RemoteService) KickUser(ctx context.Context, kick *protos.KickMsg) (*protos.KickAnswer, error)
KickUser sends a kick to user
func (*RemoteService) PushToUser ¶
func (r *RemoteService) PushToUser(ctx context.Context, push *protos.Push) (*protos.Response, error)
PushToUser sends a push to user
func (*RemoteService) RPC ¶
func (r *RemoteService) RPC(ctx context.Context, serverID string, route *route.Route, reply proto.Message, arg proto.Message) error
RPC makes rpcs
func (*RemoteService) SessionBindRemote ¶
func (r *RemoteService) SessionBindRemote(ctx context.Context, msg *protos.BindMsg) (*protos.Response, error)
SessionBindRemote is called when a remote server binds a user session and want us to acknowledge it
func (*RemoteService) SetHandlerHooks ¶
func (h *RemoteService) SetHandlerHooks(handlerHooks *pipeline.HandlerHooks)