"For developers", "Server scripts", "Functions description", "Users", "mKillUIN".
The function for disconnecting all online applications logged in on the server under the specified UIN.
As a rule, all MyChat applications — except MyChat WEB services (Kanban, forum, WEB chat, MyChat Guest, and Admin Panel) — automatically reconnect to the server after disconnection.
function mKillUIN(iUIN: integer): integer;
Parameter |
Type |
Value |
---|---|---|
iUIN |
integer |
user's unique ID. |
>0 |
All OK, a user is offline, the result is equal to the number of user's disconnected instances on the server; |
-1 |
you can't disconnect the built-in bot UIN 0 from the server; |
-2 |
UIN must be above zero; |
-3 |
specified user is currently disconnected from the server (offline). |
The script for immediate disconnection of all online users on MyChat Server.
const
STATE_ONLINE = 0;
var
sUsers: string;
iUIN: integer;
begin
sUsers := mGetUsersListByState(STATE_ONLINE);
while length(sUsers) > 0 do begin
iUIN := StrToIntDef(Fetch(sUsers, ','), -1);
if iUIN > 0 then mKillUIN(iUIN);
end;
end.