-
Gamma 1.0 - r63 [Java Emulator, Multithreaded]
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
http://donkeysnapr.info/i/8886284267.png
Download
Good release? Like or rep me <3
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
-
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.
-
Quote:
Originally Posted by
SuckLake
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.
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
Mwaha you are funny ^.^
The keyboard on my Xperia Arc is not good. LOL
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
Does this work to Uber or Phoenix :)))))
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
Quote:
Originally Posted by
FR3K
Does this work to Uber or Phoenix :)))))
What? This is an emulator, Like those only more POWAHHH!
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
Does this work for MAC-users aswell or just like C++, for Windows only?
-
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
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
Quote:
Originally Posted by
Casly
Does this work for MAC-users aswell or just like C++, for Windows only?
Yes, you just have to open it up in Eclipse!
-
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
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
Well, You cant get into rooms and nothing works..
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
Quote:
Originally Posted by
Divide
Well, You cant get into rooms and nothing works..
Please read this:
Quote:
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.
-
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..
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
Quote:
Originally Posted by
Divide
The "It is only for educational purposes" is because he doesn't want to get sued by sulake..
Or. It can actually mean what it actually says ;)
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
Quote:
Originally Posted by
Divide
The "It is only for educational purposes" is because he doesn't want to get sued by sulake..
And you can be sure of this? Because I know a few Developers that would only release a bit of information to show people how they did things and what they can do, which is considered Educational to some.
The thing is, he may or may not have released this in hopes that people will pick up on it, but regardless, the features aren't coded in which would mean you would have to wait until someone does code them in or you can code them in yourself.
Unfortunately, there are a lot of Emulators, none that are currently Open Source and in active Development.
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
Nice but not working because it unfinished and its for educational purposes.
-
Re: Gamma 1.0 - r63 [Java Emulator, Multithreaded]
Looks nice!
For what SWF's is this base build?
And is the base before or after the encryption?