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!

Event ID Marshaller [Event/Message ID Standard]

Status
Not open for further replies.
Retired
Loyal Member
Joined
May 5, 2007
Messages
497
Reaction score
665
The new event ID (or packet ID as some may want to call it) has caused a lot of headache in this community the last year. It has really put a large break on the development of servers. However, I am now going to try and change this. However, it demands some collaboration from all the developers who are willing to contribute to this standard.

How will this work:
This system are split in three parts. One part which you implement in your server, an XML file and a program you edit the XML file with. The part you implement in your server loads the XML file into memory and makes it easy for you to start using the new packet IDs. The XML file holds a registry of event handle IDs and their OP code. The OP code is the number/id/whatever that always keeps changing from SWF revision to revision. The handle ID is a string which describes the packet. It is therefore important that nobody changes these names, which will make it incompatible with other servers if changed. That is why this is called a standard. This is also the reason you are not able to remove existing events inside the editor. Also, since it is a standard under development, it is posted under development and not under release.

We have started with the last edit of the r96c bfly leak linked to here.

I am a developer of a server, how do I get started?
First of all, if you are using hard-coded integers for the event IDs in the server, you need to go over all these and replace them with an appropriate value which works towards the EventMarshaller project located in the downloadeable file further down in the post. (Further description is located in the readme) It is important that people does not start making their own XML files from scratch, which would make this standard useless. When a new revision is out, those who makes ID maps could simply post their XML file and people could just replace their files and update their event structures in their server and they would be able to use the new revision in just a few hours instead of days figuring out which ID belongs to which.

Screenshots:
TdyC6 - Event ID Marshaller [Event/Message ID Standard] - RaGEZONE Forums

CR9Ts - Event ID Marshaller [Event/Message ID Standard] - RaGEZONE Forums

qSDI - Event ID Marshaller [Event/Message ID Standard] - RaGEZONE Forums

NKLFP - Event ID Marshaller [Event/Message ID Standard] - RaGEZONE Forums

NgPjR - Event ID Marshaller [Event/Message ID Standard] - RaGEZONE Forums

O6w7Y - Event ID Marshaller [Event/Message ID Standard] - RaGEZONE Forums

Resource:

Editor and server-side implementation source:


Event ID Standard XML-file:


Readme:
Code:
How to use in YOUR server:


