"For developers", "Server scripts", "Functions description", "Users", "mHaltCID".
The function to shut down the remote MyChat Client application by his connection (Connection ID). The client application receives this command and, disconnects from the server and unloads from memory.
function mHaltCID(const iCID: int64): integer;
Parameter |
Type |
Value |
---|---|---|
iCID |
int64 |
connection unique ID; |
0 all OK, connection terminated successfully;
-1 unknown or incorrect CID;
-2 CID must be above zero;
The script for shutting down all Android applications connected to MyChat Server.
var
sCIDList: string;
iCount: integer;
begin
iCount := 0;
sCIDList := mGetCIDSByClientType('android');
while length(sCIDList) > 0 do
if mHaltCID(StrToInt64(Fetch(sCIDList, ','))) = 0 then inc(iCount);
mLogScript('Total MyChat Android apps halted: ' + IntToStr(iCount), '');
end.
[17:35:35] (Log "mHaltCID"): Total MyChat Android apps halted: 94
[17:35:35] (Run "mHaltCID"): Script operation time: 529 ms
[17:35:35] (Run "mHaltCID"): Script done successfully.
The Home screen displayed instead of MyChat for Android.