Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

Azure (Java, Post-shuffle)

Status
Not open for further replies.
Joined
Aug 24, 2012
Messages
603
Reaction score
300
dominic - Azure (Java, Post-shuffle) - RaGEZONE Forums

Azure Java by "Azure Group"
I'd like to welcome you all to our development thread. This has not been undergoing development for long, so bare with us!
We've done most networking and packet handling, so we're close to the fun part!

Libraries, dude?!
Netty - Networking
Gradle - Building
HikariCP - Connection Pooling
Guice - Dependency Injection
Hibernate - ORM / Database Management
log4j - Logging
Trove - Collections/Storage Handling

Which release, bro?!
We're currently using the same release as the 2.0.100 build, so it's PRODUCTION-201506161211-776084490.

What I want to know is, crypto?!?!
Of course are we going to implement Habbo's crypto and in a proper way, so that we won't receive complaints about it being anywhere near to 'slow'.

Azure Java's Team

Why the change?
The previous Azure base was destroyed on several factors, and missing a lot of core code and functionality so we thought it would just be easy to create a new project in Java.

Snippets
Packet handling
Code:
public class MessageHandler {
    private static HashMap<Short, Method> messages = new HashMap<Short, Method>();
    private static final Logger logger = LogManager.getLogger(MessageHandler.class);
    private static boolean initialized = false;

       [USER=26105]POST[/USER]Construct
    synchronized void init() {
        if (initialized) {
            return;
        }

        initialized = true;
        logger.info("Scanning for MessageEvents");
        String pkg = "org.azure.communication.messages";

        Reflections reflections = new Reflections(new ConfigurationBuilder()
            .setUrls(ClasspathHelper.forPackage(pkg))
            .setScanners(new MethodAnnotationsScanner()));

        Set<Method> methods = reflections.getMethodsAnnotatedWith(MessageEvent.class);
        for (Method method : methods) {
            MessageEvent event = method.getAnnotation(MessageEvent.class);

            if (method.getReturnType().equals(Void.TYPE) && event != null && event.enabled()) {
                if (messages.containsKey(event.messageId())) {
                    logger.error("Message ID collision: {}::{} with {}::{}",
                            messages.get(event.messageId()).getDeclaringClass().getSimpleName(),
                            messages.get(event.messageId()).getName(),
                            method.getDeclaringClass().getSimpleName(),
                            method.getName()
                    );
                    System.exit(1); // Fatal error
                }

                Parameter[] params = method.getParameters();
                if (params.length == 2 && params[0].getType() == Session.class && params[1].getType() == ClientMessage.class) {
                    logger.info("Registered {}::{} to id {}",
                            method.getDeclaringClass().getSimpleName(),
                            method.getName(),
                            event.messageId()
                    );
                    messages.put(event.messageId(), method);
                }
            }
        }
    }

    public static void invoke(Session session, ClientMessage message) {
        if (session == null || message == null) return;
        if (!messages.containsKey(message.opCode)) {
            logger.info("Unknown message (id: " + message.opCode + " session: " + session.getId() + ") " + message.toString());
            return;
        }

        logger.debug("Incoming message (id: " + message.opCode + " session: " + session.getId() + ") " + message.toString());
        try {
            messages.get(message.opCode).invoke(null, session, message);
        } catch (IllegalAccessException e) {
            logger.error("Error", e);
        } catch (InvocationTargetException e) {
            logger.error("Error", e);
        }
    }
}
Screenshots
dominic - Azure (Java, Post-shuffle) - RaGEZONE Forums
 
Last edited:
Junior Spellweaver
Joined
Oct 26, 2014
Messages
176
Reaction score
117
We're open to suggestion and feedback, to answer your question now, we're not 100% about whether the Azure Development in C# will continue or not, but for right now... this is our main focus.

We're using Netty 4.x and as of right now we've finished our server's Packet Handling so we'll have in-game snippets sooner than later.

Protocol Testing:
 
Last edited:
☮TAKU????
Loyal Member
Joined
Nov 16, 2009
Messages
866
Reaction score
580
So the old Azure project is dead?
 
☮TAKU????
Loyal Member
Joined
Nov 16, 2009
Messages
866
Reaction score
580
So why the sudden change from C# to Java? Why not consider more effective languages when you're going to write it from scratch anyway?
 
Junior Spellweaver
Joined
Oct 26, 2014
Messages
176
Reaction score
117
So why the sudden change from C# to Java? Why not consider more effective languages when you're going to write it from scratch anyway?
Because our team agreed upon this language as most of them are familiar and comfortable with it...

Although, now I'm curious as to what language you would recommend?
 
Joined
Feb 22, 2012
Messages
2,100
Reaction score
1,271
☮TAKU????
Loyal Member
Joined
Nov 16, 2009
Messages
866
Reaction score
580
Because our team agreed upon this language as most of them are familiar and comfortable with it...

Although, now I'm curious as to what language you would recommend?

Core in C++ and content/features in LUA. That way people could code their own commands, content, furnish and all the poop they want

But Java is cool as well.
 
Custom Title Activated
Loyal Member
Joined
May 23, 2011
Messages
1,607
Reaction score
588
Moving to C++ would shift all the responsibility on to one developer, which makes no sense in a team environment. Learning C++ to a good standard would also taken a few months if not a few years.

Does anyone wanna see me put together a draft database later on?!
(I know there's some relational nerds out there)
 
Last edited:
Status
Not open for further replies.
Back
Top