Skip to content
Permalink
Browse files

Fixed shutdown error when no time has elapsed

  • Loading branch information...
Jake Fonseca
Jake Fonseca committed Oct 25, 2014
1 parent ca218b0 commit f387879486e12587a98ffafd688ffadc1a60f336
Showing with 7 additions and 4 deletions.
  1. +7 −4 lib/OCCPGameServer.rb
@@ -504,10 +504,13 @@ def self.instance_file_parser(instancefile)
end

#Log final times
totalgametime = $appCore.endtime - $appCore.begintime
$log.info "Total game length: #{'%.2f' % totalgametime} sec"
$log.info "Total time paused: #{'%.2f' % (totalgametime - $appCore.gameclock.gametime)} sec"

if $appCore.endtime != nil and $appCore.begintime != nil
totalgametime = $appCore.endtime - $appCore.begintime
$log.info "Total game length: #{'%.2f' % totalgametime} sec"
$log.info "Total time paused: #{'%.2f' % (totalgametime - $appCore.gameclock.gametime)} sec"
else
$log.info "Total game length: NO TIME"
end
#Log final scores
$appCore.scoreKeeper.get_names.each{ |scoreName|
$log.info("Score " + scoreName + ': ' + $appCore.scoreKeeper.get_score(scoreName).to_s)

0 comments on commit f387879

Please sign in to comment.
You can’t perform that action at this time.