| | |
| | | if self._isNeedReport:
|
| | | packBuff = clientPack.GetBuffer()
|
| | | buffLen = len(packBuff)
|
| | | GameWorld.DebugLog("回合战斗过程封包: %s, len:%s" % (headStr, buffLen))
|
| | | GameWorld.DebugLog("回合战斗过程封包: %s, len:%s, %s" % (headStr, buffLen, CommFunc.B2Hex(packBuff)))
|
| | | self.batBuffer += CommFunc.WriteWORD("", buffLen)
|
| | | self.batBuffer += packBuff
|
| | | ObjPool.GetPoolMgr().release(clientPack)
|
| | |
| | |
|
| | | dateStr = GameWorld.ChangeTimeNumToStr(int(time.time()), "%Y%m%d")
|
| | | ReportDir = os.path.join(ReportRoot, "S%s" % reqServerID, dateStr, "%s" % reqPlayerID)
|
| | | |
| | | GameWorld.DebugLog("ReportDir=%s" % ReportDir)
|
| | | if not os.path.exists(ReportDir):
|
| | | os.makedirs(ReportDir)
|
| | | else:
|
| | | shutil.rmtree(ReportDir)
|
| | | os.makedirs(ReportDir)
|
| | | |
| | | items = os.listdir(ReportDir)
|
| | | for item in items:
|
| | | fullPath = os.path.join(ReportDir, item)
|
| | | try:
|
| | | os.remove(fullPath)
|
| | | except:
|
| | | pass
|
| | | |
| | | saveFilePath = os.path.join(ReportDir, "%s.tfr" % guid)
|
| | | GameWorld.DebugLog("saveFilePath=%s" % saveFilePath)
|
| | | GameWorld.DebugLog("__saveBatBuffer=%s" % saveFilePath)
|
| | |
|
| | | try:
|
| | | clientPack = ChPyNetSendPack.tagSCTurnFightReport()
|
| | | clientPack.GUID = guid
|
| | | clientPack.Report = turnFight.batBuffer
|
| | | clientPack.Len = len(clientPack.Report)
|
| | | fp = open(saveFilePath, "w")
|
| | | fp.write(turnFight.batBuffer)
|
| | | fp.write(clientPack.GetBuffer())
|
| | | fp.close()
|
| | | except:
|
| | | return
|