Documentation
¶
Index ¶
- type HandlerPool
- func (h *HandlerPool) GetHandlers() map[string]*component.Handler
- func (h *HandlerPool) ProcessHandlerMessage(ctx context.Context, rt *route.Route, serializer serialize.Serializer, ...) ([]byte, error)
- func (h *HandlerPool) Register(serviceName string, name string, handler *component.Handler)
- func (h *HandlerPool) SetServices(services map[string]*component.Service)
- type HandlerService
- func (h *HandlerService) DispatchTimer()
- 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) SetClientVersion(v map[int]int)
- 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) DumpServices()
- func (r *RemoteService) ExtendRemote(svc, name string, remote *component.Remote) error
- 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) RpcInner(ctx context.Context, reply proto.Message, arg proto.Message, rt *route.Route) 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 ...
func (*HandlerPool) Register ¶
func (h *HandlerPool) Register(serviceName string, name string, handler *component.Handler)
Register ...
func (*HandlerPool) SetServices ¶
func (h *HandlerPool) SetServices(services map[string]*component.Service)
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, threadNum int, zoneId uint32, router *router.Router, ) *HandlerService
NewHandlerService creates and returns a new handler service
func (*HandlerService) DispatchTimer ¶
func (h *HandlerService) DispatchTimer()
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) SetClientVersion ¶
func (h *HandlerService) SetClientVersion(v map[int]int)
func (*HandlerService) SetHandlerHooks ¶
func (h *HandlerService) SetHandlerHooks(handlerHooks *pipeline.HandlerHooks)
type RemoteService ¶
type RemoteService struct { protos.UnimplementedPitayaServer // 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) DumpServices ¶
func (r *RemoteService) DumpServices()
DumpServices outputs all registered services
func (*RemoteService) ExtendRemote ¶
func (r *RemoteService) ExtendRemote(svc, name string, remote *component.Remote) error
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)
Click to show internal directories.
Click to hide internal directories.