Tutorial:Dota Ladder Creation

From Eurobattle.net WiKi
Revision as of 23:46, 21 December 2011 by 127.0.0.1 (talk)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

[COLOR="DarkOrchid"][B][SIZE="5"][Tutorial] How to make your own dota ladder?[/SIZE][/B][/COLOR]


Are you an owner of ghost++ or ghostOne? Would you like to make your own dota ladder to be displayed on your own site? This is the right tutorial for you.


[COLOR="red"][B][SIZE="7"]MAIN STEP BY STEP[/SIZE][/B][/COLOR] [B]FOLLOW THIS TUTORIAL EXACTLY AS IT SAYS OR YOU MIGHT ENCOUNTER ERRORS![/B]

Difficulty: Medium Time: ~1 hour, depends on you


If you don't yet own a ghost, go and either download ghost++ or ghostOne (recommended). You can get either of them here: [url]http://forum.codelain.com/[/url]

Tutorials about setting up ghost and other related things can be found here: [url]http://eurobattle.net/showthread.php?t=79455[/url]

I suggest getting GhostOne, because you will need it later to transform your old database to mysql. If you're on linux, you'll have to use ghost++ and external tools for transformation.


[B]STEP 1.1[/B] In order to host your site, you will need to setup a server on your PC. If you already own one (needs PHP+MySQL) skip this step.

If you don't own a server already, go [B]download and install WAMP server[/B]: [url]http://www.wampserver.com/en/download.php[/url]

Running linux? Get LAMP server instead.

[B]STEP 1.2[/B] Run WAMP server. LEFT click on the tray icon, select Start all services. Open the menu again and click Put Online. When the server is online you will see a white tray icon with the indicator to full. Now go in your modem/router configuration and [B]open port 80 (port forward)[/B]. After you open the port 80, you can now reach your server by putting your IP in browser's adress bar. You can find out your IP here: [url]http://www.whatismyip.com/[/url]. Make sure you also open port 80 on your firewall, if you don't do that, firewall will block all the trafic and nobody will be able to acces your website.

Now left click on tray icon of WAMP server and run phpmyadmin.

In the "create new database" field, type a random name for your database, ex: dotaladder, and create the database. Make sure you remember this name because you will need it later on.

Now select the newly created database (if it's not already selected-on the menu on the left), click on Privileges tab and click on Add new user. Input your new Username, set Hostname=localhost (if you own an external server put your IP here) and Password. In the Global Privileges click on Check all to check all the boxes and hit Go button. Creating a new user is optional, you can also use pre-existing root account, but it has no password and might be vulnerable to hackers. It is recommended to set a new password for root account as soon as possible.

[B]STEP 1.3[/B] Now select your database again (if it's not selected already) and hit the Import tab. Open your Ghost folder and search for:

for GhostOne: mysql_create_tables_v2.3one.sql for Ghost++: mysql_create_tables_v2.sql [U]File names are outdated, make sure you select the latest version that you find in your ghost folder.[/U]

Hit the Go button to import the tables.

[B]STEP 1.4[/B]

Download and install TortoiseSVN [url]http://tortoisesvn.net/downloads[/url]

Restart your PC.

[B]STEP 1.5[/B] Now run WAMP server again, left click on tray and open www directory. Create new folder in www directory and call it whatever you want ex: allstats. Now run [I][B]explorer [/B][/I] (Go: Run>explorer) and in the map treeview search for c:\wamp\www\yourfolder folder. Right click on your folder and select SVN checkout.

In the URL of repository, copy this link: [url]http://allstats.googlecode.com/svn/trunk/[/url]

The checkout repository must be your custom folder you made back then. Hit the Ok button to start downloading Dota Allstats source files.

This is the main part of the tutorial. To find out more about the Allstats source, visit [url]http://code.google.com/p/allstats/[/url]

Wait for the files to download.

[B]STEP 1.6[/B] Open file config.php (it downloaded in your folder) to configure your settings. I recommend using some site editor program but notepad should do the work too. Just be carefull not to save the file as .txt and make sure you choose utf8 coding.

The following lines are [B]necessary [/B]to be edited:

[QUOTE]$host = 'localhost'; $username = 'TheUsernameYouCreatedInTheDatabase'; $password = 'TheUsernamePassword'; $databasename = 'TheNameOfYourDatabaseYouCreated'; $botName = 'YourBotName'; $rootAdmin = 'Bot'sRootAdmin';[/QUOTE]

Other lines are optional.

[B]STEP 1.7[/B]

Now open PhPMyadmin and select your GHost database on the left. Select the import tab. Click choose file and select the MySQLSetup.sql file (located in your allstats folder). Click Import.

[B]STEP 1.8[/B]

You're almost done! You can now reach your dota ladder page by putting your IP in the browser's address bar. ex: [B]yourIP/nameofyourfolder/[/B] You will notice that your ladder is currently empty. In order to import all the data from your old database (if you were using sqlite so far), open GhostOne->Database->Open database (wamp server must be running! after opening the "Import from sqlite" button should appear)->Import from sqlite->Check all boxes and Import. You're done!

When importing from old database it could happen that no dota games are imported. This is because you probably weren't using the correct map cfg-s. For dota games to be saved in database, you need to open up your dota cfg, search for line map_type and set it to: map_type=dota

[COLOR="RoyalBlue"][B][SIZE="7"]OPTIONAL-HIGHLY RECOMMENDED[/SIZE][/B][/COLOR]

[B]STEP 2.1 - Hiding your IP from public[/B]

If you want to share the ladder with your friends or with public, it's recommended to hide your IP from them and all other people.

Go on: [url]http://www.no-ip.com/[/url]

Select NO-IP Free, fill up your e-mail and sign up. Fill all the textboxes with your info and create new account. After receiving activation e-mail follow the activation link to activate your account.

After that, login and click on Host/Redirects tab. Select Add host, choose your domain name (it will include no-ip.org on the end but it's free!), choose DNS Host (A) option, enter your IP address and create the host. If you have dynamic IP you should also download and install their client which must be run everytime you reconnect to your internet. Their client will assign the correct IP to the domain, because dynamic IP changes on every reconnect.

And now you're done! You can check your domain name under [U]Manage hosts[/U] link. Simply enter the adress in your adress bar like this: yourdomainname.no-ip.org/nameofyourfolder/ and that's it!


[B][COLOR="Red"]IMPORTANT INFO![/COLOR][/B] -your ghost won't be able to start if mysql service isn't working. WAMP server must be running (offline or online, doesn't matter) or bot won't be able to connect. But, [B]if you want your ladder site to be visible to the public, your server must be Online.[/B] -if you want to start WAMP server on system startup, go Run->type in "shell:startup" and make a shortcut to wamp in the folder which opens (right click on wamp shortcut, hold it and release in Startup folder->create shortcut). You can do this for any other program. -after you succesfully setup allstats, you can uninstall Tortoise SVN, as you probably won't need it for the rest of your life if you're an average user. It'll only take your resources on startup etc. That tool is only needed to download the allstats source files.

If you encounter any errors feel free to post or PM me. (cen)