can anyone help me here I am making a basic kick system for my small lanchat and I am having problems with abit of code I have my client and server working fine there both send and get the right name that I want to be kick from my chat however when there is more then 3 people in room it kicks everyone one of the room other then the person kicking can anyone help me out I pu both server and client codes below
if command = 'KICKUSER' then
username := GetByTab(egg,1); // gets username
if ListBox1.Items.IndexOf(username) >=0 then
Broadcast(Socket,'KICKUSEROFF'+chr(9)+username); sends username back to client to be kicked
procedure TForm1.Kick1Click(Sender: TObject);
if loginname = lstMembers.Selected.Caption then
// take no action
if not assigned(lstMembers.Selected) then Exit;
if MessageDlg('Are you sure you want to kick '+ lstMembers.Selected.Caption, mtInformation, [mbYes, mbNo], 0) = mrYes then
bkicking := True;
SendData('KICKUSER',lstMembers.Selected.Caption); // sends the user that is being kick to server
Reads info from server IE name to be kicked!
if (GetByTab(egg,0) = 'KICKUSEROFF') and (not bkicking) then
bkicking := true; // I think it has sumthing to do with this I need to make everyone else in chat be true but the person that is being kick false.
Connect1.Enabled := True;
Disconnect1.Enabled := False;
Timer1.Enabled := False;
prefs.LabeledEdit2.Enabled := True;
prefs.LabeledEdit2.ReadOnly := False;
SendData('LOGOUT',GetByTab(egg,1)); // logoff the user that has been kicked
Application.MessageBox(PChar('You have just been kick by a room moderator.'), 'System Information', mb_Ok);
hope you can help me!!!