I am having abit of problem with the code before I want it to check to see if a user is the mic handly and if there are it will allow them to remove mic if not then it would just exit or have a null effect!, the problem is when i try the code it removes the mic from only the mic handlyer side and no the rest of the clients.
can anyone help?
thanks alot
can anyone help?
Code:
if (com = 'DelMic') then
begin
for i := 0 to MainServer.Socket.ActiveConnections - 1 do
begin
if lowercase(MainServer.Socket.Connections[i].Room) = lowercase(dat[1]) then
begin
if dat[0] = RoomsTable.FieldByName('Talker').AsString then // check user with talker entry in database
begin
MainServer.Socket.Connections[i].SendText(CodeStr('šDelMicœ' // send remove chater command
+ dat[0] + 'œ' // user name
+ dat[1] + 'œ')); // room name
if lowercase(MainServer.Socket.Connections[i].Name) = lowercase(dat[0]) then
MainServer.Socket.Connections[i].Speak := False;
end;
if RoomsTable.Locate('Name', dat[1], [locaseinsensitive]) then
begin
RoomsTable.Edit;
RoomsTable.FieldByName('Talker').AsString := 'FREE'; // update database entry
RoomsTable.Post;
end
else
exit; // stop other clients from setting there mic when a other user is using mic!
end;
end;
end;
thanks alot