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!

Code your own Habbo Hotel Project [CMS & Emu] [From Scratch] - Part 1

Supreme Arcanarch
Loyal Member
Joined
Jul 7, 2011
Messages
944
Reaction score
205
Things you need:

- Microsoft C#
- MySql.Data.dll (for MySql connections)
- Swfs (R63, but before the crypto)
- Notepad++ (coding CMS)
- Flash Decompiler Trillix (editing swf images if you want)
- Brains (for thinking)
- Time (don't think you can do it in 5 minutes)

Okay, first of all, make sure you opened Microsoft C#, because the first 4 steps are only Emulator, you can open Notepad++ but it's not necessary.

Make a new project, it doesn't matter which name. Because it's a sample I call my project SampleProject. Make it a Console Application, because it's better to do.

If project creation is done, a window will come with some text, on the file Program.cs. This is the file you want to invoke the Initialize method on another file, but first you need a new file.

How to create a file: right-click your project name (UNDER solution) and go to Add and choose Class.

Call it PROJECTNAMEEnvironment, or something like that. I'll call it SampleEnvironment.cs. Choose normal class (no interface, or something else).

Once it's done, change class into public class, and between the { } under your class name, make a static void called Initialize or Debug or something. I call it Start. A method looks like this:

public static void Start()
{
}

You can start adding some Console.WriteLine("");, but I'm going to show you the sockets now.


Sockets

Sockets are needing to go on your hotel. Without sockets nothing work.
Make a new map (right click your project name and Add->New Folder and call the folder something like Connections, TCP, NET. I'll call it Sockets. Add a new class called GameConnections.cs or something.

Create a new method, no void and no static, with the class name, like this:

public GameConnections()
{
}

add 2 parameters: string IP and int Port:

public GameConnections(string IP, int Port)
{
}

Between the class bracelets (before the method) add:

private Socket mSocket = new Socket(AddressFamily.InterNetwork, SocketType.Unknown, ProtocolType.Tcp);

Now right-click Socket, Resolve and choose the first option.

Once this is done, you make a new void called OnConnection or something with a parameter IAsyncResult Ias.

public void OnConnection(IAsyncResult Ias)
{
}

In the method you created earlier (the public CLASSNAME() method), add:

mSocket.Bind(new IPEndPoint(IPAddress.Parse(IP), Port));

Now right-click IPEndPoint and resolve it like you did earlier.
Below it add:
mSocket.BeginAccept(new AsyncCallback(OnConnection), null);

In the OnConnection void add:

Console.WriteLine("Accepted connection from " + mSocket.EndAccept(Ias).RemoteEndPoint.ToString());


In next part:

- Receiving and sending packets
- Sql explaination
 
Divine Celestial
Loyal Member
Joined
Jun 26, 2011
Messages
819
Reaction score
338
No offence, I need to see a video to do this.. It'll be easier.
 
Joined
Apr 28, 2010
Messages
2,794
Reaction score
1,177
You need to have it 'less' bland. It's quite boring to read. I suggest instead of having the code like this:

public static void Start()
{
}

You have it like this:
George2000 - Code your own Habbo Hotel Project [CMS & Emu] [From Scratch] - Part 1 - RaGEZONE Forums
 
Skilled Illusionist
Joined
Oct 19, 2010
Messages
391
Reaction score
70
atm it isn't a Tutorial about making an Emulator, you only show us the TCP Connection ;P

Next time:
First Write the Tut, than release it.
 
Newbie Spellweaver
Joined
Jan 5, 2012
Messages
90
Reaction score
12
Can you write the next part please?
 
Joined
Dec 16, 2011
Messages
1,993
Reaction score
631
Okay, I don't want to be rude, but you said you were going to make a video, and that hasn't happened. And this thread doesn't help anyone, this wouldn't even be a start to an emulator, sorry to say. This is a poor effort. :thumbdown:
 
Banned
Banned
Joined
Aug 4, 2011
Messages
852
Reaction score
331
Urghhh, reading the first 12 lines got me confused... no-one codes like this. (Omg, I CAN CODE!)

Sent from my mobile via Tapatalk.
 
Learning C# - Developer
Loyal Member
Joined
Nov 8, 2010
Messages
669
Reaction score
66
Where is the second one?
 
Mythic Archon
Joined
Nov 18, 2011
Messages
728
Reaction score
116
Gibberish. My mind is fried. I understand the concept - but your teaching is scrambled and sloppy. No download links, pictures, not even a video.

I give this a 5/10
 
The Sex Addict
Joined
Oct 19, 2011
Messages
437
Reaction score
58
Not bad could do with a video... as Iv attempted but Didn't work out :p
 
Run, but I'll find you.
Joined
Jan 29, 2011
Messages
777
Reaction score
327
Nice. Although as others have mentioned, a video would be good.
I was also wondering, in how much detail are you going to go in to? ie: emu: making rooms, working wired for example. Will any of this be included or will we have to work it out for ourselves? ;3
 
Back
Top