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!

[C#, PHP, R38] Project Aurora

Status
Not open for further replies.
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Hey,

This is actually my HSR project. I want to rewrite this thread as I kind off got off with it. I rewrote the whole source but it was on a virtual machine which I accidentally removed (since I had 2 Windows 7 VMs and removed the wrong one... silly me!)

Anyways, I decided to rewrite it. The R35 is just an assumption. The base "framework" (which I call Aurora's Habbo Framework) is used for all projects which will be made. Not much, just 2/3 versions, but we'll start with one. Or 2... not sure.

Some tech-stuff:

- The emulator is written in C#.
- The emulator uses DotNetty for networking.
- The emulator uses Fluent NHibernate.
- The emulator creates all database tables upon booting up for the first time.
- The emulator is written from scratch.
- The emulator uses Nuget.
- The emulator uses log4net.

Versions being made / planned:

- V9 (or V7 if somebody can help with packet structures I can't figure out).
- R35-R38 (not sure which one).

More isn't planned, but it's all to be answered. For the R35-R38, the main focus is on Flash first (no worries... Shockwave is a possibility).

The features planned:

V7/V9:
- Camera
- Everything else
- Wobble squabble
- Gamehall
- IF it's v9, battleball

R35-R38:
- Just the full game, with achievements etc etc.

Some custom features might be implemented later but not sure about that.

The source will be available during a later stage at the development. For now, it's not share-worthy as it's kind of messy in some parts still.

A few scripts to show you how things are done:

This code builds the SessionFactory, adds the mappings and updates the schema (database).

PHP:
SessionFactory = Fluently.Configure()
                    .Database(MySQLConfiguration.Standard.ConnectionString(CONNECTION_STRING))
                    .Mappings(m => m.FluentMappings.AddFromAssemblyOf<PlayerMap>())
                    .Mappings(m => m.FluentMappings.AddFromAssemblyOf<CatalogPageMap>())
                    .ExposeConfiguration(config =>
                    {
                        new SchemaUpdate(config).Execute(false, true);
                    })
                    .BuildSessionFactory();

This is an example of a map. In this case, it's the PlayerMap which extends ClassMap<Player>. It loads all data from the table "players".

PHP:
 public PlayerMap()
        {
            Table("players");
            LazyLoad();
            Id(x => x.Id).Column("id").Length(11).GeneratedBy.Identity();
            Map(x => x.Username).Column("username").Length(15).Not.Nullable();
            Map(x => x.Password).Column("password").Length(80).Not.Nullable();
            Map(x => x.Email).Column("email").Length(30).Not.Nullable().Unique();
            Map(x => x.Gender).Column("gender").Length(1).Not.Nullable();
            Map(x => x.Figure).Column("figure").Length(80).Not.Nullable();
            Map(x => x.Motto).Column("motto").Length(40).Default("").Not.Nullable();
            Map(x => x.Coins).Column("coins").Length(11).Default("500").Not.Nullable();
            Map(x => x.Pixels).Column("pixels").Length(11).Default("0").Not.Nullable();
            Map(x => x.Rank).Column("rank").Length(2).Default("1").Not.Nullable();
            Map(x => x.HomeRoom).Column("home_room").Length(11).Default("0").Not.Nullable();
            Map(x => x.SSO).Column("sso_ticket").Length(40).Not.Nullable().Default("");
        }

This reads a packet and handles it. I'm sure it could be cleaned up more... but oh well.

PHP:
 public override void ChannelRead(IChannelHandlerContext ctx, object msg)
        {
            Client client = Engine.Game.Clients.GetClient(ctx.Channel);
            var message = msg as IByteBuffer;

            if (message.ReadByte() == 60)
            {
                string policy = "<?xml version=\"1.0\"?>\r\n<!DOCTYPE cross-domain-policy SYSTEM \"/xml/dtds/cross-domain-policy.dtd\">\r\n<cross-domain-policy>\r\n   <allow-access-from domain=\"*\" to-ports=\"1-65535\" />\r\n</cross-domain-policy>\0";
                ctx.Channel.WriteAndFlushAsync(Unpooled.CopiedBuffer(Encoding.Default.GetBytes(policy))).Wait();
            }
            else
            {
                int length = Base64Encoding.DecodeInt32(message.ReadBytes(2).ToArray());
                IByteBuffer packet = message.ReadBytes(length);

                Engine.GameNetwork.Packets.Handle(client, packet);
            }

            base.ChannelRead(ctx, msg);
        }

For more scripts, just ask me. I'm a nice fella and if you think I could change a few things let me know. But please only do constructive criticism.

A few screens:

Now much, just started (and mainly done "kernel" stuff):

LTRuR5o - [C#, PHP, R38] Project Aurora - RaGEZONE Forums

D36zOXE - [C#, PHP, R38] Project Aurora - RaGEZONE Forums


The end of my school year is coming up as well so I'll have more time to work on this. And I'm gonna keep it more updated as I kind of forgot in my last thread (and the thread was a mess because I started over and yeah now I know I will only work on this and I got it backed up and stuff maybe put it on git).

Any questions, just ask.
 

Attachments

You must be registered for see attachments list
Last edited by a moderator:
Joined
May 23, 2011
Messages
1,607
Reaction score
588
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Nice one, good luck with the rest of the project!

V7 had some really weird packet structures (I think Nillus's ION might have a few of these implemented...)
 
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Nice one, good luck with the rest of the project!

V7 had some really weird packet structures (I think Nillus's ION might have a few of these implemented...)

True, but it only has login and register and update profile. It doesn't have the things I struggled with. Navigator wasn't even started and club neither. The packet structure I have for club always shows 'Join!' instead of the amount of club days.

V7 would be nice to make but I'll see what happens.
 
Developer
Developer
Joined
Dec 11, 2010
Messages
2,955
Reaction score
2,685
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

True, but it only has login and register and update profile. It doesn't have the things I struggled with. Navigator wasn't even started and club neither. The packet structure I have for club always shows 'Join!' instead of the amount of club days.

V7 would be nice to make but I'll see what happens.

We have V1, V5 and V9, is there any need for V7?

I mean sure, it would be nice but there's a lot of missing packet information and structures in V7 that I believe will just lead to frustration causing an incomplete server for that revision.
 
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

We have V1, V5 and V9, is there any need for V7?

I mean sure, it would be nice but there's a lot of missing packet information and structures in V7 that I believe will just lead to frustration causing an incomplete server for that revision.

There's no need for anything; I'll see what I do though.
 
Junior Spellweaver
Joined
May 15, 2014
Messages
165
Reaction score
34
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Hello! I'm part of this development and I'm in the stage of learning alot of C# right now and how Habbo works, or well oldschool habbo works.

Just commited to git with a few changes,
Got rid of godclass by creating an instance of each class that's static so you access the class via GetInstance(), for example:
PHP:
ClientManager.GetInstance().AddClient(ctx.Channel);
Instead of doing something like Aurora.GetGame().GetClientManager() or w/e.

I added the ability to "que" composers. If you're going to send alot of composers at once then instead of writing and flushing every single packet, you basically first write all the packets then you flush.
PHP:
public void SendComposer(MessageComposer composer)        {            Send(composer, true);        }        public void QueueComposer(MessageComposer composer)        {            Send(composer, false);        }        public void Send(MessageComposer composer, bool flush)        {            if (flush)            {                channel.WriteAndFlushAsync(composer.GetBytes());            } else            {                channel.WriteAsync(composer.GetBytes());            }        }        public IChannel Flush()        {            return channel.Flush();        }
I also tidyed up the composers because @Glaceon was lazy and did wrote the composers inside the events so now they're own classes instead.

I also edited the Habbo.swf alittle since on R35 the icons were limited and you could only choose icon names from an array,
PHP:
private static const _SafeStr_6112:Array = ["", "katalogi_ikoni_purse", "katalogi_ikoni_furni", "katalogi_ikoni_plants", "katalogi_ikoni_trax", "katalogi_ikoni_pixels", "katalogi_ikoni_credits", "katalogi_ikoni_recycler", "katalogi_ikoni_pets", "katalogi_ikoni_hc", "katalogi_ikoni_special_offers"];

but now instead it gets the icons like on the new revisions where you get the icons by number, example, "icon_1.png". I also changed the extension from .gif to .png.

I'm in the middle of editing the catalogue right now to make it look alittle bit more like the r37 catalogue where the sub pages have icons aswell. I've currently added the icon to the sub page. Currently working on changing the background color on the sub pages.
How we want it to be:
Emily - [C#, PHP, R38] Project Aurora - RaGEZONE Forums

How it currently is:
Emily - [C#, PHP, R38] Project Aurora - RaGEZONE Forums
 
Last edited:
Junior Spellweaver
Joined
Feb 6, 2013
Messages
196
Reaction score
25
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Good luck guys, looking forward to see some more nice screenshots!
 
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Some small updates:

- Catalogue pages now show the layout and stuff. Products aren't made yet.
- Navigator shows official rooms only. Those are gotten from the database.

usDTjMO - [C#, PHP, R38] Project Aurora - RaGEZONE Forums
 

Attachments

You must be registered for see attachments list
Joined
Aug 10, 2011
Messages
7,401
Reaction score
3,299
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

I miss that public nav view.

Are you going to get past room loading this time? You know, statistically speaking :p:

Nah Im kidding. Nice work so far. Keep it up ^.^

Havent done C# in a while. All I remember is that LINQ is cool but slow as duck xD
 
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

I miss that public nav view.

Are you going to get past room loading this time? You know, statistically speaking :p:

Nah Im kidding. Nice work so far. Keep it up ^.^

Havent done C# in a while. All I remember is that LINQ is cool but slow as duck xD

I won't use LINQ too much, just for Fluent NHibernate (as I guess it uses LINQ somehow itself).

PHP:
 public OfficialRoomsComposer(IList<FrontpageItem> frontpageItems)
            : base(450)
        {
            AppendVL64(0);
            AppendVL64(frontpageItems.Count);

            foreach (FrontpageItem item in frontpageItems)
            {
                AppendString(item.Name);
                AppendString(item.Description);
                AppendVL64(item.Size);
                AppendString(item.Name);
                AppendString(item.Image);
                AppendVL64(0);
                AppendVL64(item.Type);

                if (item.Type == 1)
                    AppendString(item.Tag);
            }
        }

At least I'm not using LINQ for for(each) loops as that will drop loads of performances. (no comment about the 0, I have to make rooms yet so no user count of something yet).

ALSO: In my old source I got past room loading too, just the annoyance is that shockwave and flash are a bit different in it. That's why I focus on Flash first xp)
 
Joined
Sep 2, 2011
Messages
2,171
Reaction score
916
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

I can hear, I can hear the nostalgia coming.

Wasn't you some months ago also developing an v35 Emulator? Or was Quackster? I don't remember.

Aurora it's a name of a Magibogi Emulator. Actually it was takedown by the creators.:

Sad.
 
Joined
Nov 21, 2011
Messages
66
Reaction score
12
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

I won't use LINQ too much, just for Fluent NHibernate (as I guess it uses LINQ somehow itself).

PHP:
 public OfficialRoomsComposer(IList<FrontpageItem> frontpageItems)
            : base(450)
        {
            AppendVL64(0);
            AppendVL64(frontpageItems.Count);

            foreach (FrontpageItem item in frontpageItems)
            {
                AppendString(item.Name);
                AppendString(item.Description);
                AppendVL64(item.Size);
                AppendString(item.Name);
                AppendString(item.Image);
                AppendVL64(0);
                AppendVL64(item.Type);

                if (item.Type == 1)
                    AppendString(item.Tag);
            }
        }

At least I'm not using LINQ for for(each) loops as that will drop loads of performances. (no comment about the 0, I have to make rooms yet so no user count of something yet).

ALSO: In my old source I got past room loading too, just the annoyance is that shockwave and flash are a bit different in it. That's why I focus on Flash first xp)
Don't know why u put that name but revise the name "OfficialRoomsComposer", i think "SerializePageItems" is better :p
 
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Don't know why u put that name but revise the name "OfficialRoomsComposer", i think "SerializePageItems" is better :p

_events[450] = com.sulake.habbo.communication.messages.incoming.navigator.OfficialRoomsEvent;

This is SWF wise. This is a composer in emulator. I keep the same names.

I can hear, I can hear the nostalgia coming.

Wasn't you some months ago also developing an v35 Emulator? Or was Quackster? I don't remember.

Aurora it's a name of a Magibogi Emulator. Actually it was takedown by the creators.:

Sad.

It was me (it was R38), though I accidentally deleted the virtual machine it was on. Sad story. Now I have it on Github though.
 
Joined
Nov 21, 2011
Messages
66
Reaction score
12
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Dont know why... OfficialRoomsEvent for item serializing... Were they drunk when write that?

PD: Good luck with ur project bro, u can do it perfect ;)
 
Joined
Oct 26, 2012
Messages
2,357
Reaction score
1,086
Re: [V9] [R35] Aurora Emulator [C#] [NHibernate] [DotNetty] [Log4net]

Dont know why... OfficialRoomsEvent for item serializing... Were they drunk when write that?

PD: Good luck with ur project bro, u can do it perfect ;)

No.



I think these names are correct. I keep the same names as Habbo did. SerializePageItems doesn't even tell you which packet it is.
 
Status
Not open for further replies.
Back
Top