MyChat Server event: OnClientRemoteExec, run a server script from MyChat Client
Client applications can call a server script and transfer parameters if allowed by rights.
Event template
procedure OnClientRemoteExec(iUIN, iCID: integer; sCmd, sData, sAppType: string);
begin
// your own code
end;
begin
end.
You can put your code instead of the comment.
Description of parameters
Parameter |
Type |
You can put your code instead of the comment.alue |
iUIN |
integer |
unique identifier of the command sender (number > 0); |
iCID |
integer |
Connection ID of a client-sender, unique session identifier in an online structure of network connections to the server; |
sCmd |
string |
command name for convenient separation of client requests; |
sData |
string |
command parameters, any text string, usually JSON for convenience; |
sAppType |
string |
Example
A user has custom menu. The clicking on the menu item ("OpenPrivateSupport") must run a script and reveice information on behalf of a built-in bot in a private dialogue, and mandatory switch the focus to a private dialogue with UIN=0.
procedure OnClientRemoteExec(iUIN, iCID: integer; sCmd, sData, sAppType: string);
begin
if sCmd = 'OpenPrivateSupport' then begin
mSendPrivateMessage(0, iUIN, 'Hello world. Custom data is:" ' + sData + '"', 1);
mSetRemoteClientCurrentPlaceID(iUIN, 0, 1, false);
end;
end;
begin
end.