Salut, j'ai créer un serveur, l'an dernier, et pas mal de mec du team aussi l'on fait à l'époque où on jouait tous.
Je te met le tutoriel qui vient de mxsim.com, si tu à des problèmes, dis le moi, je me replongerais dedans pour t'indiquer la marche a suivre.
télécharger le serveur
Mxserver Tutorial
New postby yzmxer608 » Tue Feb 09, 2010 4:09 am
I think this tutorial has been needed for a while. I'll try to cover it as best as I can.
Creating the Server:
First you will have to download the server app, you can get it here. Once you have it downloaded unzip it to a location of your choice. Now read the readme.txt, it will most likely answer a lot of your questions before reading the rest of this. It covers pretty much everything about the app, but I'll try to focus on getting a basic server up and running. There is a template that includes a batch file to run the server in the server download.
I usually make the args file first, it's what tells the server all of the information it needs to run properly. I find it easier to organize using the args file instead of putting everything in the command line. Using the readme as a guideline, here is what you want to put in the args file, I will only add the basic parameters, if you want to use the more advanced parameters they are explained in the readme:
- --port xxxx
o Enter the port you want to use. Most people use 19800, you don't have to use it, but I'd reccomend using it just because it's easier to remember.
- --max-clients x
o Replace X with the max amount of people you want to have in your server. It's best to cap it at what your network can handle, to find that out refer to this table jlv made, when calculating use your upload speed rather than download. If you don't know what your upload speed is, do this test here. Just remember, it gives your speed in megabits per second, while this chart is in bytes. To convert megabits to bytes use the calculator on this site. Just enter the appropriate number and from the drop-down box choose megabits and click calculate. Use the number next to bytes for this chart:
In bytes per second, here's an approximation of how much bandwidth you need for a given number of players:
o 1 3808
o 2 10624
o 3 20448
o 4 33280
o 5 49120
o 6 67968
o 7 89824
o 8 114688
o 9 142560
o 10 173440
o 11 207328
o 12 244224
o 13 284128
o 14 327040
o 15 372960
o 16 421888
o 17 473824
o 18 528768
o 19 586720
o 20 647680
o 21 711648
o 22 778624
o 23 848608
o 24 921600
o 25 997600
o 26 1076608
o 27 1158624
o 28 1243648
o 29 1331680
o 30 1422720
o 31 1516768
o 32 1613824
o 33 1713888
o 34 1816960
o 35 1923040
o 36 2032128
o 37 2144224
o 38 2259328
o 39 2377440
o 40 2498560
- --password xxx
o Replace XXX with the password you want to use for the server. You will be required to use a password to use the administrator privileges of the server.
o While we are at it, create another shortcut for the mx.exe (go to where you installed the game and find mx.exe, right click it and go down to "Create shortcut"). Once the shortcut is created, right click it and go down to Properties. In the new window, at the Target box, add a space at the end of ...\mx.exe" and add --password xxx. Again, replace xxx with the password you want to use. You will use this shortcut just for connecting to your server. You can do this to your existing shortcut, but if you try and connect to anyone else's server you will not be able to join since the passwords won't match.
- --greeting "xxx"
o Here you can enter the greeting people will see when they enter the server.
- --ban-file xxx
o This is what specifies the name of the file ban info will be stored in. Just use bans.txt.
- --results-file xxx
o Same as with the ban file, results.txt is common.
- --track-interval xxx
o This is what tells the server when it's time to switch to the next track, the parameter is in minutes (a track interval of 15 would be 15 minutes until the track will automatically switch, if 15 minutes is passed during a race the track will change for the next race).
- --laps xxx
o Sets the number of laps for each race.
- Next major thing is to get the trackinfo files for the tracks you want to have on the server. To get them, go in game and start a race on whatever track you want. While at the track, in the chat window (press 't') type /savetrackinfo. The file will be saved to your personal folder, note that you will have to do this individually for each track you want.
Once you have all of the trackinfo files you want, it's time to actually add them to the server. There is a folding in the mxserver directory named trackinfo, put all of your trackinfo files into it. Now we have to go back to the args file, you will now have to add a line of text with the name of each trackinfo file. Before the name of each trackinfo file, just add trackinfo/... (this tells the server to look in the trackinfo folder for the trackinfo files). An example for what you would use is:
o trackinfo/alcrest.trackinfo
o trackinfo/locust.trackinfo
o trackinfo/x1b.trackinfo
o trackinfo/overhill.trackinfo
Running the Server:
Now everything you need for the server to run is there. To get the server running I create a batch file, it's easy to use (once made). Note, jlv has released a batch file to run the server in the lastest server download, which is linked at the top of this post.
- Right click somewhere (desktop is fine) and go to New, then choose text file from the list. You can name it anything you want, startserver is descriptive enough. Open the txt file and use this as a guideline:
Code: Select all
cd Directory Of mxserver
mxserver.exe --args-file serverargs.txt
o So for example, if you had your mxserver folder on your desktop, you would have (for Win7/Vista):
Code: Select all
cd C:\Users\YourName\Desktop\mxserver
mxserver.exe --args-file serverargs.txt
- The 'cd' just changes the working directory of the command prompt, so it "operates" out of where you tell it to (in our case the mxserver folder). The next line starts the mxserver.exe and passes --args-file serverargs.txt as a parameter, telling the server to use the args file you created. When you are done save the txt file, but, after you saved it right click the file and go to Rename, you can keep the actual name the same but delete the .txt and replace it with .bat. (you can skip this if you use Notepad++ and just save it as a .bat file right away). You will get a warning about changing the file type, just click Ok.
Now, all you should have to do is double click your new batch file and your server should start up. If the command prompt doesn't stay open something has gone wrong. First thing to check is if there are any typos in your args file, if that doesn't work try right clicking the batch file and go to Run as administrator.
Connecting To the Server:
Now that you have your server up and running it's time to do some racing!
- Have your server running, then use the second mx.exe shortcut you created (the one you added your password to) to start the game. Go to the Multiplayer menu and type '127.0.0.1' (without the quotes). This is what you have to use to enter YOUR own server, only you use that.
- Now for other people to join, they will have to use your ip. To find what your ip is you can go to a site like What Is My IP Address?, tell that number to whoever is going to join your server so they can use it. In game they will enter exactly what the site shows you (no spaces). You can add :port to the end of it if you want (replace port with the port number you used in your args file).
Troubleshooting Connecting:
If people can't join your server there could be a couple things wrong.
- The first is you have a firewall that is blocking them. You will have to let mx.exe be an exception to your firewall (every firewall is different, if you don't know how just search the internet).
- A second possibility could be that you have to forward your router's ports for the port you are using for your server. To do this go to Port Forward. This website will NOT forward the ports for you, it will just tell you steps to take to do it. Find your router brand and model in the list, if you don't know the model take a look on your router and you should find a model number/name. That will take you to a page with the names of a bunch of programs, since the mxserver.exe is not listed just click some random program, we just need the directions for your router model.
- Follow the directions until you get to the part where you enter the port forward parameters. When you get to that point select the UDP protocol and change it's port from 19800 to 19800 (or whatever port number you used in your args file). It doesn't matter what name you choose, I suggest mxserver so you will know which one it is later if you ever need to edit it. After that save the changes and you should be Ok.
Uploading Results to Stats Page:
This will tell you how to have the results from races uploaded to the main stats site.
- First download curl, you can get it from here, just place it in your server folder with everything else.
- Next make another batch file, name it anything you want. In it put:
Code: Select all
curl -s -F "name=your ip " -F "password=a password" -F "results=<results.txt" http://mxsimulator.c...loadresults.php
- Keep all of the double quotes, but replace 'yourip' with your ip address (http://ipchicken.com), make a password (you'll need to keep using it, just don't change it).
- Now open your args file again and add:
Code: Select all
--results-cmd Results_Upload.bat
- Rename 'Results_Upload.bat' to whatever you named your batch file.
That's all you have to do, start you server and make sure it runs.
I hope this tutorial has helped some people. A lot of what was stated is in the readme file, I just wanted to make it more public so people can discuss or find out things they skipped over before. Feel free to leave comments about what can be added/changed.
Thanks to jlv for the bandwith list and explanation on the stats page, thanks to DJ for explanation on the stats page.
Source yzmxer608 du forum mxsimulator.com