Page 1 of 2 12 Last
  • Jump to page:
    #1
  1. <?PHP user_title("gimp"); ?>
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2005
    Location
    Internet
    Posts
    7,652
    Rep Power
    6084

    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
    ServerController.processAuthRequest(Packet p, AccountHandler source) to find out how to make a real login instead of just username same as password.

    Comments on this post

    • 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.
    Chat Server Project & Tutorial | WiFi-remote-control sailboat (building) | Joke Thread
    “Rational thinkers deplore the excesses of democracy; it abuses the individual and elevates the mob. The death of Socrates was its finest fruit.”
    Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken. Use TODO to leave yourself reminders. Calling a program finished before all these points are checked off is lazy.
    -Partial Credit: Sun

    If I ask you to redescribe your problem, it's because when you describe issues in detail, you often get a *click* and you suddenly know the solutions.
    Ches Koblents
  2. #2
  3. <?PHP user_title("gimp"); ?>
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2005
    Location
    Internet
    Posts
    7,652
    Rep Power
    6084
    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.

    Edit: Oh, and make username/roomname comparisons ignore case. Forgot about that.
    Last edited by gimp; September 4th, 2008 at 05:25 PM.
    Chat Server Project & Tutorial | WiFi-remote-control sailboat (building) | Joke Thread
    “Rational thinkers deplore the excesses of democracy; it abuses the individual and elevates the mob. The death of Socrates was its finest fruit.”
    Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken. Use TODO to leave yourself reminders. Calling a program finished before all these points are checked off is lazy.
    -Partial Credit: Sun

    If I ask you to redescribe your problem, it's because when you describe issues in detail, you often get a *click* and you suddenly know the solutions.
    Ches Koblents
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2008
    Location
    Plymouth UK
    Posts
    956
    Rep Power
    155
    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
  6. #4
  7. <?PHP user_title("gimp"); ?>
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2005
    Location
    Internet
    Posts
    7,652
    Rep Power
    6084
    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
    Chat Server Project & Tutorial | WiFi-remote-control sailboat (building) | Joke Thread
    “Rational thinkers deplore the excesses of democracy; it abuses the individual and elevates the mob. The death of Socrates was its finest fruit.”
    Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken. Use TODO to leave yourself reminders. Calling a program finished before all these points are checked off is lazy.
    -Partial Credit: Sun

    If I ask you to redescribe your problem, it's because when you describe issues in detail, you often get a *click* and you suddenly know the solutions.
    Ches Koblents
  8. #5
  9. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2008
    Location
    Plymouth UK
    Posts
    956
    Rep Power
    155
    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
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2008
    Location
    Plymouth UK
    Posts
    956
    Rep Power
    155
    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)
            at java.lang.ClassLoader.loadClass(Unknown Source)
            at java.lang.ClassLoader.loadClassInternal(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)
  12. #7
  13. <?PHP user_title("gimp"); ?>
    Devshed Supreme Being (6500+ posts)

    Join Date
    Jan 2005
    Location
    Internet
    Posts
    7,652
    Rep Power
    6084
    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.
    Chat Server Project & Tutorial | WiFi-remote-control sailboat (building) | Joke Thread
    “Rational thinkers deplore the excesses of democracy; it abuses the individual and elevates the mob. The death of Socrates was its finest fruit.”
    Use XXX in a comment to flag something that is bogus but works. Use FIXME to flag something that is bogus and broken. Use TODO to leave yourself reminders. Calling a program finished before all these points are checked off is lazy.
    -Partial Credit: Sun

    If I ask you to redescribe your problem, it's because when you describe issues in detail, you often get a *click* and you suddenly know the solutions.
    Ches Koblents
  14. #8
  15. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2008
    Location
    Plymouth UK
    Posts
    956
    Rep Power
    155
    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
  16. #9
  17. Null Pointer Exception
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2006
    Location
    america
    Posts
    3,355
    Rep Power
    1579
    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)
    at java.lang.ClassLoader.loadClass(Unknown Source)
    at java.lang.ClassLoader.loadClassInternal(Unknown Source)
    I get the same issue, care to enlighten us?
  18. #10
  19. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2008
    Location
    Plymouth UK
    Posts
    956
    Rep Power
    155
    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
  20. #11
  21. Null Pointer Exception
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2006
    Location
    america
    Posts
    3,355
    Rep Power
    1579
    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)
  22. #12
  23. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2008
    Location
    Plymouth UK
    Posts
    956
    Rep Power
    155
    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
  24. #13
  25. Null Pointer Exception
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Mar 2006
    Location
    america
    Posts
    3,355
    Rep Power
    1579
    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
  26. #14
  27. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2008
    Location
    Plymouth UK
    Posts
    956
    Rep Power
    155
    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 :|
  28. #15
  29. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Aug 2008
    Location
    Plymouth UK
    Posts
    956
    Rep Power
    155
    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
  • Jump to page:

IMN logo majestic logo threadwatch logo seochat tools logo