Welcome to the RaGEZONE - MMORPG development forums.

Gamma 1.0 - r63 [Java Emulator, Multithreaded]

This is a discussion on Gamma 1.0 - r63 [Java Emulator, Multithreaded] within the Habbo Releases forums, part of the Habbo Hotel category; Gamma The section get's shitty after a while from seeing so much customs, cms and C# releases. So I decided ...

Page 1 of 2 12 LastLast
Results 1 to 15 of 21
  1. #1
    Alpha Member
    Rank
    Alpha Member
    Join Date
    Dec 2010
    Location
    Essos
    Posts
    2,306
    Liked
    1504

    Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Click
    Gamma

    The section get's shitty after a while from seeing so much customs, cms and C# releases. So I decided to add in a little bit of spice by creating a multi-threaded JAVA server. It doesn't use Netty at all or any other addons.

    Please read this important note:

    Gamma is unfinished, do not use it for a hotel. It is only for educational purposes. Please do not ask for help in this thread or how to open it.

    Features


    • Hardcoded packet handling (thaaa best feature evarrr)
    • Thread manager.
    • Allows one ip per connection
    • Multi-threaded


    How does it work?

    Well it's simple. Every time there is a new connection, a new thread is created to handle it. This allows multi-tasking when handling clients.

    How do I change the port?

    Go to environment.java and you'll see where to change it.

    Can we see some code?

    Code:
    package gamma.threading;
    
    import gamma.main.Environment;
    
    
    import java.net.Socket;
    import java.util.HashMap;
    import java.util.Map;
    
    
    public class GammaThreadManager
    {
        private Map<String, GammaThread> Clients;
        private Map<GammaThread, Thread> Threads;
        
        public GammaThreadManager()
        {
            this.Clients = new HashMap<String, GammaThread>();
            this.Threads = new HashMap<GammaThread, Thread>();
        }
        
        public void AcceptClient(Socket Client)
        {
            /*
             * Get existing thread if possible
             */
            GammaThread _existingThread = Clients.get(this.getIp(Client));
            
            /*
             * Check for existing ip address and dispose them
             */
            if (_existingThread != null)
            {
                /*
                 * Stop thread.
                 */
                Clients.get(this.getIp(Client)).Disposed = true;
                Threads.get(_existingThread).interrupt();
                
                /*
                 * Remove both
                 */
                Clients.remove(this.getIp(Client));
                Threads.remove(_existingThread);
            }
            
            /*
             * Add client to map.
             */
            GammaThread _gThread = new GammaThread(Client);
            
            this.Clients.put(this.getIp(Client), _gThread);
            
            /*
             * Add new thread to map.
             */
            this.Threads.put(_gThread, new Thread(_gThread));
            
            /*
             * Start thread.
             */
            this.Threads.get(_gThread).start();
        }
        
        public String getIp(Socket Socket)
        {
            return Socket.getLocalAddress().toString().replace("/", "");
        }
    }

    A picture



    Download




    Good release? Like or rep me <3
    Last edited by Quackster; 09-05-12 at 06:07 AM.
    follow me on twitter!
    https://twitter.com/Quackster_


  2. #2
    @_Prizm
    Rank
    Subscriber
    Join Date
    Feb 2012
    Location
    Denmark
    Posts
    2,141
    Liked
    518
    PSN ID: InfraRedDude Steam ID: lehprizm

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Thanks you ate a legend!

  3. #3
    Skittle-Panda
    Rank
    Member +
    Join Date
    Jun 2009
    Location
    Netherlands
    Posts
    959
    Liked
    139

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Great release hope this will be used as supposed to, and that alot of great work will be based on this.

    Would be very nice

    +rep for u, very nice and a great help to the habbo section.
    Very un-active on ragezone.

    Skype : Siem000
    Facebook : www.facebook.com/Siem0.o
    Thanks for a great time on here

  4. #4
    Member
    Rank
    Member
    Join Date
    Jan 2012
    Location
    Australia
    Posts
    44
    Liked
    16
    Quote Originally Posted by SuckLake View Post
    Thanks you ate a legend!
    He must have been very hungry then?
    @Alex nice release I'll be sure to try to addon to this.

  5. #5
    Member
    Rank
    Member
    Join Date
    Dec 2011
    Location
    Ipoh, Perak, Ma
    Posts
    43
    Liked
    3

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    NICE

  6. #6
    @_Prizm
    Rank
    Subscriber
    Join Date
    Feb 2012
    Location
    Denmark
    Posts
    2,141
    Liked
    518
    PSN ID: InfraRedDude Steam ID: lehprizm

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Mwaha you are funny ^.^
    The keyboard on my Xperia Arc is not good. LOL

  7. #7
    Member
    Rank
    Member
    Join Date
    Jun 2011
    Posts
    34
    Liked
    3

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Does this work to Uber or Phoenix :)))))

  8. #8
    I broke my computer :/
    Rank
    Alpha Member
    Join Date
    Sep 2009
    Location
    Kings Landing
    Posts
    1,806
    Liked
    422
    Gamertag: kthxbye

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Quote Originally Posted by FR3K View Post
    Does this work to Uber or Phoenix :)))))
    What? This is an emulator, Like those only more POWAHHH!
    Regards, zJordan---------------------------------------I rep back. So do the wise thing, and rep me for 1 free rep back!



  9. #9
    Hardcore Member
    Rank
    Member
    Join Date
    Mar 2012
    Location
    Sweden
    Posts
    101
    Liked
    2

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Does this work for MAC-users aswell or just like C++, for Windows only?

  10. #10
    Hardcore Member
    Rank
    Member
    Join Date
    Jan 2011
    Location
    Switzerland
    Posts
    127
    Liked
    6
    Gamertag: Huginho98

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Not sure, but I think Java is also compatible with Mac/Apple OS. U can also use it on Linux ;D

  11. #11
    Registered
    Rank
    Member
    Join Date
    Nov 2011
    Location
    Hudson, New Ham
    Posts
    23
    Liked
    10

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Quote Originally Posted by Casly View Post
    Does this work for MAC-users aswell or just like C++, for Windows only?
    Yes, you just have to open it up in Eclipse!

  12. #12
    Alpha Member
    Rank
    Alpha Member
    Join Date
    May 2011
    Location
    London
    Posts
    1,539
    Liked
    390
    PSN ID: clardes Steam ID: adilol997

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Multithreading can get a bit out of hand if you're not careful.
    Anyway, decent release, good for newer programmers

  13. #13
    Red subscription
    Rank
    Subscriber
    Join Date
    Aug 2011
    Location
    England Coder<3
    Posts
    1,001
    Liked
    317
    Gamertag: Divide

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Well, You cant get into rooms and nothing works..

  14. #14
    Ultimate Member
    Rank
    Member
    Join Date
    Nov 2010
    Location
    Missouri
    Posts
    174
    Liked
    21

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    Quote Originally Posted by Divide View Post
    Well, You cant get into rooms and nothing works..
    Please read this:

    Please read this important note:

    Gamma is unfinished, do not use it for a hotel. It is only for educational purposes. Please do not ask for help in this thread or how to open it.

  15. #15
    Red subscription
    Rank
    Subscriber
    Join Date
    Aug 2011
    Location
    England Coder<3
    Posts
    1,001
    Liked
    317
    Gamertag: Divide

    Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]

    The "It is only for educational purposes" is because he doesn't want to get sued by sulake..

 

 
Page 1 of 2 12 LastLast

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •