-
Notifications
You must be signed in to change notification settings - Fork 21
Service模块
zerlenzhang edited this page Mar 5, 2020
·
1 revision
给服务号注册服务,这样,在Netbus收到这样服务号的CmdPackage消息时,会调用这个服务的方法去处理该消息
-
注册使用CmdPackage的服务
-
args:
- serviceType : int
- service : Service
`local service = {
OnSessionRecvCmd=function(session,cmdPackage)end, // 必须
OnSessionDisconnected=function(session,serviceType)end, // 必须
OnSessionConnected=function(session,serviceType)end, // 可选
});
Service.Register(serviceType,service);`
-
注册使用RawPackage的服务,推荐用于网关
-
args:
- serviceType : int
- service : Service
`local rawService = {
OnSessionRecvRaw=function(session,rawPackage)end, // 必须
OnSessionDisconnected=function(session,serviceType)end, // 必须
OnSessionConnected=function(session,serviceType)end, // 可选
});
Service.RegisterRaw(serviceType,rawService );`