mirror of
https://github.com/FlightControl-Master/MOOSE.git
synced 2025-10-29 16:58:06 +00:00
Scoring working now ...
This commit is contained in:
parent
847813c741
commit
56fca825f0
@ -5489,7 +5489,6 @@ local _SCORINGCategory =
|
||||
--- Creates a new SCORING object to administer the scoring achieved by players.
|
||||
-- @param #SCORING self
|
||||
-- @param #string GameName The name of the game. This name is also logged in the CSV score file.
|
||||
-- @param #string ScoringCSV The name of the CSV file.
|
||||
-- @return #SCORING self
|
||||
-- @usage
|
||||
-- -- Define a new scoring object for the mission Gori Valley.
|
||||
@ -6146,7 +6145,7 @@ function SCORING:OpenCSV( ScoringCSV )
|
||||
if lfs and io and os then
|
||||
if ScoringCSV then
|
||||
self.ScoringCSV = ScoringCSV
|
||||
local fdir = lfs.writedir() .. [[Logs\]] .. self.ScoringCSV .. os.date( "%Y-%m-%d_%H-%M-%S" ) .. ".csv"
|
||||
local fdir = lfs.writedir() .. [[Logs\]] .. self.ScoringCSV .. " " .. os.date( "%Y-%m-%d %H-%M-%S" ) .. ".csv"
|
||||
|
||||
self.CSVFile, self.err = io.open( fdir, "w+" )
|
||||
if not self.CSVFile then
|
||||
@ -6160,7 +6159,7 @@ function SCORING:OpenCSV( ScoringCSV )
|
||||
error( "A string containing the CSV file name must be given." )
|
||||
end
|
||||
else
|
||||
self:E( "The MissionScripting.lua file has not been change to allow lfs, io and os modules to be used..." )
|
||||
self:E( "The MissionScripting.lua file has not been changed to allow lfs, io and os modules to be used..." )
|
||||
end
|
||||
return self
|
||||
end
|
||||
@ -6231,7 +6230,7 @@ function SCORING:ScoreCSV( PlayerName, ScoreType, ScoreTimes, ScoreAmount, Playe
|
||||
TargetUnitName = ''
|
||||
end
|
||||
|
||||
if lfs then
|
||||
if lfs and io and os then
|
||||
self.CSVFile:write(
|
||||
'"' .. self.GameName .. '"' .. ',' ..
|
||||
'"' .. self.RunTime .. '"' .. ',' ..
|
||||
@ -6256,7 +6255,7 @@ end
|
||||
|
||||
|
||||
function SCORING:CloseCSV()
|
||||
if lfs then
|
||||
if lfs and io and os then
|
||||
self.CSVFile:close()
|
||||
end
|
||||
end
|
||||
|
||||
@ -42,7 +42,6 @@ local _SCORINGCategory =
|
||||
--- Creates a new SCORING object to administer the scoring achieved by players.
|
||||
-- @param #SCORING self
|
||||
-- @param #string GameName The name of the game. This name is also logged in the CSV score file.
|
||||
-- @param #string ScoringCSV The name of the CSV file.
|
||||
-- @return #SCORING self
|
||||
-- @usage
|
||||
-- -- Define a new scoring object for the mission Gori Valley.
|
||||
@ -699,7 +698,7 @@ function SCORING:OpenCSV( ScoringCSV )
|
||||
if lfs and io and os then
|
||||
if ScoringCSV then
|
||||
self.ScoringCSV = ScoringCSV
|
||||
local fdir = lfs.writedir() .. [[Logs\]] .. self.ScoringCSV .. os.date( "%Y-%m-%d_%H-%M-%S" ) .. ".csv"
|
||||
local fdir = lfs.writedir() .. [[Logs\]] .. self.ScoringCSV .. " " .. os.date( "%Y-%m-%d %H-%M-%S" ) .. ".csv"
|
||||
|
||||
self.CSVFile, self.err = io.open( fdir, "w+" )
|
||||
if not self.CSVFile then
|
||||
@ -713,7 +712,7 @@ function SCORING:OpenCSV( ScoringCSV )
|
||||
error( "A string containing the CSV file name must be given." )
|
||||
end
|
||||
else
|
||||
self:E( "The MissionScripting.lua file has not been change to allow lfs, io and os modules to be used..." )
|
||||
self:E( "The MissionScripting.lua file has not been changed to allow lfs, io and os modules to be used..." )
|
||||
end
|
||||
return self
|
||||
end
|
||||
@ -784,7 +783,7 @@ function SCORING:ScoreCSV( PlayerName, ScoreType, ScoreTimes, ScoreAmount, Playe
|
||||
TargetUnitName = ''
|
||||
end
|
||||
|
||||
if lfs then
|
||||
if lfs and io and os then
|
||||
self.CSVFile:write(
|
||||
'"' .. self.GameName .. '"' .. ',' ..
|
||||
'"' .. self.RunTime .. '"' .. ',' ..
|
||||
@ -809,7 +808,7 @@ end
|
||||
|
||||
|
||||
function SCORING:CloseCSV()
|
||||
if lfs then
|
||||
if lfs and io and os then
|
||||
self.CSVFile:close()
|
||||
end
|
||||
end
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user