public HalfLifeDemoAnalyser(HalfLifeDemo demo, IAnalysisWindow analysisWindowInterface, IProgressWindow progressWindowInterface) { this.demo = demo; this.analysisWindowInterface = analysisWindowInterface; this.progressWindowInterface = progressWindowInterface; newRoundEventId = GameManager.NewRoundEventId(demo); gameState = new HalfLifeGameState(); NewRound(); titleTable = new Hashtable(); // TextMsg AddTitle("#Target_Bombed", "Target Succesfully Bombed!"); AddTitle("#VIP_Escaped", "The VIP has escaped!"); AddTitle("#VIP_Assassinated", "VIP has been assassinated!"); AddTitle("#Terrorists_Escaped", "The terrorists have escaped!"); AddTitle("#CTs_PreventEscape", "The CTs have prevented most of the terrorists from escaping!"); AddTitle("#Escaping_Terrorists_Neutralized", "Escaping terrorists have all been neutralized!"); AddTitle("#Bomb_Defused", "The bomb has been defused!"); AddTitle("#CTs_Win", "Counter-Terrorists Win!"); AddTitle("#Terrorists_Win", "Terrorists Win!"); AddTitle("#Round_Draw", "Round Draw!"); AddTitle("#All_Hostages_Rescued", "All Hostages have been rescued!"); AddTitle("#Target_Saved", "Target has been saved!"); AddTitle("#Hostages_Not_Rescued", "Hostages have not been rescued!"); AddTitle("#Terrorists_Not_Escaped", "Terrorists have not escaped!"); AddTitle("#VIP_Not_Escaped", "VIP has not escaped!"); AddTitle("#Terrorist_Escaped", "A terrorist has escaped!"); AddTitle("#Bomb_Planted", "The bomb has been planted!"); AddTitle("#Game_will_restart_in", "The game will restart in %s1 %s2"); AddTitle("#Game_bomb_drop", "%s1 dropped the bomb"); AddTitle("#Game_bomb_pickup", "%s1 picked up the bomb"); AddTitle("#Game_connected", "%s1 connected"); AddTitle("#Game_disconnected", "%s1 has left the game"); AddTitle("#Game_join_ct", "%s1 is joining the Counter-Terrorist force"); AddTitle("#Game_join_ct_auto", "%s1 is joining the Counter-Terrorist force (auto)"); AddTitle("#Game_join_terrorist", "%s1 is joining the Terrorist force"); AddTitle("#Game_join_terrorist_auto", "%s1 is joining the Terrorist force (auto)"); AddTitle("#Game_kicked", "Kicked %s1"); AddTitle("#Game_teammate_attack", "%s1 attacked a teammate"); // SayText AddTitle("#Cstrike_Name_Change", "* %s1 changed name to %s2"); AddTitle("#Cstrike_Chat_CT", "(Counter-Terrorist) "); AddTitle("#Cstrike_Chat_T", "(Terrorist) "); AddTitle("#Cstrike_Chat_CT_Dead", "*DEAD*(Counter-Terrorist) "); AddTitle("#Cstrike_Chat_T_Dead", "*DEAD*(Terrorist) "); AddTitle("#Cstrike_Chat_Spec", "(Spectator) "); AddTitle("#Cstrike_Chat_All", ""); AddTitle("#Cstrike_Chat_AllDead", "*DEAD* "); AddTitle("#Cstrike_Chat_AllSpec", "*SPEC* "); }
public HalfLifeDemoWriter(HalfLifeDemo demo, IHalfLifeDemoWriter demoWriterInterface, IProgressWindow progressWindowInterface, Int32 firstFrameToWriteIndex) { this.demo = demo; this.demoWriterInterface = demoWriterInterface; this.progressWindowInterface = progressWindowInterface; this.firstFrameToWriteIndex = firstFrameToWriteIndex; }
public HalfLifeDemoConverter(HalfLifeDemo demo) { this.demo = demo; // Find the first free user message. if (demo.Game != null && demo.Game.UserMessages != null) { Byte highestUserMessage = 0; foreach (KeyValuePair<String, Byte> userMessage in demo.Game.UserMessages) { if (userMessage.Value > highestUserMessage) { highestUserMessage = userMessage.Value; } } if (highestUserMessage == 255) { throw new NoFreeUserMessageException(); } firstFreeUserMessage = (Byte)(highestUserMessage + 1); } }
public HalfLifeDemoWriter(HalfLifeDemo demo, IHalfLifeDemoWriter demoWriterInterface, IProgressWindow progressWindowInterface, Int32 firstFrameToWriteIndex) { this.demo = demo; this.demoWriterInterface = demoWriterInterface; this.progressWindowInterface = progressWindowInterface; this.firstFrameToWriteIndex = firstFrameToWriteIndex; }
public static Demo CreateDemo(String fileName) { const Int32 magicStringLength = 8; using (FileStream inputStream = File.OpenRead(fileName)) { using (BinaryReader binaryReader = new BinaryReader(inputStream)) { String magic = Common.ReadNullTerminatedString(binaryReader, magicStringLength); binaryReader.Close(); // create demo object Demo demo = null; if (magic == "HLDEMO") { demo = new HalfLifeDemo(fileName); } else if (magic == "HL2DEMO") { demo = new SourceDemo(fileName); } else { throw new ApplicationException("Not a valid Half-Life or Source engine demo file."); } return demo; } } }
public HalfLifeDemoConverter(HalfLifeDemo demo) { this.demo = demo; // Find the first free user message. if (demo.Game != null && demo.Game.UserMessages != null) { Byte highestUserMessage = 0; foreach (KeyValuePair <String, Byte> userMessage in demo.Game.UserMessages) { if (userMessage.Value > highestUserMessage) { highestUserMessage = userMessage.Value; } } if (highestUserMessage == 255) { throw new NoFreeUserMessageException(); } firstFreeUserMessage = (Byte)(highestUserMessage + 1); } }
public static Demo CreateDemo(String fileName) { const Int32 magicStringLength = 8; using (FileStream inputStream = File.OpenRead(fileName)) { using (BinaryReader binaryReader = new BinaryReader(inputStream)) { String magic = Common.ReadNullTerminatedString(binaryReader, magicStringLength); binaryReader.Close(); // create demo object Demo demo = null; if (magic == "HLDEMO") { demo = new HalfLifeDemo(fileName); } else if (magic == "HL2DEMO") { demo = new SourceDemo(fileName); } else { throw new ApplicationException("Not a valid Half-Life or Source engine demo file."); } return(demo); } } }
public HalfLifeDemoAnalyser(HalfLifeDemo demo, IAnalysisWindow analysisWindowInterface, IProgressWindow progressWindowInterface) { this.demo = demo; this.analysisWindowInterface = analysisWindowInterface; this.progressWindowInterface = progressWindowInterface; newRoundEventId = GameManager.NewRoundEventId(demo); gameState = new HalfLifeGameState(); NewRound(); titleTable = new Hashtable(); // TextMsg AddTitle("#Target_Bombed", "Target Succesfully Bombed!"); AddTitle("#VIP_Escaped", "The VIP has escaped!"); AddTitle("#VIP_Assassinated", "VIP has been assassinated!"); AddTitle("#Terrorists_Escaped", "The terrorists have escaped!"); AddTitle("#CTs_PreventEscape", "The CTs have prevented most of the terrorists from escaping!"); AddTitle("#Escaping_Terrorists_Neutralized", "Escaping terrorists have all been neutralized!"); AddTitle("#Bomb_Defused", "The bomb has been defused!"); AddTitle("#CTs_Win", "Counter-Terrorists Win!"); AddTitle("#Terrorists_Win", "Terrorists Win!"); AddTitle("#Round_Draw", "Round Draw!"); AddTitle("#All_Hostages_Rescued", "All Hostages have been rescued!"); AddTitle("#Target_Saved", "Target has been saved!"); AddTitle("#Hostages_Not_Rescued", "Hostages have not been rescued!"); AddTitle("#Terrorists_Not_Escaped", "Terrorists have not escaped!"); AddTitle("#VIP_Not_Escaped", "VIP has not escaped!"); AddTitle("#Terrorist_Escaped", "A terrorist has escaped!"); AddTitle("#Bomb_Planted", "The bomb has been planted!"); AddTitle("#Game_will_restart_in", "The game will restart in %s1 %s2"); AddTitle("#Game_bomb_drop", "%s1 dropped the bomb"); AddTitle("#Game_bomb_pickup", "%s1 picked up the bomb"); AddTitle("#Game_connected", "%s1 connected"); AddTitle("#Game_disconnected", "%s1 has left the game"); AddTitle("#Game_join_ct", "%s1 is joining the Counter-Terrorist force"); AddTitle("#Game_join_ct_auto", "%s1 is joining the Counter-Terrorist force (auto)"); AddTitle("#Game_join_terrorist", "%s1 is joining the Terrorist force"); AddTitle("#Game_join_terrorist_auto", "%s1 is joining the Terrorist force (auto)"); AddTitle("#Game_kicked", "Kicked %s1"); AddTitle("#Game_teammate_attack", "%s1 attacked a teammate"); // SayText AddTitle("#Cstrike_Name_Change", "* %s1 changed name to %s2"); AddTitle("#Cstrike_Chat_CT", "(Counter-Terrorist) "); AddTitle("#Cstrike_Chat_T", "(Terrorist) "); AddTitle("#Cstrike_Chat_CT_Dead", "*DEAD*(Counter-Terrorist) "); AddTitle("#Cstrike_Chat_T_Dead", "*DEAD*(Terrorist) "); AddTitle("#Cstrike_Chat_Spec", "(Spectator) "); AddTitle("#Cstrike_Chat_All", ""); AddTitle("#Cstrike_Chat_AllDead", "*DEAD* "); AddTitle("#Cstrike_Chat_AllSpec", "*SPEC* "); }
public virtual Boolean IsBetaSteamHltvDemo(HalfLifeDemo demo) { return(false); }
public virtual Boolean IsBetaSteamHltvDemo(HalfLifeDemo demo) { return false; }
public PlayerListViewData(HalfLifeDemo.Player player) { Name = player.InfoKeys["name"]; UpdateRate = player.InfoKeys["cl_updaterate"]; Rate = player.InfoKeys["rate"]; String sid = player.InfoKeys["*sid"]; // "*sid" only exists in protocol 48 Half-Life demos. And even then it's common for people to "convert" protocol 47 demos to 48, so it's best to make sure the infokey value exists. if (player.InfoKeys["*hltv"] != null) { SteamId = "HLTV"; } else if (sid != null) { SteamId = Common.CalculateSteamId(sid); if (SteamId == null) { SteamId = "-"; } } else { SteamId = "-"; } }