Server Plug-in
ProPTT2 server has plug-in architectures. Developers can make a plug-in to extend server's features.
Please note the plug-in could have performance issues. Because it will work in a server process.
So all heavy functions would be implemanted by async to avoid the performance issues
Structure
PTTPlugin
This is a interface to plug in a PTT server(package 2.0.0~) and a Link server(package 8.1.0~).SDK tunneling (package 6.0.0~, SDK4~)
SDK can communicate with Plugin through SDK API and a PTT server's plugin(V4)'s events.Customer's developers can add their logic in PTT server.
IPTTPlugin
ICallback4 :void OnClientDirectMessage(String userId, String message)
IPTTPlugin4 :
public void sendToChannel(int channelId, String message)
public void sendToUser(String userStrId, String message)
public void sendToCompanyUsers(int companyId, String message)
ProPTT2 SDK
PTTClient :int sendMessageToServerPlugin(string message)
void onPublicMessageReceivedFromServerPlugin(string message)
void onPrivateMessageReceivedFromServerPlugin(string message)
PTTChannel :
void onMessageReceivedFromServerPlugin(string message)
Description
1) PTTClient -> PTTPluginsendMessageToServerPlugin -> OnClientDirectMessage
2) PTTPlugin -> PTTClient
sendToChannel -> onMessageReceivedFromServerPlugin
sendToUser -> onPrivateMessageReceivedFromServerPlugin
sendToCompanyUsers -> onPublicMessageReceivedFromServerPlugin