static public int closeWrite(IntPtr l) { try { Game.ActionRecord self = (Game.ActionRecord)checkSelf(l); self.closeWrite(); return(0); } catch (Exception e) { return(error(l, e)); } }
public void WriteProc() { arWrite.openAppend(); while (true) { if (!WriteActions()) { break; } if (exitEvent.WaitOne(waitTime)) { arWrite.writeFinishFlag(); arWrite.closeWrite(); break; } } }
public static void startRecord(string clientVer, string fileName, long timestamp, string roomInfo) { if (arWrite != null) { return; } bool fileExist = false; arWrite = new ActionRecord(fileName); arWrite.openWrite(out fileExist); if (!fileExist) { arWrite.writeHead(clientVer, timestamp, roomInfo); } arWrite.closeWrite(); arWrite.writeThread = new Thread(arWrite.WriteProc); arWrite.exitEvent = new AutoResetEvent(false); arWrite.actions.Clear(); arWrite.writeThread.Start(); }