[Tutorial] Hosting Fabiano Private RotMG Server Source on a Linux VPS

Posts 115 of 23 · Page 1 of 2
[Tutorial] Hosting Fabiano Private RotMG Server Source on a Linux VPS
Introduction

This "tutorial" was created as a set of notes for myself while I helped my younger brother set up a VPS that could host RotMG. I've since filled in the spots with a little more detail, and created a repository to track the changes to his version of the source code. The tutorial below uses:

- Fabiano derived source
- Linux VPS
- Modified Client

And creates a hosted RotMG Private server that allows for custom hacks, and easily supports at least 20 active users with little to no lag.


Linux Virtual Private Server (VPS)

Why a VPS instead of Hamachi?

Hamachi works well enough for a private server you play on "every now and then" with a couple of friends. If you're looking for something more robust, secure, and scalable, then you will need a VPS. What this means is, a VPS is not limited to the specs of your machine. They can add more RAM, CPU, etc. on demand as the server needs it. They are also more finely tuned to handle the amount of incoming/outgoing traffic -- ultimately reducing the amount of lag.

Why a Linux VPS instead of a Windows VPS?

That's a good question, especially considering the game is programmed in C# .NET, making it native to the Windows Operating system. Truthfully, hosting on a Windows VPS would be easier. However, you get much less "hardware" for the amount you pay. This allows you to support more active players per dollar you spend on hosting. Microsoft has also begun to move toward Linux compatibility and Open Source support. As far as stability is concerned, I've been able to run this RotMG server for weeks at a time with many active players and experience little to no downtime.


Preparing the VPS

- Download the source code as a .zip file
- Unzip the source code into it's own folder

1. Create a Digital Ocean Account
2. Create a new droplet with the following specs:
- Ubuntu 14.04.4 x64
- 2 GB RAM / 2 CPUs
- 40 GB SSD Disk
- 3 TB Transfer
- Choose a data center near you / your active players and click "Create"
3. You will get an e-mail with login credentials for your VPS. You will need the following applications:
- PuTTY To SSH / Remotely login to your server
- FileZilla Client to transfer game files to your server
4. If you are new to using PuTTY or FileZilla, check out:
5. Follow these sets of tutorials to prepare your server to host RotMG
6. Follow ONLY the TimeZone and FireWall portions of Additional Recommended Steps for New Ubuntu Servers
- Make sure to open the following ports:

Missing image. Not allowed to include image due to low rep

7. Add the game's database to your MySQL instance
- Go to "http://YourVPSip/phpmyadmin" and sign in
- Click the "SQL" menu item at the top of the screen
- Navigate to the source code's "db" folder and open rotmgprod.sql with notepad or a text editor
- Copy and paste the text from rotmgprod.sql to the text field in your phpMyAdmin
- Click "Go"


Customizing Source Code

1. Download and Install Visual Studio Community
2. Open the source code's .SLN file (it's in the root/main folder) with Visual Studio
3. Update the following files with your credentials:
- AdminPanel/AdminPanel.cs
- AdminPanel/Login.cs
- server/Program.cs
- server/server.cfg
- server/list.cs
- wServer/Program.cs
- wServer/wServer.cfg
4. Build the solution to create the executable files you need to deploy:
- Right click the server project in "Solution Explorer" and select "Set As Startup Project"
- From the menu, select Build --> Clean Solution
- Select Build --> Rebuild Solution
5. Upload the compiled/built code to your VPS
- Open Filezilla and connect to your VPS/Droplet (user account, not root/admin)
- Right click and create a new folder with the name "rotmg"
- On your PC, navigate to the source code's main folder --> bin --> Debug
- Drag the contents of the Debug folder into the "rotmg" folder showing in Filezilla


Customizing Game Client

This section was influenced largely by a flashhacking.net thread. Unfortunately, I am not allowed to link to it. It covers:

- How to "Decompile" (take apart) a .swf file so that it can be modified
- Which values to modify for OUR SPECIFIC Client/Source to work with your VPS
- How to "Recompile" (put together) a decompiled .swf so that it can be used

To start, there are many different program's that can be used to modify .SWF files. We use rabacdasm here mainly out of personal preference. You're more than welcome to try other methods, but I cannot vouch for them. If you're using our source, the .ZIP contains rabacdasm. If you're using a different source, rabacdasm can be downloaded from its creators: HERE

Using Our Source:
1. Open up the "Root" folder of the source code
2. Navigate to --> Client Updater --> bin --> Final
3. Double click "decompile.bat"
4. Open the newly created "client-1.abc" with notepad
- Find and replace `127.0.0.1` with `yourserverip:8888` (2 places)
- Save and close the text document
5. Double click "recompile.bat"

