### Thread: Java chat server - release 1

Page 1 of 2 12 Last
1. #### Java chat server - release 1

http://forums.devshed.com/showpost.php?p=2113904&postcount=34

Read it, play with it, have yourselves some fun.

I will for a while leave my server on. Don't expect me to actually be checking anything or being online to talk to you.

I'm posting this in the lounge because it's really easy to just run this yourselves for whatever reason you want. No need for java expertise.

Hmm, maybe I should have a license for the program or something. Don't really care because nothing is groundbreaking.

Edit:
Developers, look into

• mikeyskona agrees : Nicely done :) .. could turn in to a very nice chat app. Maybe DevChat? hehehehe
Last edited by gimp; September 3rd, 2008 at 09:09 PM.
2. Todo list:

Shut down server command needs a small pause to allow clients to exit gracefully, as well as some slight tweaks.

Enabling user-pass control - when a client sends a packet, make sure it has the user-pass right. I don't see any way that it would hurt if it wasn't, but I don't see everything. Currently once you login you can send a packet and the server automatically gives you the right username etc.

Spam filter. Yeah.

Patcher. That's already in the works. This way when you connect the server will send you any patches necessary; program closes and you connect again.

Oh, and possibly a logout function... don't really want to though, too much hassle to log out and back in, just close the bloody program.

Last edited by gimp; September 4th, 2008 at 05:25 PM.
3. No Profile Picture
Contributing User
Devshed Novice (500 - 999 posts)

Join Date
Aug 2008
Location
Plymouth UK
Posts
934
Rep Power
160
Vista Ultimate - 32 Bit
running
java version "1.4.2_15"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_15-b02)
Java HotSpot(TM) Client VM (build 1.4.2_15-b02, mixed mode)

i get:
C:\Users\Mike>java c:\javaChat\Driver
Exception in thread "main" java.lang.NoClassDefFoundError: c:\javaChat\Driver

this me? or a bug? :| lol
4. Why in the blazing hell do you have 1.4? I use generics, I don't think 1.4 can even support my program. Upgrade your slow *** to 1.6
5. No Profile Picture
Contributing User
Devshed Novice (500 - 999 posts)

Join Date
Aug 2008
Location
Plymouth UK
Posts
934
Rep Power
160
Originally Posted by gimp
Why in the blazing hell do you have 1.4? I use generics, I don't think 1.4 can even support my program. Upgrade your slow *** to 1.6
ROFL.. Okay okay.. I dont use Java much <G>

doing it now :P
6. No Profile Picture
Contributing User
Devshed Novice (500 - 999 posts)

Join Date
Aug 2008
Location
Plymouth UK
Posts
934
Rep Power
160
hmph. Think i should give up :| lol

Code:
C:\Users\Mike>java c:\javaChat\Driver
Exception in thread "main" java.lang.NoClassDefFoundError: c:\javaChat\Driver
Caused by: java.lang.ClassNotFoundException: c:\javaChat\Driver
at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)

C:\Users\Mike>java -version
java version "1.6.0_07"
Java(TM) SE Runtime Environment (build 1.6.0_07-b06)
Java HotSpot(TM) Client VM (build 10.0-b23, mixed mode, sharing)
7. Seriously, it tells you what's wrong. dir to view files, find out what the hell you're doing wrong...
Last edited by gimp; September 3rd, 2008 at 08:09 PM.
8. No Profile Picture
Contributing User
Devshed Novice (500 - 999 posts)

Join Date
Aug 2008
Location
Plymouth UK
Posts
934
Rep Power
160
Originally Posted by gimp
Seriously, it tells you what's wrong. dir to view files, find out what the hell you're doing wrong...
LOL * smacks self in the head *

Ok, for some reason it wouldn't let me access it from my documents driver. Copied to C:\javaChat\ didn't wanna know. Eventually i cd'd to the directory, then just did java Driver and it worked

Nicely done
9. c:\Program Files (x86)\Java\jre1.6.0_05\bin>java.exe C:\Users\Danny\things\chat\
Driver
Exception in thread "main" java.lang.NoClassDefFoundError: C:\Users\Danny\things
\chat\Driver
Caused by: java.lang.ClassNotFoundException: C:\Users\Danny\things\chat\Driver
at java.net.URLClassLoader$1.run(Unknown Source) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(Unknown Source) at java.lang.ClassLoader.loadClass(Unknown Source) at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
I get the same issue, care to enlighten us?
10. No Profile Picture
Contributing User
Devshed Novice (500 - 999 posts)

Join Date
Aug 2008
Location
Plymouth UK
Posts
934
Rep Power
160
Originally Posted by misterdanny
I get the same issue, care to enlighten us?
see above danny

cd c:\path\to\the\folder

then just

java Driver

sorted it for me
11. I think gimp ought to alter the code so you don't have to run this from the same directory. I don't have the "java" enviroment variable set (I just set it and I have to reboot my machine for it to be active) so I have to run from the java bin directory. When I get an open chance I might reboot so I can check it out though.

(btw vista doesn't let you have spaces when typing in the full path to a program, it thinks your trying to send it arguments)
12. No Profile Picture
Contributing User
Devshed Novice (500 - 999 posts)

Join Date
Aug 2008
Location
Plymouth UK
Posts
934
Rep Power
160
Originally Posted by misterdanny
I think gimp ought to alter the code so you don't have to run this from the same directory. I don't have the "java" enviroment variable set (I just set it and I have to reboot my machine for it to be active) so I have to run from the java bin directory. When I get an open chance I might reboot so I can check it out though.

(btw vista doesn't let you have spaces when typing in the full path to a program, it thinks your trying to send it arguments)
in your case, as long as yu are in the chat apps folder you should be fine calling the absolute path to java. ie:

cd c:\path\to\folder
c:\path\to\java Driver

Should work

also cd "c:\path to a folder\with spaces in it\ whatever" should work tho
13. I just tried it with the quotes (didn't know I could do that!), but now i just get this

C:\Users\Danny\things\chat>cd "C:\Program Files (x86)\Java\jre1.6.0_05\bin\java.
exe" Driver
The system cannot find the path specified.

I think I may just have to reboot, I might go do that soon
14. No Profile Picture
Contributing User
Devshed Novice (500 - 999 posts)

Join Date
Aug 2008
Location
Plymouth UK
Posts
934
Rep Power
160
Originally Posted by misterdanny
I just tried it with the quotes (didn't know I could do that!), but now i just get this

C:\Users\Danny\things\chat>cd "C:\Program Files (x86)\Java\jre1.6.0_05\bin\java.
exe" Driver
The system cannot find the path specified.

I think I may just have to reboot, I might go do that soon
cd "C:\Program Files (x86)\Java\jre1.6.0_05\bin\"
<hit enter>
java.exe Driver

should do it :|
15. No Profile Picture
Contributing User
Devshed Novice (500 - 999 posts)

Join Date
Aug 2008
Location
Plymouth UK
Posts
934
Rep Power
160
oops scrap that... i wasn't paying attention.

cd c:\path\to\gimps\app
then
"C:\Program Files (x86)\Java\jre1.6.0_05\bin\java.
exe" Driver

that should do it lol
Page 1 of 2 12 Last