Copy the project folder "EventMarshaller" to the location of your server solution and paste it there (the location of your "Butterfly Emulator.sln"
Open up Visual Studio and load the "Butterfly Emulator.sln"


Right click the solution and navigate to "Add.." -> "Existing project..."
Go to the "EventMarshaller" directory and click "EventMarshaller.csproj" 


It will now be added


Right click on the "Butterfly emulator" project  "Add Reference.."
In the window go to "Solution" and check the "EventMarshaller"




In ButterflyEnvironment add:


public static readonly EventMarshaller loader;


As one of the first lines as initialization add:


loader = EventMarshallLoader.GetEventLoader(typeof(Incoming), typeof(Outgoing), "RELEASE63-201211141113-913728051", @"c:\location\of\xml\here\version.xml");


In ServerMessage, where the header is created add this:
header = ButterflyEnvironment.loader.TranslateOutgoingEventHandle(header);
In ClientMessage near "internal void Init(int messageID....
Add:
messageID = ButterflyEnvironment.loader.TranslateIncomingEventHandle(messageID);




thats it!
You're done

Further development:
One thing we are considering/planning is a way to express the packet structures in a XML format. The server loads the XML file on boot and puts the data into the templates when a message is composed.

- Martin and Dissi
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Apr 5, 2007
Messages
13
Reaction score
17
If you need any help implementing this in your server, AND you got a development thread here

Feel free to shoot me a PM, I might be able to help you given on how much time I got.

We're also working on a repository for all the XML files so you can download newer versions.



Please report any bugs which are found in the current editor here!
 
Last edited:
Newbie Spellweaver
Joined
Apr 5, 2007
Messages
13
Reaction score
17
We're currently using DataContracts for automatic Serialization.
It handles all our storing/reading for us.
We're planning on extending the current event handles with the packet structure's. We haven't decided on a layout yet, which is the hardest part of making it user friendly
 
Experienced Elementalist
Joined
Jul 5, 2006
Messages
262
Reaction score
193
deleted
 
Last edited:
Joined
Apr 28, 2010
Messages
2,794
Reaction score
1,178
This isn't a good idea, but it isn't a bad idea either.

I can't see many people putting time in to import new releases.

I skimmed so I don't know all the exact information but make sure to alert the dev or end user of a new revision available for use. They should be available after events that are marked as 'basic' are 100% and 'extras' at 40%. Give the end user a option of which revision they want to use.
 
Newbie Spellweaver
Joined
Apr 5, 2007
Messages
13
Reaction score
17
I can't see many people putting time in to import new releases
....
Now they don't have to have a lot of time, as the new event ID's are prepared FOR them.
I'm currently working with on an automatic event response creator. Outgoing Event structures are currently easy to generate using some magic tricks.

For the incoming packets, that's a more challenging idea as there is no structure which you could use besides an easy hashtable, which will reduce the speed greatly.

I'm now working on an interface for you to generate outgoing Events on the fly without effort, just load in the xml, call
Marshaller.CreateMessage(unOnbfuscatedID, IContext somethingToBeDefined);

This way you will no longer need code in your emulator like this:

Code:
ServerMessage message = new ServerMessage(1337);
message.WriteInt(habbo.id);
message.WriteString(habbo.name);

but in stead this will be defined in an XML structure and than the marshaller will do this for you, greatly improving structure in the server.

but make sure to alert the dev or end user of a new revision available for use

I think THAT is a great idea, I'll discuss this with martin when he wakes up. I think this is a great idea we overlooked.
 
[̲̅$̲̅(̲̅1̲̅)̲̅$ ̲̅]
Joined
May 4, 2008
Messages
831
Reaction score
741
I think it's awesome that you guys are stepping up to help the community . This looks like it is going to be very helpful.
 
Custom Title Activated
Loyal Member
Joined
Oct 21, 2007
Messages
2,098
Reaction score
464
Now they don't have to have a lot of time, as the new event ID's are prepared FOR them.
I'm currently working with on an automatic event response creator. Outgoing Event structures are currently easy to generate using some magic tricks.

For the incoming packets, that's a more challenging idea as there is no structure which you could use besides an easy hashtable, which will reduce the speed greatly.

I'm now working on an interface for you to generate outgoing Events on the fly without effort, just load in the xml, call
Marshaller.CreateMessage(unOnbfuscatedID, IContext somethingToBeDefined);

This way you will no longer need code in your emulator like this:

Code:
ServerMessage message = new ServerMessage(1337);
message.WriteInt(habbo.id);
message.WriteString(habbo.name);

but in stead this will be defined in an XML structure and than the marshaller will do this for you, greatly improving structure in the server.



I think THAT is a great idea, I'll discuss this with martin when he wakes up. I think this is a great idea we overlooked.

I'm interested in how the Marshaller will get the user data and such for the structures, would we have to define it our self using a method or something?

For example

Marshaller.GrabUserData(Id,Username,Dob,Motto,Credits etc)

Is this how you will be doing it to obtain data?

Same goes for the rooms and other type of functions that need sql data.

Lol, somebody still does so?

Everyone now does it with interfaces and such but it's still the same in my eyes.
 
Last edited:
Chasing 99 Red Balloons
Joined
Jan 9, 2008
Messages
857
Reaction score
229
I'm interested in how the Marshaller will get the user data and such for the structures, would we have to define it our self using a method or something?

For example

Marshaller.GrabUserData(Id,Username,Dob,Motto,Credits etc)

Is this how you will be doing it to obtain data?

Same goes for the rooms and other type of functions that need sql data.



Everyone now does it with interfaces and such but it's still the same in my eyes.
People certainly are going the wrong way about it, i've been using a class that can be dynamically mapped and just calling something like this, which works well enough for me and is easily updatable :)
new ServerMessage(BLahBlah.InitCrypto)
 
Custom Title Activated
Loyal Member
Joined
Oct 21, 2007
Messages
2,098
Reaction score
464
People certainly are going the wrong way about it, i've been using a class that can be dynamically mapped and just calling something like this, which works well enough for me and is easily updatable :)
new ServerMessage(BLahBlah.InitCrypto)

It is easy because all you need to do is change the header in the BLahBlah class and you've update that structure, but i don't see why people are against this method.
 
Chasing 99 Red Balloons
Joined
Jan 9, 2008
Messages
857
Reaction score
229
It is easy because all you need to do is change the header in the BLahBlah class and you've update that structure, but i don't see why people are against this method.

It is a pain to update ID's with this way, i've been working to move all of my ID's into the configuration and just map them to the class at boot. Makes updates a simple restart away :) this i like the idea of standardising the format they are stored in as it would make upgrading a lot simpler.
 
Custom Title Activated
Loyal Member
Joined
Oct 21, 2007
Messages
2,098
Reaction score
464
It is a pain to update ID's with this way, i've been working to move all of my ID's into the configuration and just map them to the class at boot. Makes updates a simple restart away :) this i like the idea of standardising the format they are stored in as it would make upgrading a lot simpler.

Thank you for simplifying it for me :)
 
Retired
Loyal Member
Joined
May 5, 2007
Messages
497
Reaction score
665
It is a pain to update ID's with this way, i've been working to move all of my ID's into the configuration and just map them to the class at boot. Makes updates a simple restart away :) this i like the idea of standardising the format they are stored in as it would make upgrading a lot simpler.

Exactly why I decided to make this ^^

- Martin
 
Newbie Spellweaver
Joined
Apr 5, 2007
Messages
13
Reaction score
17
I need some feedback from you guys!

I currently got 1 way of implementing the new Auto Event Message generation structure:

What needs to be done is ->
Create easy-to-implement interface classes with easy structures to add into your existing emulator code

After that calls will look as follows:
Code:
ServerMessage message = new ServerMessage();
Marshall.FillResponse(message, Outgoing.SomeCodeHere, IHabboContext);
With IHabboContext beeing a class which has some information in it regarding getting the needed data.

ALL data needed for the Event is than stored in the message object which can be send directly to the client.

This will require some time to implement in all servers, but I will take into account the default "code structure" from most of the servers.

The packet creation GUI itself will be posted tomorrow or Monday and the implementation could should e straight forward.
The GUI itself will be able to:
  • Create structures with dynamic for-each operations - Needed for friendlist, items in a room etc
  • Create if statements - Needed for Club packets, groups anything that requires it
  • Send all kinds of basic data (uint, int, string ushort, short, byte etc)


Is there anything else that needs to be taken care of- packet wise?

IMPORTANT>>>
I will not use C# Attributes to map values from habbo's rooms etc, as they tend to be slow at runtime. I've made a choice to use Interfaces instead as they tend to be a whole lot faster
 
Retired
Loyal Member
Joined
May 5, 2007
Messages
497
Reaction score
665
Google C# Marshalling

Normally, marshalling means the process between managed and unmanaged code, so the CLR has to make sure the memory is usable by unmanaged code, it can do so by pinning memory or copy memory. However, this is not the case for the marshaller project. We named it marshaller since it takes care of the process by finding the correct event ID for the current SWF revision you have selected.

- Martin
 
Status
Not open for further replies.
Back
Top