Client.swf is now configured to work with your hosted server. Distribute it, use it locally, or embed it into a web page.


Using Any Source:
- In Progress


Starting/Stopping Server

1. Use PuTTY to SSH into your VPS (user account, not root/admin)
2. Install packages necessary to run server executables:
- sudo apt-get install mono-complete
- sudo apt-get install screen
3. Start the RotMG Server
- sudo screen -S server
- cd /home/{username}/rotmg/
- mono ./server.exe
- Detach from the screen terminal (<kbd>CTRL</kbd>+<kbd>a</kbd>, <kbd>CTRL</kbd>+<kbd>d</kbd>)
4. Start the RotMG wServer
- sudo screen -S wserver
- cd /home/{username}/rotmg
- mono ./wServer.exe
- Detach from the screen terminal (<kbd>CTRL</kbd>+<kbd>a</kbd>, <kbd>CTRL</kbd>+<kbd>d</kbd>)
5. You should now be able to connect to the game using your modified game client! If you're not able to, check out the Debugging section of the readme.


Automation and Debugging

Debugging is incredibly important. When things go wrong, it's important that you know how/where/why things went wrong so you can begin to fix the problem.


Frequently Asked Questions (FAQ)

As questions are asked in this thread, I will update this section and the rest of t



Credits & Thanks

