Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

TCP/IP Server+Client Chat Script (w/ Features)


  • Please log in to reply
131 replies to this topic

Poll: Would you use this script? (36 member(s) have cast votes)

Would you use this script?

  1. Yes (34 votes [72.34%])

    Percentage of vote: 72.34%

  2. No (3 votes [6.38%])

    Percentage of vote: 6.38%

  3. Frequently (5 votes [10.64%])

    Percentage of vote: 10.64%

  4. Maybe once or Twice (5 votes [10.64%])

    Percentage of vote: 10.64%

Vote Guests cannot vote
  • Guests
  • Last active:
  • Joined: --
Also, The read only edit control you have on the right (User List) should be a Listbox, that way you could simply select a user's name and click boot, and also by using a Listbox you could work in a context menu (if I'm not mistaken) so you could right click a users name for options like an IRC client.
:)

jmanx
  • Members
  • 110 posts
  • Last active: Mar 20 2011 07:55 PM
  • Joined: 14 May 2008

When I use my server all the clients are already compiled so I dont have to worry about that problem, but it wouldn't be hard for the server to decline messages that are redundant.

When you talk in the client it goes like so

Message "hi" sent to server
Server reads message and logs it
Server sends message "hi" back to you and all other clients.

With this routine, I can easily make it decline any SR1 or RX2 messages since the server sends those to the clients, not clients to server. I can also make it so messages coming in that DO NOT have a client name from the user list attached will be ignored. Also since you cannot use the same nickname as someone else, if the server receives any connected or disconnected messages from someone who IS or ISN'T on the userlist, will be ignored.

The Listbox idea doesn't sound bad.
Going to wait till I'm in a better mood to fix those details.

The only one I can think of that would be somewhat difficult to prevent is someone removing the kicking feature to dodge a kick.



EDIT: Decided not to finish this cause the server was conflicting when it would receive messages that it was intending to block. I guess I could try a way around that but I remember that the source is posted here to display all the functions and should be compiled before distribution. (if that be intended)
 



NLI-C
  • Guests
  • Last active:
  • Joined: --

The only one I can think of that would be somewhat difficult to prevent is someone removing the kicking feature to dodge a kick.

Maybe you should add an "Unvoice" feature, where the user could still read the chat but the server would not distribute the user's messages.

A safe method could be used for kicking, if the the server could have a list of all "Accepted Users", and when a user is "kicked" he or she is removed from the "Accepted Users" list, so the server will not distribute the user's messages and will not send other user's messages to the person.

Hope you understood that. I don't really know how to explain it that well.

What theme are you using?!?!? lol

Repkam09
  • Members
  • 15 posts
  • Last active: Feb 26 2011 04:07 PM
  • Joined: 11 Feb 2008
very cool!

and for the reoccurring question: what theme is that :shock:
[repkam09]
AHK Beginner :p

jmanx
  • Members
  • 110 posts
  • Last active: Mar 20 2011 07:55 PM
  • Joined: 14 May 2008

I get what your saying with the allowed list and it would be a safe feature to add to the server side to not allow kicked users to talk. This would be a good defense against people removing the kick function from their script.

I guess in addition with that, everytime a user connects they would be added to the list and vice versa when they disconnect.



  • Guests
  • Last active:
  • Joined: --
so um.......



WHAT THEME




:wink:

jmanx
  • Members
  • 110 posts
  • Last active: Mar 20 2011 07:55 PM
  • Joined: 14 May 2008

It's a Windows Blinds skin I made.



Slanter
  • Members
  • 739 posts
  • Last active: Jul 08 2011 05:26 AM
  • Joined: 28 May 2008
Awesome script

One suggestion, rather than using direct paths like "C:\WINDOWS\system32\narrator.exe" you should use "%A_WinDir%\system32\narrator.exe". I had to change that in the script before it would work, because my windows directory is at C:\WINNT\

jmanx
  • Members
  • 110 posts
  • Last active: Mar 20 2011 07:55 PM
  • Joined: 14 May 2008

fixed, thanks for pointing that out


also all the %a_desktop%s have been changed to %A_Windir%
Just to keep the txts out of your hair on the desktop
 



n-l-i-d
  • Guests
  • Last active:
  • Joined: --
Nice script.. but an urgent "suggestion": get rid of these paths alltogether:

C:\clientinfo.ini
C:\pinger.bat
C:\Pinglog.txt
%A_WinDir%\1.txt
%A_WinDir%\2.txt
%A_Windir%\i2l.txt
%A_Windir%\client.txt
%A_Windir%\userlistc.txt
%A_Windir%\usernamestemp.txt
%A_Windir%\server.txt
%A_Windir%\usertemp.txt

etc., and replace them with paths to A_ScriptDir (or a tmp folder in your script directory, or the real TEMP directory). It is very sloppy to place your files in the system directories (where you place them now), they simply don't belong there, because they have nothing to do with your system nor your root-directory.

Fry
  • Members
  • 885 posts
  • Last active: Jan 17 2011 09:57 PM
  • Joined: 01 Nov 2007
@n-l-i-d

I think the files should stay in the current directories

Its not in the way of the user, as was when they were on the Desktop.

If they were put in the temp directory they might get deleted by a full history clear or another program, such as CCleaner.
This would cause problems with the Chat Script.

The root directory should not even be mentioned in your post.
As the root directory is just not where user folders are, its like another desktop.

I see your argument about system directory, but with the root directory it is unnecessary.

jmanx
  • Members
  • 110 posts
  • Last active: Mar 20 2011 07:55 PM
  • Joined: 14 May 2008

I see both your points and what I could do is write a temporary directory IN the win directory. This way, it's kept all together but still aside.

However, C:\clientinfo.ini needs to stay where it's at being as it's not just a temporary file.
 



n-l-i-d
  • Guests
  • Last active:
  • Joined: --
Again, why use the Windows system directory, if the program is not related to a system function? Some users will run into permissions problems with this anyway. You can simply put your script in a folder with a temp subfolder for the files you overwrite, and put the permanent file in the same "root" folder with the script.

C:/path/to/your/script/folder/script.ahk
C:/path/to/your/script/folder/permanent.txt
C:/path/to/your/script/folder/temp/temporary1.txt
C:/path/to/your/script/folder/temp/temporary2.txt
etc.

This way, if the user removes the script-folder, all related files will be removed too (and there will be no junk files left in the system folder)

Fry
  • Members
  • 885 posts
  • Last active: Jan 17 2011 09:57 PM
  • Joined: 01 Nov 2007
@n-l-i-d

jmanx just stated he will make a temporary file IN the win directory, which will most likely be deleted when the script is exitd , which fixes the junk files problem.

Also why does this concern you so much?
It does not harm you in anyway, so why care about it?


@jmanx I was agaisnt n-l-i-d, sorry for the confusion
Also your chat server is down, get it back up


n-l-i-d
  • Guests
  • Last active:
  • Joined: --
:lol:

Well, it really doesn't matter that much, but - I feel - it's cleaner and more user friendly.

And, if the script fails to delete the files in the system directory, it might be hard to get rid of them (distinguish them from the "real" system files). Nobody likes a clogged (and slow) system. Isn't that why you use CCleaner in the first place? :wink: