public static void Play() { if (m_Recording || Playing || m_GZIn == null) { return; } if (World.Player == null) { MessageBox.Show(Engine.MainWindow, "You must be logged in to ANY shard to play a packet video.", "Must Log in", MessageBoxButtons.OK, MessageBoxIcon.Information); return; } btnPlay.Enabled = btnStop.Enabled = btnClose.Enabled = btnRec.Enabled = false; btnPlay.Text = "Pause"; // save the real player data m_TempWriter = new BinaryWriter(new MemoryStream()); World.Player.SaveState(m_TempWriter); //m_InStream = new BinaryReader( new FileStream( fileName, FileMode.Open, FileAccess.Read, FileShare.Read ) ); m_Playing = true; ClientCommunication.SetAllowDisconn(false); ClientCommunication.BringToFront(ClientCommunication.FindUOWindow()); //ClientCommunication.SetDeathMsg( "Playing..." ); ClientCommunication.ForceSendToClient(new DeathStatus(true)); RemoveAll(); m_GZIn.Seek(m_StartPos, SeekOrigin.Begin); LoadWorldState(); m_PlayTimer = Timer.DelayedCallback(FadeDelay, m_BeginPlay); m_PlayTimer.Start(); tbPos.Value = tbPos.Minimum; m_Elapsed = TimeSpan.Zero; UpdateTimeText(); ClientCommunication.RequestTitlebarUpdate(); }
private static void BeginPlayback() { DoLogin(World.Player); //ClientCommunication.SetDeathMsg( "You are dead." ); ClientCommunication.BringToFront(ClientCommunication.FindUOWindow()); TimeSpan delay = TimeSpan.FromMilliseconds(m_GZIn.Compressed.ReadInt32()); m_PlayTimer = Timer.DelayedCallback(delay, m_SendNext); m_PlayTimer.Start(); if (m_ScrollTimer == null) { m_ScrollTimer = new ScrollTimer(); } m_ScrollTimer.Start(); m_StartTime = DateTime.UtcNow; m_Elapsed = delay; UpdateTimeText(); btnPlay.Enabled = btnStop.Enabled = true; }