[The ORIGINAL Fabiano Swagger Of Doom Source](https://github.com/ossimc82/fabiano-swagger-of-doom)
- Ossimc82 | Fabian Fischer
- C453
- Trapped
- Donran
- Creepylava
- Krazyshank
- Barm
- Nilly
- sebastianfra12
- Kieron

[The Updated/Modified Fabiano Swagger Of Doom Source](https://github.com/djb-code/fabiano-swagger-of-doom)
- Zabex | CSEngineer13 | Daniel Brown
- Uber | Joey Brown
I think its 10 posts to be able to PM someone and 20 posts to be able to upload URLs etc @CSEngineer13
Unfortunately outside downloads/links are not allowed in any circumstance.

I'm sure keywords are enough to Google them.
Quote Originally Posted by Raple View Post
Unfortunately outside downloads/links are not allowed in any circumstance.

I'm sure keywords are enough to Google them.
Hmm.. I've seen other users link to GitHub and other outside sources. Is there a particular reason they're exempt?


@Riigged, thank you for moving the thread to the appropriate forum.
Quote Originally Posted by CSEngineer13 View Post
Hmm.. I've seen other users link to GitHub and other outside sources. Is there a particular reason they're exempt?


@Riigged, thank you for moving the thread to the appropriate forum.
GitHub links are indeed allowed. Unless its a GitHub page, like example.github**** since well it's basically a website that anyone can upload anything onto.
What other links were you trying to provide?
Just give me keywords or the name of the site, just don't put it in link form just in case it is a untrusted/sketchy site, pretty much outside links are allowed as long as it's trusted.. like www.kabam.com is allowed because they are a game company, they obviously won't provide viruses on their website, except for their games of course (jokez), but something like www.example.w33bly.com most likely won't be allowed unless it's ran by a trusted mpgh member/another trusted person, since anyone can run a w33bly website and upload any content.
Quote Originally Posted by Riigged View Post
GitHub links are indeed allowed. Unless its a GitHub page, like example.github**** since well it's basically a website that anyone can upload anything onto.
What other links were you trying to provide?
Just give me keywords or the name of the site, just don't put it in link form just in case it is a untrusted/sketchy site, pretty much outside links are allowed as long as it's trusted.. like www.kabam.com is allowed because they are a game company, they obviously won't provide viruses on their website, except for their games of course (jokez), but something like www.example.w33bly.com most likely won't be allowed unless it's ran by a trusted mpgh member/another trusted person, since anyone can run a w33bly website and upload any content.
Ahh. So the issue is less: "No outside links at all" and more "No sketchy/untrusted links" in an attempt to protect the forum's user base? The tutorial/guide includes links to:

- A GitHub Repository
- Digital Ocean
- Filezilla-project
- The official PuTTY Download Source
- Tutorial images (hosted in the GitHub Repository)
- VisualStudio
- StackOverflow
- AskUbuntu

No personal sites. Some lead to downloads, but from official sources for long-standing and trusted software.
Quote Originally Posted by CSEngineer13 View Post
Ahh. So the issue is less: "No outside links at all" and more "No sketchy/untrusted links" in an attempt to protect the forum's user base? The tutorial/guide includes links to:

- A GitHub Repository
- Digital Ocean
- Filezilla-project
- The official PuTTY Download Source
- Tutorial images (hosted in the GitHub Repository)
- VisualStudio
- StackOverflow
- AskUbuntu

No personal sites. Some lead to downloads, but from official sources for long-standing and trusted software.
Those websites are all official services that thousands if not millions of people use/go on/downloaded so I believe they shouldn't be a problem to link.
But let's just check with someone who actually can confirm a rule like this, @Liz these websites shouldn't be a problem to link downloads to, right? They are all trusted and ran by professionals, not just some kids who made a website with a free website builder:P
Quote Originally Posted by Riigged View Post
Those websites are all official services that thousands if not millions of people use/go on/downloaded so I believe they shouldn't be a problem to link.
But let's just check with someone who actually can confirm a rule like this, @Liz these websites shouldn't be a problem to link downloads to, right? They are all trusted and ran by professionals, not just some kids who made a website with a free website builder:P
Only know of four of those that are ok.

- A GitHub Repository
- Tutorial images
- VisualStudio
- AskUbuntu


The others I do not recognize by name, so cannot attest to whether they're alright or not.
literally 2 minions commented but still haven't realized this is not the private server section aka this has to be moved

edit: was moved to correct section, adding this edit in so noone reads this and is like "its in right section already u retard!"
Quote Originally Posted by CSEngineer13 View Post
**Note: I cannot include links because I do not have enough reputation/points. If a mod can assist, I would appreciate it. This tutorial is much harder to follow without all of the links to helpful resources and tutorials. "Blue" text exists to indicate where a URL has been removed due to restrictions.

This "tutorial" was created as a set of notes for myself while I helped my younger brother set up a VPS that could host RotMG. I've since filled in the spots with a little more detail, and created a repository to track the changes to his version of the source code. The tutorial below uses:

- Fabiano derived source
- Linux VPS
- Modified Client

And creates a hosted RotMG Private server that allows for custom hacks, and easily supports at least 20 active users with little to no lag.

** Note: This is a work in progress. I will update the tutorial/guide further if I'm granted rights to include links/image.


Linux Virtual Private Server (VPS)

To be expanded. These are just cliff notes at this point

Preparing the VPS

- Download the source code as a .zip file
- Unzip the source code into it's own folder
What if it's a .RAR file? Would it still work on Linux?
Quote Originally Posted by Liz View Post

Only know of four of those that are ok.

- A GitHub Repository
- Tutorial images
- VisualStudio
- AskUbuntu


The others I do not recognize by name, so cannot attest to whether they're alright or not.
Is there an official vetting process or way to get specific domains approved? I can show Alexa website rankings or WHOIS domain registry information that shows each is run and maintained by a company?

- - - Updated - - -

Quote Originally Posted by Chiroy View Post
What if it's a .RAR file? Would it still work on Linux?
The tutorial guides you through the specifics of setting up a Linux VPS with the Fabiano source. The source I used was pulled from GitHub and was stored in a .zip. A .RAR is very similar.

Both .RAR and .ZIP compress the files within them to make it easier/faster to download and upload their contents. So long as you can "decompress" or "unzip" the file's contents so that you can access them as regular files, then you will be okay.
Quote Originally Posted by CSEngineer13 View Post
Is there an official vetting process or way to get specific domains approved? I can show Alexa website rankings or WHOIS domain registry information that shows each is run and maintained by a company?

- - - Updated - - -



The tutorial guides you through the specifics of setting up a Linux VPS with the Fabiano source. The source I used was pulled from GitHub and was stored in a .zip. A .RAR is very similar.

Both .RAR and .ZIP compress the files within them to make it easier/faster to download and upload their contents. So long as you can "decompress" or "unzip" the file's contents so that you can access them as regular files, then you will be okay.
I know, but it's been a long time using Linux, so I was wondering if .RAR can be used on .zip even though they're basically twins.
Guess I should've told you about specific forum rules. Nice post, tossing you a thanks. This should help anyone looking to setup a linux VPS and they won't have to go through the hours trying new things like us.
You can use the contact us, and directly ask the Site owner. However that can take a while. My suggestion, upload everything you can locally.
When i try to rebuild i get like 33 errors, half of them are: The type or namespace name 'Newtonsoft' could not be found (are you missing a using directive or an assembly reference?) And some Json errors then like afew Log4Net or something. plz help.
Posts 115 of 23 · Page 1 of 2
This thread is closed for replies.

Similar Threads

Tags for this Thread

None

Need help?