Mxserver Tutorial
-
- Crushed Dissenter
- Posts: 326
- Joined: Mon Oct 13, 2014 3:46 pm
- Team: MTFactory
Re: Mxserver Tutorial
Someone have a script for read the "results.txt" file like "mxsimulator.com/uploadresults.php"
And I try to understand how the times unit is use but i don't find :S
And I try to understand how the times unit is use but i don't find :S
-
- Crushed Dissenter
- Posts: 326
- Joined: Mon Oct 13, 2014 3:46 pm
- Team: MTFactory
Re: Mxserver Tutorial
Edit : I find this script : http://mxsimulator.com/scripts/lapchart.py
How can i use in my website ?
How can i use in my website ?
-
- Posts: 893
- Joined: Fri Jan 18, 2013 4:26 am
- Team: LCQ Studios
- Location: McHenry, Illinois
- Contact:
Re: Mxserver Tutorial
Youll need some kind of python processor for your web server. I believe Django is a popular tool for that? I could be wrong though as I never use python for web based projects.MxWayGamer wrote:Edit : I find this script : http://mxsimulator.com/scripts/lapchart.py
How can i use in my website ?
-
- Posts: 73
- Joined: Sat May 14, 2016 8:48 pm
- Team: EVP
Re: Mxserver Tutorial
can you change the server ip from yours to a custom name??
-
- Posts: 261
- Joined: Thu Sep 13, 2012 5:49 pm
- Team: MXS-Concept.com
- Location: Switzerland
- Contact:
Re: Mxserver Tutorial
That's DNS side, you have to buy a domain name and add a pointer to your IP.caden__s144 wrote:can you change the server ip from yours to a custom name??
i.e. you buy MYDOMAIN.com and you can redirect mx.mydomain.com to your IP 10.10.10.10 then your router has to NAT the requests to the mxsim server port (19800 ie.).
Niko | Mouk Lab | Admin of MXS-Concept // MyMXB // MXBikes-Shop // among others. | YouTube
Re: Mxserver Tutorial
This is exactly what I have done. I have purchased "storkenmxs.com" and let the sub-domain "server.storkenmxs.com" redirect the user to my IP at home, then it forwards the traffic on the port 19800 to my PC. If I have my mx sim server running, people get connected to it.MX4EVER wrote:That's DNS side, you have to buy a domain name and add a pointer to your IP.caden__s144 wrote:can you change the server ip from yours to a custom name??
i.e. you buy MYDOMAIN.com and you can redirect mx.mydomain.com to your IP 10.10.10.10 then your router has to NAT the requests to the mxsim server port (19800 ie.).
Discord: StorkeN#6883 - StorkenMXS Youtube - StorkenMXS Instagram - StorkenMXS Facebook - TMFR on Faceboook
Re: Mxserver Tutorial
While reading this Nate, it really came in useful. This time I tried my luck with sending packages to the server. I modified the code you provided a bit, so you can with this enter any command you want, as the terminal will prompt you for the command. Also I added the #/usr/bin/python in the beginning, not really sure if that is needed, but since I didn't want to put it in the root dir, I assumed it might be good to have.
The modification here is that it cuts out after the "xPASSWORD" part and prompts the user for a command. The "server," part of the command is not needed as you'd type it in a server, if anyone wonders. When it prompts you, let's say you want to set the track 5, then type "settrack 5" without the quotation marks. If you'd like to broadcast a message, then type "broadcast This is a cool broadcast message for you!". This is my first time trying to do something useful with python so there might be better ways to do this than I was able to do, also maybe someone has made it before. Yet I though I could share it
Code: Select all
#/usr/bin/python
import socket
UDP_IP = "127.0.0.1"
UDP_PORT = 19800
MESSAGE = "x123"
command = raw_input('Enter the command you wish to execute: ')
MESSAGE += command
print "UDP target IP:", UDP_IP
print "UDP target port:", UDP_PORT
print "message:", MESSAGE
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) #internet # UDP
sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
Discord: StorkeN#6883 - StorkenMXS Youtube - StorkenMXS Instagram - StorkenMXS Facebook - TMFR on Faceboook
-
- Posts: 261
- Joined: Thu Sep 13, 2012 5:49 pm
- Team: MXS-Concept.com
- Location: Switzerland
- Contact:
Re: Mxserver Tutorial
And thank you for sharing dudeWahlamt wrote:Yet I though I could share it
Niko | Mouk Lab | Admin of MXS-Concept // MyMXB // MXBikes-Shop // among others. | YouTube
Re: Mxserver Tutorial
So I made this too, in hopes that it would be able to be a simple solution for people at home, but unfortunately not. It is yet another way to send commands to a server, via a web interface, looking like this
Now onto the problems
When I made this, I had in mind that it should work really simple, you install a web server (XAMPP for example) and put the folder in place. Unfortunately it worked... sort of... Upon installing XAMPP (LAMPP on Linux) on my Ubuntu 16.04 machine, I apparently got "sockets" installed with the PHP, allowing you to create "sockets" that can send UDP packages to localhost (send the commands to your local server). However on my windows machine when I installed XAMPP, I did not get the "sockets" extension included, so it did not work on my windows machine, took a while to figure out why.. So ultimately, it works fine with XAMPP on my Ubuntu 16.04LTS machine, but not on windows as of now.
If you decided to download it, just change the "x1234" part in the file called "phpudp.php", it's commented right above it in the code so it should be easy to understand.
Download
What's included?
Now onto the problems
When I made this, I had in mind that it should work really simple, you install a web server (XAMPP for example) and put the folder in place. Unfortunately it worked... sort of... Upon installing XAMPP (LAMPP on Linux) on my Ubuntu 16.04 machine, I apparently got "sockets" installed with the PHP, allowing you to create "sockets" that can send UDP packages to localhost (send the commands to your local server). However on my windows machine when I installed XAMPP, I did not get the "sockets" extension included, so it did not work on my windows machine, took a while to figure out why.. So ultimately, it works fine with XAMPP on my Ubuntu 16.04LTS machine, but not on windows as of now.
If you decided to download it, just change the "x1234" part in the file called "phpudp.php", it's commented right above it in the code so it should be easy to understand.
Download
What's included?
- The normal page shown above
- A .php and a .py file if you rather would like to call php to execute a .py script instead of doing it just in normal php. If this is a bigger desire, just change in "scripts.js" to that php (runcommand.php) file and it'll call the .py script.
- Command.py is the same as 2 posts ago, a script that you launch in the terminal, it asks you for a command, you enter it and the script sends the package. To note, this script is not valid in python 3.x
Discord: StorkeN#6883 - StorkenMXS Youtube - StorkenMXS Instagram - StorkenMXS Facebook - TMFR on Faceboook
Re: Mxserver Tutorial
Thanks for posting, this works great . I added one thing to it, if at the end of the script you putWahlamt wrote:While reading this Nate, it really came in useful. This time I tried my luck with sending packages to the server. I modified the code you provided a bit, so you can with this enter any command you want, as the terminal will prompt you for the command. Also I added the #/usr/bin/python in the beginning, not really sure if that is needed, but since I didn't want to put it in the root dir, I assumed it might be good to have.
The modification here is that it cuts out after the "xPASSWORD" part and prompts the user for a command. The "server," part of the command is not needed as you'd type it in a server, if anyone wonders. When it prompts you, let's say you want to set the track 5, then type "settrack 5" without the quotation marks. If you'd like to broadcast a message, then type "broadcast This is a cool broadcast message for you!". This is my first time trying to do something useful with python so there might be better ways to do this than I was able to do, also maybe someone has made it before. Yet I though I could share itCode: Select all
#/usr/bin/python import socket UDP_IP = "127.0.0.1" UDP_PORT = 19800 MESSAGE = "x123" command = raw_input('Enter the command you wish to execute: ') MESSAGE += command print "UDP target IP:", UDP_IP print "UDP target port:", UDP_PORT print "message:", MESSAGE sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) #internet # UDP sock.sendto(MESSAGE, (UDP_IP, UDP_PORT))
Code: Select all
execfile("sendcommands.py")
I'll add it to the first post .
Also jlv something I noticed, if you send a command to broadcast, it shows in the server but doesn't show in the server cmd window. If you send it from in game it does show it in the cmd window, why is that?
TeamHavocRacing wrote:If I had a nickel for every time someone asked for this, I would have a whole shitload of nickels.
Re: Mxserver Tutorial
Not sure. My current source prints it on the console both ways, but I've added more logging since the last posted server version. There have been enough changes I should probably make a new server release.yzmxer608 wrote:Also jlv something I noticed, if you send a command to broadcast, it shows in the server but doesn't show in the server cmd window. If you send it from in game it does show it in the cmd window, why is that?
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Re: Mxserver Tutorial
Please make a --mutefile.txt or something so people can stay muted after the server is shut down and restartedjlv wrote:Not sure. My current source prints it on the console both ways, but I've added more logging since the last posted server version. There have been enough changes I should probably make a new server release.
Discord: StorkeN#6883 - StorkenMXS Youtube - StorkenMXS Instagram - StorkenMXS Facebook - TMFR on Faceboook
Re: Mxserver Tutorial
Try using (mute) as the ban reason in the ban file. Like this if you wanted to permanently mute UID 23355:
0 23355 (mute)
0 23355 (mute)
Josh Vanderhoof
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
Sole Proprietor
jlv@mxsimulator.com
If you email, put "MX Simulator" in the subject to make sure it gets through my spam filter.
-
- Posts: 261
- Joined: Thu Sep 13, 2012 5:49 pm
- Team: MXS-Concept.com
- Location: Switzerland
- Contact:
Re: Mxserver Tutorial
jlv wrote:I should probably make a new server release.
Niko | Mouk Lab | Admin of MXS-Concept // MyMXB // MXBikes-Shop // among others. | YouTube
Re: Mxserver Tutorial
I was wondering how you get downloaded tracks from TM to work on a server. Every time I try it says the track cannot be found. Help?