Alrik2002
Warlord
Ok. I´ve tried it like this:
Then I provoked an OOS in the first round (founding a city). Unfortunatly no OOSLogger.txt.
Code:
import os
from CvPythonExtensions import *
import CvUtil
[COLOR="Red"]import BugPath[/COLOR]
gc = CyGlobalContext()
szFilename = "OOSLog.txt"
iMaxFilenameTries = 100
bWroteLog = False
SEPERATOR = "-----------------------------------------------------------------\n"
# Simply checks every game turn for OOS. If it finds it, writes the
# info contained in the sync checksum to a log file, then sets the bWroteLog
# variable so that it only happens once.
def doGameUpdate():
global bWroteLog
bOOS = CyInterface().isOOSVisible()
if (bOOS and not bWroteLog):
writeLog()
bWroteLog = True
def writeLog():
playername = CvUtil.convertToStr(gc.getPlayer(gc.getGame().getActivePlayer()).getName())
szNewFilename = [COLOR="Red"]getRootDir() + "\\Logs\\" + [/COLOR]"%s - Player %s - " % (playername, gc.getGame().getActivePlayer()) + "OOSLog - Turn " + "%s" % (gc.getGame().getGameTurn()) + ".txt"
pFile = open(szNewFilename, "w")
Then I provoked an OOS in the first round (founding a city). Unfortunatly no OOSLogger.txt.
