Page 32 of 33

Re: Mxserver Tutorial

Posted: Sat May 14, 2016 5:34 pm
by MxWayGamer
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

Re: Mxserver Tutorial

Posted: Sat May 14, 2016 6:08 pm
by MxWayGamer
Edit : I find this script : http://mxsimulator.com/scripts/lapchart.py
How can i use in my website ?

Re: Mxserver Tutorial

Posted: Sat May 14, 2016 7:39 pm
by LKR47
MxWayGamer wrote:Edit : I find this script : http://mxsimulator.com/scripts/lapchart.py
How can i use in my website ?
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.

Re: Mxserver Tutorial

Posted: Thu Jun 23, 2016 5:37 am
by caden__s144
can you change the server ip from yours to a custom name??

Re: Mxserver Tutorial

Posted: Thu Jun 23, 2016 8:01 am
by MX4EVER
caden__s144 wrote:can you change the server ip from yours to a custom name??
That's DNS side, you have to buy a domain name and add a pointer to your IP.

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.).

Re: Mxserver Tutorial

Posted: Thu Jun 23, 2016 8:34 am
by Wahlamt
MX4EVER wrote:
caden__s144 wrote:can you change the server ip from yours to a custom name??
That's DNS side, you have to buy a domain name and add a pointer to your IP.

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.).
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.

Re: Mxserver Tutorial

Posted: Fri Aug 05, 2016 9:18 pm
by Wahlamt
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.

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))
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 :)

Re: Mxserver Tutorial

Posted: Mon Aug 08, 2016 7:26 am
by MX4EVER
Wahlamt wrote:Yet I though I could share it :)
And thank you for sharing dude :)

Re: Mxserver Tutorial

Posted: Fri Aug 12, 2016 10:07 am
by Wahlamt
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
Image

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
Also, I did NOT get the webpage (php) to work as I wanted in Apache2 on my linux machine.

Re: Mxserver Tutorial

Posted: Sat Aug 13, 2016 12:40 am
by yzmxer608
Wahlamt 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.

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))
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 :)
Thanks for posting, this works great :). I added one thing to it, if at the end of the script you put

Code: Select all

execfile("sendcommands.py")
Where sendcommands.py is whatever name you gave the script, it'll "keep" the prompt open (it really just opens it again) so you don't have to reopen it every time you want to send another command.

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?

Re: Mxserver Tutorial

Posted: Sat Aug 13, 2016 2:27 am
by jlv
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?
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.

Re: Mxserver Tutorial

Posted: Sat Aug 13, 2016 7:01 am
by Wahlamt
jlv 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.
Please make a --mutefile.txt or something so people can stay muted after the server is shut down and restarted ;)

Re: Mxserver Tutorial

Posted: Sun Aug 14, 2016 2:02 am
by jlv
Try using (mute) as the ban reason in the ban file. Like this if you wanted to permanently mute UID 23355:

0 23355 (mute)

Re: Mxserver Tutorial

Posted: Tue Aug 23, 2016 9:55 am
by MX4EVER
jlv wrote:I should probably make a new server release.
:D :D :D :D :D :D

Re: Mxserver Tutorial

Posted: Fri Aug 26, 2016 3:10 am
by kittin
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?