Jump to content
Sign in to follow this  
terox

Using reserved variable missionstart

Recommended Posts

The reserved variable missionstart, creates an array of the following elements

[year,month,day,hour,minute,second]

I have had some success extracting these elements, reorganising them and displayinmg them using titletext

When i run the following script on my local windows machine, in PBO format (and in mission editing format)it states the correct date and time that i started the mission

eg

5-5-2003 at 14:50 hrs

However when i run it on a linux dedicated server it displays the following

1 - 1 - 1970 at 1:0 hrs

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

I run the following script on the server only

*********************************************

?!(local server):exit

~1

mapname = mymapname

;; The following lines use elements from reserved variable ;; MISSIONSTART so that during the final score screen

;; The date and time the map was started on the server can be publicly shown

?(local Server):serveryear = missionstart select 0;publicvariable "serveryear"

?(local Server):servermonth = missionstart select 1;publicvariable "servermonth"

?(local Server):serverday = missionstart select 2;publicvariable "serverday"

?(local Server):serverhour = missionstart select 3;publicvariable "serverhour"

?(local Server):serverminute= missionstart select 4;publicvariable "serverminute"

~5

serverstart = Format["%1 - %2 - %3 at %4 : %5 Hrs",serverday, servermonth, serveryear, serverhour, serverminute]

~1

titletext[format["%1\n started on server at \n%2\n<<< FINAL SCORE >>>\nTied Game!\nEAST %3    <-->    WEST  %4",mapname,serverstart,EScore,WScore],"PLAIN"]

I havent access to a windows server, and therefore i cannot check to see if this is a linux problem only. Could somebody please run these scripts in a test map on a WIN server and see if they get the same results

Please note leave a delay between the server PV'ing the elements of the array and stating the serverstart array, otherwise inconsistencies occur due to synch problems

Thanks in advance

Share this post


Link to post
Share on other sites

One thing I can tell you is sometimes misisonstart is only filled by the second time you play a multiplayer mission. It is never filled in single player. smile_o.gif

Share this post


Link to post
Share on other sites
One thing I can tell you is sometimes misisonstart is only filled by the second time you play a multiplayer mission.

How can that be, if the array is given at all then it will be given all times. How could an OFP dedicated server know how many times a mission has been played anyway

I tried rerunning the same pbo file multiple times and i still get the 1 - 1 1970 date on a linux machine.

My only assumption is that Missionstart must be coded in such a way that it reads the clock on a winX machine and is not able to read it on a Linux system.

Even thoughj i have access to a linux server, I know diddly squat about the 0/S, so maybe a linux expert could answer this. What i really need is someone to run the above scripts on a win server and see what it reports

Share this post


Link to post
Share on other sites
One thing I can tell you is sometimes misisonstart is only filled by the second time you play a multiplayer mission.

How can that be, if the array is given at all then it will be given all times. How could an OFP dedicated server know how many times a mission has been played anyway

Hey, I'm just telling you what I've seen. smile_o.gif What causes a strange behaviour like that is not my concern really.

EDIT: And you did place the gamelogic "server" right?

Share this post


Link to post
Share on other sites

yes ofcourse i have the gamelogic server. As i said before, when i run it on my win player server it works fine.

I dont have access to a dedicated windows server, so i cant test it on their

When i test it on the Linux server it displays 1, 1, 1970 at 1:0 hrs

If someone has access to a dedicated windows server then could they please run this script in a basic map and see what it throws back. This is all i need.

Its just so i can compare the linux returned values to the win retuned values and if they are different, i know the fault lies with the OFP/Linux mix

Share this post


Link to post
Share on other sites

What's the problem then, I have used missionstart and it returned the proper date/time in a Windows based server. Then the problem is with the combination you have, not sure if it's every Linux server though but probably. (unless you modified some crapola in Linux)

Share this post


Link to post
Share on other sites
What's the problem then, I have used missionstart and it returned the proper date/time in a Windows based server.  

Thanks, youve answered my question.

It seems that missionstart cant read the clock settings on linux (If indeed it has any)

Share this post


Link to post
Share on other sites

Do you have a link to the test mission? I would try running it on my (linux) server too. Maybe the ofp linux server can't read the mission time and maybe he can not do so on YOUR server only... you know, all this rights/privileges stuff, setting the clock readable by root only and running the server as nobody or guest or something. BTW: the date on unix machines is measured in seconds from the 1.1.1970, so your date/time is effectively zero...

Share this post


Link to post
Share on other sites

Terox, what about not doing this only serverside?

What i mean is: let them clients have displayed their own

time and date and keep the server out of this issue.

:note - this would only make sense, if you're using the display

only as visual effect off course. If you further need the

variable missionstart, then you could still try to capture the

time/date from one of the clients, as clients should run

in windows AFAIK.

~S~ CD

Share this post


Link to post
Share on other sites

Quick explanation why i need it

i have recently taken over as chief map admin for the EFL league and am at present creating a CTF Template.

The final screen reports the final score, the name of the map and the date and time the map was played. Screenshots are likely to be taken of these for proof of a win

I thought about extracting the missionstart values from 1 of the clients and report that. And may still have to do that

Obviously the better way is to use the server. I cant let every client report their missionstart at the end, because screenshots wouldnt tally.

The majority of servers in EFL are windows servers, so it would only be a few that would display the 1-1-1970 message.

Thanks for the info on the linux clock, i didnt realise this. I knew the date 1-1-1970 must be significant but didnt know why.

Let me rip the map apart and mail you a basic map with just this missionstart system in it. Thanks Benu!!!!

Give me a couple of days, am up to the kneck in it at the moment

Share this post


Link to post
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
Sign in to follow this  

×