mxserver-2013-08-21-1197 (Updated 2013-09-11)

Post anything about MX Simulator here. Please. I'm begging you.
wheels1758
Posts: 4132
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: mxserver-2013-08-21-1197

Post by wheels1758 »

jlv wrote:
wheels1758 wrote:
jlv wrote:I guess Perl or PHP. I'd say use Javascript with node.js, but it's not ubiquitous like Perl/PHP.
Is there a way to receive data back from the server to the script (contents of a listplayers, for example)?
Use the lineup file and the results file.
How often is the lineup file saved?
jlv
Site Admin
Posts: 15466
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: mxserver-2013-08-21-1197

Post by jlv »

It's updated at the start of a race, after a player's key is verified and when a player disconnects.
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.
wheels1758
Posts: 4132
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: mxserver-2013-08-21-1197

Post by wheels1758 »

I really shouldn't post so quickly.

1. I'm getting a really weird number of spaces between each item in the lineup file. That's not really the issue, since it is easy enough to split on whitespace (or multiple in a row). Is is possible to write a default name or number (ie '(none)') if one of those is left out?

2. My server console is saying "Can't rename lineup file: File exists", and is therefore not updating.
wheels1758
Posts: 4132
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: mxserver-2013-08-21-1197

Post by wheels1758 »

Dangit.

What are the options for status?

I've seen Player and Zombie. I'd expect Spectator as one. What does Zombie mean?
Phathry25
Posts: 7481
Joined: Sat Dec 01, 2007 1:09 am
Team: No Frills Racing
Location: WI
Contact:

Re: mxserver-2013-08-21-1197

Post by Phathry25 »

Zombie is disconnected.
wheels1758
Posts: 4132
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: mxserver-2013-08-21-1197

Post by wheels1758 »

Phathry25 wrote:Zombie is disconnected.
I was confused because it updates when a player disconnects...


I made my script call my script.......scriptception!
jlv
Site Admin
Posts: 15466
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: mxserver-2013-08-21-1197

Post by jlv »

wheels1758 wrote:I really shouldn't post so quickly.

1. I'm getting a really weird number of spaces between each item in the lineup file. That's not really the issue, since it is easy enough to split on whitespace (or multiple in a row). Is is possible to write a default name or number (ie '(none)') if one of those is left out?

2. My server console is saying "Can't rename lineup file: File exists", and is therefore not updating.
I'll fix the empty names. Not sure about the rename failing. Probably a permissions problem. The reason it writes to a temp file and then renames it is so you'll never get a partially updated file when you read it.
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.
wheels1758
Posts: 4132
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: mxserver-2013-08-21-1197

Post by wheels1758 »

Seems like sending commands to the server only happens after the script has completed. How would you recommend getting a full race night set up? Is it possible to run a script in the background that waits for a race to finish, then calls the next script? (I was experimenting with PHP, if that matters)
AWood
Posts: 4657
Joined: Fri Mar 30, 2012 4:05 am
Team: Who Knows...
Location: Test Tracks and In N Out

Re: mxserver-2013-08-21-1197

Post by AWood »

wheels1758 wrote:
Phathry25 wrote:Zombie is disconnected.
I was confused because it updates when a player disconnects...


I made my script call my script.......scriptception!
Yay recursion!
barrington314 wrote:awood is right
Leclair wrote:My name is barking
Leclair wrote:i fuck you
2014 rF GNC 22nd Overall - 2014 rF 450 SX 12th - 2014 rF 450 MX 11th Overall
2013 rF GNC 17th Overall - 2013 rF 450 SX 17th - 2013 rF 450 MX 8th - 2013 EMF French Cup Open World 6th
jlv
Site Admin
Posts: 15466
Joined: Fri Nov 02, 2007 5:39 am
Team: No Frills Racing
Contact:

Re: mxserver-2013-08-21-1197

Post by jlv »

wheels1758 wrote:Seems like sending commands to the server only happens after the script has completed. How would you recommend getting a full race night set up? Is it possible to run a script in the background that waits for a race to finish, then calls the next script? (I was experimenting with PHP, if that matters)
They should go immediately. Worked in my qualifying script anyway.
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.
Paulo#33
Posts: 370
Joined: Mon Nov 14, 2011 11:33 pm
Team: Me and God

Re: mxserver-2013-08-21-1197

Post by Paulo#33 »

Josh, can you send or explain all variables , functions and strings.
Or the Scripting reference with resources ?

I'm JavaScript and C# Programmer, but i dont know , how i start the script :(
Hello i'm MotocrossPlays Channel
Image
Check out and subscribe
http://youtube.com/user/pingo33
Image
wheels1758
Posts: 4132
Joined: Tue Oct 21, 2008 5:20 pm
Location: Washington, USA
Contact:

Re: mxserver-2013-08-21-1197

Post by wheels1758 »

Paulo#33 wrote:Josh, can you send or explain all variables , functions and strings.
Or the Scripting reference with resources ?

I'm JavaScript and C# Programmer, but i dont know , how i start the script :(
Any server specific commands can be found in README.txt.

Other than that it is no different from any other script. There is no real reverse interaction between the server and the code you write, it just executes any commands you send to it.

If you install node.js on the computer from which you are running the server, you can write your script(s) in Javascript. Not all servers will have node.js installed though, as JLV mentioned previously.
MOTOZ293
Posts: 3083
Joined: Wed Mar 06, 2013 7:17 pm
Team: Hog Heaven Racing
Location: Ohio

Re: mxserver-2013-08-21-1197 (Updated 2013-09-11)

Post by MOTOZ293 »

My friend and i have a private server and we cant get it to work. weve tried everyrthing. when i try to join it just says contacting server. NEED HELP
Image
jason_pama
Posts: 709
Joined: Tue Dec 25, 2012 8:29 pm
Team: MotoRAD
Location: Los Angeles, California
Contact:

Re: mxserver-2013-08-21-1197 (Updated 2013-09-11)

Post by jason_pama »

MOTOZ293 wrote:My friend and i have a private server and we cant get it to work. weve tried everyrthing. when i try to join it just says contacting server. NEED HELP
you have to port forward your port
MOTOZ293
Posts: 3083
Joined: Wed Mar 06, 2013 7:17 pm
Team: Hog Heaven Racing
Location: Ohio

Re: mxserver-2013-08-21-1197 (Updated 2013-09-11)

Post by MOTOZ293 »

jason_pama wrote:
MOTOZ293 wrote:My friend and i have a private server and we cant get it to work. weve tried everyrthing. when i try to join it just says contacting server. NEED HELP
you have to port forward your port
Tried that didnt work
Image
Post Reply