├── .gitignore ├── CS-Jukebox.sln ├── CS-Jukebox ├── CS-Jukebox.csproj ├── GameLogic.cs ├── GamePathForm.Designer.cs ├── GamePathForm.cs ├── GamePathForm.resx ├── Jukebox.cs ├── MainForm.Designer.cs ├── MainForm.cs ├── MainForm.resx ├── MusicKit.cs ├── MusicSelector.Designer.cs ├── MusicSelector.cs ├── MusicSelector.resx ├── Program.cs ├── Properties.cs ├── SongProfile.cs ├── WinAPI.cs ├── gamestate_integration_jukebox.cfg ├── icon.ico └── logo.ico ├── CSGSI ├── CSGSI.csproj ├── Events │ ├── BombDefusedEventArgs.cs │ ├── BombExplodedEventArgs.cs │ ├── BombPlantedEventArgs.cs │ ├── PlayerFlashedEventArgs.cs │ ├── RoundBeginEventArgs.cs │ ├── RoundEndEventArgs.cs │ └── RoundPhaseChangedEventArgs.cs ├── GameState.cs ├── GameStateListener.cs ├── IGameStateListener.cs ├── Nodes │ ├── AllPlayersNode.cs │ ├── AuthNode.cs │ ├── BombNode.cs │ ├── Flame.cs │ ├── GrenadeNode.cs │ ├── GrenadesNode.cs │ ├── MapNode.cs │ ├── MapRoundWinsNode.cs │ ├── MapTeamNode.cs │ ├── MatchStatsNode.cs │ ├── NodeBase.cs │ ├── PhaseCountdownsNode.cs │ ├── PlayerNode.cs │ ├── PlayerStateNode.cs │ ├── ProviderNode.cs │ ├── RoundNode.cs │ ├── WeaponNode.cs │ └── WeaponsNode.cs ├── Properties │ └── AssemblyInfo.cs ├── Vector3.cs └── packages.config ├── LICENSE ├── README.md └── sampleicon.ico /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | # User-specific files 7 | *.rsuser 8 | *.suo 9 | *.user 10 | *.userosscache 11 | *.sln.docstates 12 | 13 | # User-specific files (MonoDevelop/Xamarin Studio) 14 | *.userprefs 15 | 16 | # Mono auto generated files 17 | mono_crash.* 18 | 19 | # Build results 20 | [Dd]ebug/ 21 | [Dd]ebugPublic/ 22 | [Rr]elease/ 23 | [Rr]eleases/ 24 | x64/ 25 | x86/ 26 | [Ww][Ii][Nn]32/ 27 | [Aa][Rr][Mm]/ 28 | [Aa][Rr][Mm]64/ 29 | bld/ 30 | [Bb]in/ 31 | [Oo]bj/ 32 | [Ll]og/ 33 | [Ll]ogs/ 34 | 35 | # Visual Studio 2015/2017 cache/options directory 36 | .vs/ 37 | # Uncomment if you have tasks that create the project's static files in wwwroot 38 | #wwwroot/ 39 | 40 | # Visual Studio 2017 auto generated files 41 | Generated\ Files/ 42 | 43 | # MSTest test Results 44 | [Tt]est[Rr]esult*/ 45 | [Bb]uild[Ll]og.* 46 | 47 | # NUnit 48 | *.VisualState.xml 49 | TestResult.xml 50 | nunit-*.xml 51 | 52 | # Build Results of an ATL Project 53 | [Dd]ebugPS/ 54 | [Rr]eleasePS/ 55 | dlldata.c 56 | 57 | # Benchmark Results 58 | BenchmarkDotNet.Artifacts/ 59 | 60 | # .NET Core 61 | project.lock.json 62 | project.fragment.lock.json 63 | artifacts/ 64 | 65 | # ASP.NET Scaffolding 66 | ScaffoldingReadMe.txt 67 | 68 | # StyleCop 69 | StyleCopReport.xml 70 | 71 | # Files built by Visual Studio 72 | *_i.c 73 | *_p.c 74 | *_h.h 75 | *.ilk 76 | *.meta 77 | *.obj 78 | *.iobj 79 | *.pch 80 | *.pdb 81 | *.ipdb 82 | *.pgc 83 | *.pgd 84 | *.rsp 85 | *.sbr 86 | *.tlb 87 | *.tli 88 | *.tlh 89 | *.tmp 90 | *.tmp_proj 91 | *_wpftmp.csproj 92 | *.log 93 | *.tlog 94 | *.vspscc 95 | *.vssscc 96 | .builds 97 | *.pidb 98 | *.svclog 99 | *.scc 100 | 101 | # Chutzpah Test files 102 | _Chutzpah* 103 | 104 | # Visual C++ cache files 105 | ipch/ 106 | *.aps 107 | *.ncb 108 | *.opendb 109 | *.opensdf 110 | *.sdf 111 | *.cachefile 112 | *.VC.db 113 | *.VC.VC.opendb 114 | 115 | # Visual Studio profiler 116 | *.psess 117 | *.vsp 118 | *.vspx 119 | *.sap 120 | 121 | # Visual Studio Trace Files 122 | *.e2e 123 | 124 | # TFS 2012 Local Workspace 125 | $tf/ 126 | 127 | # Guidance Automation Toolkit 128 | *.gpState 129 | 130 | # ReSharper is a .NET coding add-in 131 | _ReSharper*/ 132 | *.[Rr]e[Ss]harper 133 | *.DotSettings.user 134 | 135 | # TeamCity is a build add-in 136 | _TeamCity* 137 | 138 | # DotCover is a Code Coverage Tool 139 | *.dotCover 140 | 141 | # AxoCover is a Code Coverage Tool 142 | .axoCover/* 143 | !.axoCover/settings.json 144 | 145 | # Coverlet is a free, cross platform Code Coverage Tool 146 | coverage*.json 147 | coverage*.xml 148 | coverage*.info 149 | 150 | # Visual Studio code coverage results 151 | *.coverage 152 | *.coveragexml 153 | 154 | # NCrunch 155 | _NCrunch_* 156 | .*crunch*.local.xml 157 | nCrunchTemp_* 158 | 159 | # MightyMoose 160 | *.mm.* 161 | AutoTest.Net/ 162 | 163 | # Web workbench (sass) 164 | .sass-cache/ 165 | 166 | # Installshield output folder 167 | [Ee]xpress/ 168 | 169 | # DocProject is a documentation generator add-in 170 | DocProject/buildhelp/ 171 | DocProject/Help/*.HxT 172 | DocProject/Help/*.HxC 173 | DocProject/Help/*.hhc 174 | DocProject/Help/*.hhk 175 | DocProject/Help/*.hhp 176 | DocProject/Help/Html2 177 | DocProject/Help/html 178 | 179 | # Click-Once directory 180 | publish/ 181 | 182 | # Publish Web Output 183 | *.[Pp]ublish.xml 184 | *.azurePubxml 185 | # Note: Comment the next line if you want to checkin your web deploy settings, 186 | # but database connection strings (with potential passwords) will be unencrypted 187 | *.pubxml 188 | *.publishproj 189 | 190 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 191 | # checkin your Azure Web App publish settings, but sensitive information contained 192 | # in these scripts will be unencrypted 193 | PublishScripts/ 194 | 195 | # NuGet Packages 196 | *.nupkg 197 | # NuGet Symbol Packages 198 | *.snupkg 199 | # The packages folder can be ignored because of Package Restore 200 | **/[Pp]ackages/* 201 | # except build/, which is used as an MSBuild target. 202 | !**/[Pp]ackages/build/ 203 | # Uncomment if necessary however generally it will be regenerated when needed 204 | #!**/[Pp]ackages/repositories.config 205 | # NuGet v3's project.json files produces more ignorable files 206 | *.nuget.props 207 | *.nuget.targets 208 | 209 | # Nuget personal access tokens and Credentials 210 | nuget.config 211 | 212 | # Microsoft Azure Build Output 213 | csx/ 214 | *.build.csdef 215 | 216 | # Microsoft Azure Emulator 217 | ecf/ 218 | rcf/ 219 | 220 | # Windows Store app package directories and files 221 | AppPackages/ 222 | BundleArtifacts/ 223 | Package.StoreAssociation.xml 224 | _pkginfo.txt 225 | *.appx 226 | *.appxbundle 227 | *.appxupload 228 | 229 | # Visual Studio cache files 230 | # files ending in .cache can be ignored 231 | *.[Cc]ache 232 | # but keep track of directories ending in .cache 233 | !?*.[Cc]ache/ 234 | 235 | # Others 236 | ClientBin/ 237 | ~$* 238 | *~ 239 | *.dbmdl 240 | *.dbproj.schemaview 241 | *.jfm 242 | *.pfx 243 | *.publishsettings 244 | orleans.codegen.cs 245 | 246 | # Including strong name files can present a security risk 247 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 248 | #*.snk 249 | 250 | # Since there are multiple workflows, uncomment next line to ignore bower_components 251 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 252 | #bower_components/ 253 | 254 | # RIA/Silverlight projects 255 | Generated_Code/ 256 | 257 | # Backup & report files from converting an old project file 258 | # to a newer Visual Studio version. Backup files are not needed, 259 | # because we have git ;-) 260 | _UpgradeReport_Files/ 261 | Backup*/ 262 | UpgradeLog*.XML 263 | UpgradeLog*.htm 264 | ServiceFabricBackup/ 265 | *.rptproj.bak 266 | 267 | # SQL Server files 268 | *.mdf 269 | *.ldf 270 | *.ndf 271 | 272 | # Business Intelligence projects 273 | *.rdl.data 274 | *.bim.layout 275 | *.bim_*.settings 276 | *.rptproj.rsuser 277 | *- [Bb]ackup.rdl 278 | *- [Bb]ackup ([0-9]).rdl 279 | *- [Bb]ackup ([0-9][0-9]).rdl 280 | 281 | # Microsoft Fakes 282 | FakesAssemblies/ 283 | 284 | # GhostDoc plugin setting file 285 | *.GhostDoc.xml 286 | 287 | # Node.js Tools for Visual Studio 288 | .ntvs_analysis.dat 289 | node_modules/ 290 | 291 | # Visual Studio 6 build log 292 | *.plg 293 | 294 | # Visual Studio 6 workspace options file 295 | *.opt 296 | 297 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 298 | *.vbw 299 | 300 | # Visual Studio LightSwitch build output 301 | **/*.HTMLClient/GeneratedArtifacts 302 | **/*.DesktopClient/GeneratedArtifacts 303 | **/*.DesktopClient/ModelManifest.xml 304 | **/*.Server/GeneratedArtifacts 305 | **/*.Server/ModelManifest.xml 306 | _Pvt_Extensions 307 | 308 | # Paket dependency manager 309 | .paket/paket.exe 310 | paket-files/ 311 | 312 | # FAKE - F# Make 313 | .fake/ 314 | 315 | # CodeRush personal settings 316 | .cr/personal 317 | 318 | # Python Tools for Visual Studio (PTVS) 319 | __pycache__/ 320 | *.pyc 321 | 322 | # Cake - Uncomment if you are using it 323 | # tools/** 324 | # !tools/packages.config 325 | 326 | # Tabs Studio 327 | *.tss 328 | 329 | # Telerik's JustMock configuration file 330 | *.jmconfig 331 | 332 | # BizTalk build output 333 | *.btp.cs 334 | *.btm.cs 335 | *.odx.cs 336 | *.xsd.cs 337 | 338 | # OpenCover UI analysis results 339 | OpenCover/ 340 | 341 | # Azure Stream Analytics local run output 342 | ASALocalRun/ 343 | 344 | # MSBuild Binary and Structured Log 345 | *.binlog 346 | 347 | # NVidia Nsight GPU debugger configuration file 348 | *.nvuser 349 | 350 | # MFractors (Xamarin productivity tool) working folder 351 | .mfractor/ 352 | 353 | # Local History for Visual Studio 354 | .localhistory/ 355 | 356 | # BeatPulse healthcheck temp database 357 | healthchecksdb 358 | 359 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 360 | MigrationBackup/ 361 | 362 | # Ionide (cross platform F# VS Code tools) working folder 363 | .ionide/ 364 | 365 | # Fody - auto-generated XML schema 366 | FodyWeavers.xsd 367 | 368 | # VS Code files for those working on multiple tools 369 | .vscode/* 370 | !.vscode/settings.json 371 | !.vscode/tasks.json 372 | !.vscode/launch.json 373 | !.vscode/extensions.json 374 | *.code-workspace 375 | 376 | # Local History for Visual Studio Code 377 | .history/ 378 | 379 | # Windows Installer files from build outputs 380 | *.cab 381 | *.msi 382 | *.msix 383 | *.msm 384 | *.msp 385 | 386 | # JetBrains Rider 387 | .idea/ 388 | *.sln.iml -------------------------------------------------------------------------------- /CS-Jukebox.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.1.32210.238 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CS-Jukebox", "CS-Jukebox\CS-Jukebox.csproj", "{1EA1BE7A-CBD8-43DA-8070-5B448A7E6B94}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSGSI", "CSGSI\CSGSI.csproj", "{8D55804C-2CF1-4A65-9C3E-8E41CD809535}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Release|Any CPU = Release|Any CPU 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {1EA1BE7A-CBD8-43DA-8070-5B448A7E6B94}.Debug|Any CPU.ActiveCfg = Release|Any CPU 17 | {1EA1BE7A-CBD8-43DA-8070-5B448A7E6B94}.Debug|Any CPU.Build.0 = Release|Any CPU 18 | {1EA1BE7A-CBD8-43DA-8070-5B448A7E6B94}.Release|Any CPU.ActiveCfg = Release|Any CPU 19 | {1EA1BE7A-CBD8-43DA-8070-5B448A7E6B94}.Release|Any CPU.Build.0 = Release|Any CPU 20 | {8D55804C-2CF1-4A65-9C3E-8E41CD809535}.Debug|Any CPU.ActiveCfg = Release|Any CPU 21 | {8D55804C-2CF1-4A65-9C3E-8E41CD809535}.Debug|Any CPU.Build.0 = Release|Any CPU 22 | {8D55804C-2CF1-4A65-9C3E-8E41CD809535}.Release|Any CPU.ActiveCfg = Release|Any CPU 23 | {8D55804C-2CF1-4A65-9C3E-8E41CD809535}.Release|Any CPU.Build.0 = Release|Any CPU 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | GlobalSection(ExtensibilityGlobals) = postSolution 29 | SolutionGuid = {3CD517DC-1FBF-48E9-949B-1EF6ECBD8505} 30 | EndGlobalSection 31 | EndGlobal 32 | -------------------------------------------------------------------------------- /CS-Jukebox/CS-Jukebox.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | WinExe 5 | net5.0-windows 6 | CS_Jukebox 7 | true 8 | CS_Jukebox.Program 9 | logo.ico 10 | 11 | 12 | 13 | 14 | tlbimp 15 | 0 16 | 1 17 | 6bf52a50-394a-11d3-b153-00c04f79faa6 18 | 0 19 | false 20 | true 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | Always 35 | 36 | 37 | 38 | -------------------------------------------------------------------------------- /CS-Jukebox/GameLogic.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.Windows.Forms; 7 | using CSGSI; 8 | using CSGSI.Nodes; 9 | 10 | namespace CS_Jukebox 11 | { 12 | class GameLogic 13 | { 14 | public Jukebox jukebox; 15 | 16 | private GameStateListener gsl; 17 | private MusicState musicState = MusicState.None; 18 | private int playerMVPs = 0; 19 | private int roundTime = 115; 20 | private int bombTime = 45; 21 | private int currentRoundTime = 0; 22 | private int currentBombTime = 0; 23 | 24 | public GameLogic() 25 | { 26 | jukebox = new Jukebox(); 27 | StartGameListener(); 28 | SetupTimer(); 29 | } 30 | 31 | void StartGameListener() 32 | { 33 | gsl = new GameStateListener(3010); 34 | gsl.NewGameState += new NewGameStateHandler(OnNewGameState); 35 | 36 | if (!gsl.Start()) 37 | { 38 | Console.WriteLine("Game State Listener failed to start."); 39 | MessageBox.Show("Game State Listener failed to start. A restart may be required.", "Error", MessageBoxButtons.OK, MessageBoxIcon.Error); 40 | Environment.Exit(1); 41 | } 42 | else 43 | { 44 | Console.WriteLine("Listening..."); 45 | } 46 | } 47 | 48 | public void Stop() 49 | { 50 | Console.WriteLine("Stopping Game Listener"); 51 | gsl.Stop(); 52 | } 53 | 54 | void OnNewGameState(GameState gs) 55 | { 56 | if (Properties.SelectedKit == null) return; 57 | 58 | if (gs.Map.JSON.Equals("{}") && musicState != MusicState.Menu) 59 | { 60 | musicState = MusicState.Menu; 61 | playerMVPs = 0; 62 | jukebox.PlaySong(Properties.SelectedKit.mainMenuSong, true); 63 | Console.WriteLine("Main Menu"); 64 | } 65 | 66 | if (gs.Round.Phase == RoundPhase.FreezeTime && musicState != MusicState.FreezeTime) 67 | { 68 | if (musicState == MusicState.Menu) 69 | { 70 | JoinedGame(gs); 71 | } 72 | 73 | musicState = MusicState.FreezeTime; 74 | jukebox.PlaySong(Properties.SelectedKit.freezeSong, false); 75 | currentRoundTime = 0; 76 | currentBombTime = 0; 77 | Console.WriteLine("FreezeTime Begun"); 78 | } 79 | 80 | if (musicState == MusicState.Menu) 81 | { 82 | if (gs.Round.Phase == RoundPhase.Live) 83 | { 84 | //Fade out main menu song 85 | Console.WriteLine("Stopping main menu song"); 86 | jukebox.Stop(); 87 | } 88 | return; 89 | } 90 | 91 | if (gs.Round.Phase == RoundPhase.Live && musicState != MusicState.Live && musicState != MusicState.BombPlanted) 92 | { 93 | jukebox.Stop(); 94 | musicState = MusicState.Live; 95 | jukebox.PlaySong(Properties.SelectedKit.startSong, false, 8); 96 | Console.WriteLine("Round Begun"); 97 | 98 | } 99 | 100 | if (gs.Round.Phase == RoundPhase.Over && musicState != MusicState.Over) 101 | { 102 | musicState = MusicState.Over; 103 | 104 | if (gs.Round.WinTeam == RoundWinTeam.T && gs.Player.Team == PlayerTeam.T) 105 | { 106 | RoundWin(gs); 107 | } 108 | else if (gs.Round.WinTeam == RoundWinTeam.CT && gs.Player.Team == PlayerTeam.CT) 109 | { 110 | RoundWin(gs); 111 | } 112 | else 113 | { 114 | //lose 115 | jukebox.PlaySong(Properties.SelectedKit.loseSong, false); 116 | } 117 | } 118 | 119 | if (gs.Round.Bomb == BombState.Planted && musicState != MusicState.BombPlanted) 120 | { 121 | musicState = MusicState.BombPlanted; 122 | jukebox.PlaySong(Properties.SelectedKit.bombSong, false); 123 | Console.WriteLine("Bomb Planted"); 124 | } 125 | } 126 | 127 | private void JoinedGame(GameState gs) 128 | { 129 | switch (gs.Map.Mode) 130 | { 131 | case MapMode.Casual: 132 | roundTime = 120; 133 | bombTime = 45; 134 | break; 135 | case MapMode.Competitive: 136 | roundTime = 115; 137 | bombTime = 40; 138 | break; 139 | default: 140 | roundTime = 120; 141 | bombTime = 45; 142 | break; 143 | } 144 | } 145 | 146 | private void RoundWin(GameState gs) 147 | { 148 | //Check if player was MVP of the round 149 | if (gs.Player.MatchStats.MVPs > playerMVPs) 150 | { 151 | jukebox.PlaySong(Properties.SelectedKit.MVPSong, false); 152 | playerMVPs = gs.Player.MatchStats.MVPs; 153 | } 154 | else 155 | { 156 | jukebox.PlaySong(Properties.SelectedKit.winSong, false); 157 | } 158 | } 159 | 160 | private void SetupTimer() 161 | { 162 | Timer timer = new Timer(); 163 | timer.Interval = 1000; 164 | timer.Tick += new EventHandler(TimerTick); 165 | timer.Start(); 166 | } 167 | 168 | private void TimerTick(object sender, EventArgs e) 169 | { 170 | if (musicState == MusicState.Live) 171 | { 172 | currentRoundTime++; 173 | 174 | if (roundTime - currentRoundTime == 10) 175 | { 176 | Console.WriteLine("Ten Seconds left on round"); 177 | jukebox.PlaySong(Properties.SelectedKit.roundTenSecSong, false); 178 | } 179 | } 180 | else if (musicState == MusicState.BombPlanted) 181 | { 182 | currentBombTime++; 183 | 184 | if (bombTime - currentBombTime == 10) 185 | { 186 | Console.WriteLine("Ten Seconds left on bomb"); 187 | jukebox.PlaySong(Properties.SelectedKit.bombTenSecSong, false); 188 | } 189 | } 190 | } 191 | } 192 | 193 | public enum MusicState 194 | { 195 | None, 196 | Menu, 197 | FreezeTime, 198 | Live, 199 | BombPlanted, 200 | Over 201 | } 202 | } 203 | -------------------------------------------------------------------------------- /CS-Jukebox/GamePathForm.Designer.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace CS_Jukebox 3 | { 4 | partial class GamePathForm 5 | { 6 | /// 7 | /// Required designer variable. 8 | /// 9 | private System.ComponentModel.IContainer components = null; 10 | 11 | /// 12 | /// Clean up any resources being used. 13 | /// 14 | /// true if managed resources should be disposed; otherwise, false. 15 | protected override void Dispose(bool disposing) 16 | { 17 | if (disposing && (components != null)) 18 | { 19 | components.Dispose(); 20 | } 21 | base.Dispose(disposing); 22 | } 23 | 24 | #region Windows Form Designer generated code 25 | 26 | /// 27 | /// Required method for Designer support - do not modify 28 | /// the contents of this method with the code editor. 29 | /// 30 | private void InitializeComponent() 31 | { 32 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(GamePathForm)); 33 | this.label1 = new System.Windows.Forms.Label(); 34 | this.dirTextBox = new System.Windows.Forms.TextBox(); 35 | this.browseButton = new System.Windows.Forms.Button(); 36 | this.folderBrowserDialog1 = new System.Windows.Forms.FolderBrowserDialog(); 37 | this.okButton = new System.Windows.Forms.Button(); 38 | this.errorLabel = new System.Windows.Forms.Label(); 39 | this.SuspendLayout(); 40 | // 41 | // label1 42 | // 43 | this.label1.AutoSize = true; 44 | this.label1.Location = new System.Drawing.Point(13, 13); 45 | this.label1.Name = "label1"; 46 | this.label1.Size = new System.Drawing.Size(288, 15); 47 | this.label1.TabIndex = 0; 48 | this.label1.Text = "Select root folder for CS2"; 49 | // 50 | // dirTextBox 51 | // 52 | this.dirTextBox.Location = new System.Drawing.Point(13, 61); 53 | this.dirTextBox.Name = "dirTextBox"; 54 | this.dirTextBox.Size = new System.Drawing.Size(288, 23); 55 | this.dirTextBox.TabIndex = 1; 56 | this.dirTextBox.TextChanged += new System.EventHandler(this.dirTextBox_TextChanged); 57 | // 58 | // browseButton 59 | // 60 | this.browseButton.Location = new System.Drawing.Point(13, 90); 61 | this.browseButton.Name = "browseButton"; 62 | this.browseButton.Size = new System.Drawing.Size(75, 23); 63 | this.browseButton.TabIndex = 2; 64 | this.browseButton.Text = "Browse"; 65 | this.browseButton.UseVisualStyleBackColor = true; 66 | this.browseButton.Click += new System.EventHandler(this.browseButton_Click); 67 | // 68 | // okButton 69 | // 70 | this.okButton.Enabled = false; 71 | this.okButton.Location = new System.Drawing.Point(226, 90); 72 | this.okButton.Name = "okButton"; 73 | this.okButton.Size = new System.Drawing.Size(75, 23); 74 | this.okButton.TabIndex = 3; 75 | this.okButton.Text = "Okay"; 76 | this.okButton.UseVisualStyleBackColor = true; 77 | this.okButton.Click += new System.EventHandler(this.okButton_Click); 78 | // 79 | // errorLabel 80 | // 81 | this.errorLabel.AutoSize = true; 82 | this.errorLabel.ForeColor = System.Drawing.Color.Red; 83 | this.errorLabel.Location = new System.Drawing.Point(13, 40); 84 | this.errorLabel.Name = "errorLabel"; 85 | this.errorLabel.Size = new System.Drawing.Size(161, 15); 86 | this.errorLabel.TabIndex = 4; 87 | this.errorLabel.Text = "Error: Invalid CS2 Directory (game folder)"; 88 | this.errorLabel.UseWaitCursor = true; 89 | this.errorLabel.Visible = false; 90 | // 91 | // GamePathForm 92 | // 93 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); 94 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 95 | this.ClientSize = new System.Drawing.Size(317, 122); 96 | this.Controls.Add(this.errorLabel); 97 | this.Controls.Add(this.okButton); 98 | this.Controls.Add(this.browseButton); 99 | this.Controls.Add(this.dirTextBox); 100 | this.Controls.Add(this.label1); 101 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; 102 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 103 | this.Name = "GamePathForm"; 104 | this.Text = "Select Game Directory"; 105 | this.ResumeLayout(false); 106 | this.PerformLayout(); 107 | 108 | } 109 | 110 | #endregion 111 | 112 | private System.Windows.Forms.Label label1; 113 | private System.Windows.Forms.TextBox dirTextBox; 114 | private System.Windows.Forms.Button browseButton; 115 | private System.Windows.Forms.FolderBrowserDialog folderBrowserDialog1; 116 | private System.Windows.Forms.Button okButton; 117 | private System.Windows.Forms.Label errorLabel; 118 | } 119 | } -------------------------------------------------------------------------------- /CS-Jukebox/GamePathForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.ComponentModel; 4 | using System.Data; 5 | using System.Drawing; 6 | using System.Linq; 7 | using System.Text; 8 | using System.Threading.Tasks; 9 | using System.Windows.Forms; 10 | using System.IO; 11 | 12 | namespace CS_Jukebox 13 | { 14 | public partial class GamePathForm : Form 15 | { 16 | private bool dirValid = false; 17 | 18 | public GamePathForm() 19 | { 20 | InitializeComponent(); 21 | MaximizeBox = false; 22 | MinimizeBox = false; 23 | } 24 | 25 | //Open folder browser dialog 26 | private void browseButton_Click(object sender, EventArgs e) 27 | { 28 | if (folderBrowserDialog1.ShowDialog() == DialogResult.OK) 29 | { 30 | dirTextBox.Text = folderBrowserDialog1.SelectedPath; 31 | } 32 | } 33 | 34 | //Check if the directory is a valid CSGO install 35 | private bool CheckDir(string path) 36 | { 37 | return Directory.Exists(path + @"\core"); 38 | } 39 | 40 | //Saves the directory if it is valid. 41 | private void okButton_Click(object sender, EventArgs e) 42 | { 43 | if (dirValid) 44 | { 45 | Properties.SaveProperties(); 46 | Close(); 47 | } 48 | } 49 | 50 | //Shows error label based on whether given directory is a valid CS:GO path 51 | private void dirTextBox_TextChanged(object sender, EventArgs e) 52 | { 53 | dirValid = CheckDir(dirTextBox.Text); 54 | if (dirValid) 55 | { 56 | Properties.GameDir = dirTextBox.Text; 57 | errorLabel.Visible = false; 58 | okButton.Enabled = true; 59 | } 60 | else 61 | { 62 | Properties.GameDir = null; 63 | errorLabel.Visible = true; 64 | okButton.Enabled = false; 65 | } 66 | } 67 | } 68 | } 69 | -------------------------------------------------------------------------------- /CS-Jukebox/GamePathForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | 61 | 17, 17 62 | 63 | 64 | 65 | 66 | AAABAAMAEBAAAAAAAABoBQAANgAAACAgAAAAAAAAqAgAAJ4FAAAwMAAAAAAAAKgOAABGDgAAKAAAABAA 67 | AAAgAAAAAQAIAAAAAABAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AJgkJAPH//wAAAAAAAAAAAAAA 68 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 69 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 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gICAgICAgICAgICAgICAgI 145 | CAgICAgICAgICAgICAgICAgICAAAAAAAAAAAAAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI 146 | CAgICAgICAAAAAAAAAAAAAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAAA 147 | AAAAAAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAAAAAAAAAAAAAAAAAACAgI 148 | CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAAAAAAAAAAAAAAAAAAAAAICAgICAgICAgICAgI 149 | CAgICAgICAgICAgICAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsLCwsLCwsLCwsL 150 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwgLCwsLCwsLCwsLCwgICAAAAAAAAAAA 151 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwgICwsICwsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 152 | CAgLCwsLCwsLCAgICAsLCAsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCAgI 153 | CAgLCwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwgICAgICwgLCwsLCwsL 154 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsICAgICwgLCwsLCwsLCwgICAAAAAAAAAAA 155 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 156 | CAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsL 157 | CwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsL 158 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAA 159 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 160 | CAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsL 161 | CwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsL 162 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICAgLCwsLCwsLCwgICAAAAAAAAAAA 163 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 164 | CAgICwsLCwsLCwsLCwsLCwsLCwsLCwsLCAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICAgICAgICAgI 165 | CAgICAgICAgICAgICAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgI 166 | CAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICwsLCwsLCwsLCwsLCwsLCwsLCwsLCAgICAAAAAAAAAAA 167 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 168 | CAgLCwgICAsICAgLCAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgL 169 | CAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgLCAgICwgICAsICAgL 170 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgLCAgICwgICAsICAgLCwgICAAAAAAAAAAA 171 | AAAA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/gAAAA/8AAP+A 184 | AAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/ 185 | AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+A 186 | AAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/ 187 | AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP/A 188 | AAAH/wAA/8AAAAf/AAD/wAAAB/8AAP/AAAAH/wAA/+AAAA//AAD/8AAAH/8AAP/4AAA//wAA//wAAH// 189 | AAD//gAA//8AAP//4A///wAA////////AAA= 190 | 191 | 192 | -------------------------------------------------------------------------------- /CS-Jukebox/Jukebox.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | using WMPLib; 4 | 5 | namespace CS_Jukebox 6 | { 7 | public class Jukebox 8 | { 9 | private WindowsMediaPlayer player; 10 | private SongProfile currentSong; 11 | 12 | private Timer fadeTimer; 13 | 14 | private bool isPlaying = false; 15 | private bool shouldStop = false; 16 | private int timerCount = 0; 17 | private int timerGoal = 0; 18 | private int active = 0; 19 | private int delayedCount = 0; 20 | private float fadeVolume; 21 | private float volumeIncrement; //Incremental change in volume when fading out song. 22 | 23 | public Jukebox() 24 | { 25 | player = new WindowsMediaPlayer(); 26 | 27 | SetupTimer(); 28 | } 29 | 30 | public void PlaySong(string path) 31 | { 32 | player.URL = path; 33 | player.controls.play(); 34 | } 35 | 36 | //Play song for length or loop indefinitely 37 | public void PlaySong(SongProfile song, bool loop) 38 | { 39 | if (song.Path == "") return; 40 | 41 | float volume = ((float)Properties.MasterVolume / 100) * (float)song.Volume * active; 42 | currentSong = song; 43 | 44 | player.settings.volume = (int)volume; 45 | player.URL = song.Path; 46 | player.controls.currentPosition = song.Start; 47 | player.controls.play(); 48 | player.settings.setMode("loop", loop); 49 | } 50 | 51 | //Play song with a determined amount of time in seconds 52 | public void PlaySong(SongProfile song, bool loop, int duration) 53 | { 54 | PlaySong(song, loop); 55 | 56 | timerCount = 0; 57 | timerGoal = duration; 58 | isPlaying = true; 59 | } 60 | 61 | public void UpdateVolume() 62 | { 63 | if (currentSong == null) return; 64 | float volume = ((float)Properties.MasterVolume / 100) * currentSong.Volume * active; 65 | player.settings.volume = (int)volume; 66 | } 67 | 68 | //Sets shouldStop to true so that on the next on the next timer tick, 69 | //StopSong() will be called. The fadeTimer only starts if it is done like this. 70 | public void Stop() 71 | { 72 | shouldStop = true; 73 | } 74 | 75 | private void StopSong() 76 | { 77 | float fadeTime = 1f; 78 | float startVolume = player.settings.volume; 79 | fadeVolume = startVolume; 80 | volumeIncrement = startVolume / ((1000 / 8) * fadeTime); 81 | 82 | timerCount = 0; 83 | 84 | fadeTimer = new Timer(); 85 | fadeTimer.Interval = 8; 86 | fadeTimer.Tick += new EventHandler(FadeTimerTick); 87 | fadeTimer.Start(); 88 | } 89 | 90 | private void FadeTimerTick(object sender, EventArgs e) 91 | { 92 | if (fadeVolume > 0) 93 | { 94 | fadeVolume -= volumeIncrement; 95 | player.settings.volume = (int)fadeVolume; 96 | Console.WriteLine(fadeVolume); 97 | } 98 | else 99 | { 100 | player.controls.stop(); 101 | fadeTimer.Stop(); 102 | isPlaying = false; 103 | } 104 | } 105 | 106 | private void SetupTimer() 107 | { 108 | Timer songTimer = new Timer(); 109 | songTimer.Interval = 1000; 110 | songTimer.Tick += new EventHandler(TimerTick); 111 | songTimer.Start(); 112 | } 113 | 114 | private void TimerTick(object sender, EventArgs e) 115 | { 116 | timerCount += 1; 117 | 118 | if (shouldStop) 119 | { 120 | StopSong(); 121 | shouldStop = false; 122 | } 123 | 124 | if (isPlaying && timerCount >= timerGoal) 125 | { 126 | StopSong(); 127 | } 128 | 129 | //Check if csgo is focused 130 | if (WinAPI.GetActiveProcess() == "cs2") 131 | { 132 | active = 1; 133 | } 134 | else 135 | { 136 | active = 0; 137 | } 138 | 139 | if (delayedCount >= 2) 140 | { 141 | UpdateVolume(); 142 | } 143 | else 144 | { 145 | delayedCount++; 146 | } 147 | } 148 | } 149 | } 150 | -------------------------------------------------------------------------------- /CS-Jukebox/MainForm.Designer.cs: -------------------------------------------------------------------------------- 1 |  2 | namespace CS_Jukebox 3 | { 4 | partial class MainForm 5 | { 6 | /// 7 | /// Required designer variable. 8 | /// 9 | private System.ComponentModel.IContainer components = null; 10 | 11 | /// 12 | /// Clean up any resources being used. 13 | /// 14 | /// true if managed resources should be disposed; otherwise, false. 15 | protected override void Dispose(bool disposing) 16 | { 17 | if (disposing && (components != null)) 18 | { 19 | components.Dispose(); 20 | } 21 | base.Dispose(disposing); 22 | } 23 | 24 | #region Windows Form Designer generated code 25 | 26 | /// 27 | /// Required method for Designer support - do not modify 28 | /// the contents of this method with the code editor. 29 | /// 30 | private void InitializeComponent() 31 | { 32 | this.components = new System.ComponentModel.Container(); 33 | System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(MainForm)); 34 | this.trackBar1 = new System.Windows.Forms.TrackBar(); 35 | this.openFileDialog1 = new System.Windows.Forms.OpenFileDialog(); 36 | this.musicComboBox = new System.Windows.Forms.ComboBox(); 37 | this.addButton = new System.Windows.Forms.Button(); 38 | this.directoryButton = new System.Windows.Forms.Button(); 39 | this.editButton = new System.Windows.Forms.Button(); 40 | this.notifyIcon = new System.Windows.Forms.NotifyIcon(this.components); 41 | this.autoCheckBox = new System.Windows.Forms.CheckBox(); 42 | ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).BeginInit(); 43 | this.SuspendLayout(); 44 | // 45 | // trackBar1 46 | // 47 | this.trackBar1.AutoSize = false; 48 | this.trackBar1.Location = new System.Drawing.Point(12, 41); 49 | this.trackBar1.Maximum = 100; 50 | this.trackBar1.Name = "trackBar1"; 51 | this.trackBar1.Size = new System.Drawing.Size(261, 24); 52 | this.trackBar1.TabIndex = 0; 53 | this.trackBar1.TickStyle = System.Windows.Forms.TickStyle.None; 54 | this.trackBar1.Value = 70; 55 | this.trackBar1.Scroll += new System.EventHandler(this.trackBar1_Scroll); 56 | // 57 | // openFileDialog1 58 | // 59 | this.openFileDialog1.FileName = "openFileDialog1"; 60 | // 61 | // musicComboBox 62 | // 63 | this.musicComboBox.FormattingEnabled = true; 64 | this.musicComboBox.Location = new System.Drawing.Point(12, 12); 65 | this.musicComboBox.Name = "musicComboBox"; 66 | this.musicComboBox.Size = new System.Drawing.Size(121, 23); 67 | this.musicComboBox.TabIndex = 3; 68 | this.musicComboBox.Tag = ""; 69 | this.musicComboBox.Text = "Select Music Kit..."; 70 | this.musicComboBox.SelectedIndexChanged += new System.EventHandler(this.musicComboBox_SelectedIndexChanged); 71 | // 72 | // addButton 73 | // 74 | this.addButton.Location = new System.Drawing.Point(139, 11); 75 | this.addButton.Name = "addButton"; 76 | this.addButton.Size = new System.Drawing.Size(70, 23); 77 | this.addButton.TabIndex = 4; 78 | this.addButton.Text = "Add"; 79 | this.addButton.UseVisualStyleBackColor = true; 80 | this.addButton.Click += new System.EventHandler(this.addButton_Click); 81 | // 82 | // directoryButton 83 | // 84 | this.directoryButton.Location = new System.Drawing.Point(12, 103); 85 | this.directoryButton.Name = "directoryButton"; 86 | this.directoryButton.Size = new System.Drawing.Size(121, 23); 87 | this.directoryButton.TabIndex = 5; 88 | this.directoryButton.Text = "Change Directory..."; 89 | this.directoryButton.UseVisualStyleBackColor = true; 90 | this.directoryButton.Click += new System.EventHandler(this.directoryButton_Click); 91 | // 92 | // editButton 93 | // 94 | this.editButton.Location = new System.Drawing.Point(215, 11); 95 | this.editButton.Name = "editButton"; 96 | this.editButton.Size = new System.Drawing.Size(58, 23); 97 | this.editButton.TabIndex = 6; 98 | this.editButton.Text = "Edit"; 99 | this.editButton.UseVisualStyleBackColor = true; 100 | this.editButton.Click += new System.EventHandler(this.editButton_Click); 101 | // 102 | // notifyIcon 103 | // 104 | this.notifyIcon.BalloonTipIcon = System.Windows.Forms.ToolTipIcon.Info; 105 | this.notifyIcon.BalloonTipTitle = "CS Jukebox"; 106 | this.notifyIcon.Icon = ((System.Drawing.Icon)(resources.GetObject("notifyIcon.Icon"))); 107 | this.notifyIcon.Text = "CS Jukebox"; 108 | this.notifyIcon.MouseClick += new System.Windows.Forms.MouseEventHandler(this.notifyIcon_MouseClick); 109 | // 110 | // autoCheckBox 111 | // 112 | this.autoCheckBox.AutoSize = true; 113 | this.autoCheckBox.Location = new System.Drawing.Point(139, 107); 114 | this.autoCheckBox.Name = "autoCheckBox"; 115 | this.autoCheckBox.Size = new System.Drawing.Size(138, 19); 116 | this.autoCheckBox.TabIndex = 7; 117 | this.autoCheckBox.Text = "Autostart CS Jukebox"; 118 | this.autoCheckBox.UseVisualStyleBackColor = true; 119 | this.autoCheckBox.CheckedChanged += new System.EventHandler(this.autoCheckBox_CheckedChanged); 120 | // 121 | // MainForm 122 | // 123 | this.AutoScaleDimensions = new System.Drawing.SizeF(7F, 15F); 124 | this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; 125 | this.ClientSize = new System.Drawing.Size(285, 135); 126 | this.Controls.Add(this.autoCheckBox); 127 | this.Controls.Add(this.editButton); 128 | this.Controls.Add(this.directoryButton); 129 | this.Controls.Add(this.addButton); 130 | this.Controls.Add(this.musicComboBox); 131 | this.Controls.Add(this.trackBar1); 132 | this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Fixed3D; 133 | this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); 134 | this.Name = "MainForm"; 135 | this.Text = "CS Jukebox"; 136 | this.FormClosing += new System.Windows.Forms.FormClosingEventHandler(this.MainForm_FormClosing); 137 | this.Resize += new System.EventHandler(this.MainForm_Resize); 138 | ((System.ComponentModel.ISupportInitialize)(this.trackBar1)).EndInit(); 139 | this.ResumeLayout(false); 140 | this.PerformLayout(); 141 | 142 | } 143 | 144 | #endregion 145 | private System.Windows.Forms.TrackBar trackBar1; 146 | private System.Windows.Forms.OpenFileDialog openFileDialog1; 147 | private System.Windows.Forms.ComboBox musicComboBox; 148 | private System.Windows.Forms.Button addButton; 149 | private System.Windows.Forms.Button directoryButton; 150 | private System.Windows.Forms.Button editButton; 151 | private System.Windows.Forms.NotifyIcon notifyIcon; 152 | private System.Windows.Forms.CheckBox autoCheckBox; 153 | } 154 | } 155 | 156 | -------------------------------------------------------------------------------- /CS-Jukebox/MainForm.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Runtime.InteropServices; 3 | using System.Windows.Forms; 4 | using Microsoft.Win32; 5 | 6 | namespace CS_Jukebox 7 | { 8 | public partial class MainForm : Form 9 | { 10 | [DllImport("kernel32.dll", SetLastError = true)] 11 | [return: MarshalAs(UnmanagedType.Bool)] 12 | static extern bool AllocConsole(); 13 | 14 | private GameLogic logic; 15 | 16 | public MainForm() 17 | { 18 | InitializeComponent(); 19 | //AllocConsole(); //Enable console 20 | MaximizeBox = false; 21 | 22 | Properties.Load(); 23 | 24 | //If game directory is not set, create 25 | //popup so that user can browse to it. 26 | if (Properties.GameDir == null) 27 | { 28 | Form dirPopup = new GamePathForm(); 29 | dirPopup.Location = this.Location; 30 | dirPopup.ShowDialog(this); 31 | } 32 | 33 | CheckAutoStart(); 34 | Start(); 35 | } 36 | 37 | void Start() 38 | { 39 | RefreshParameters(); 40 | SetupGameListener(); 41 | } 42 | 43 | void SetupGameListener() 44 | { 45 | Properties.CreateConfig(); 46 | logic = new GameLogic(); 47 | } 48 | 49 | //Refreshes controls that contain mutable data 50 | void RefreshParameters() 51 | { 52 | CreateKitDropdown(); 53 | 54 | trackBar1.Value = Properties.MasterVolume; 55 | } 56 | 57 | private void CreateKitDropdown() 58 | { 59 | musicComboBox.Items.Clear(); 60 | 61 | foreach (MusicKit musicKit in Properties.MusicKits) 62 | { 63 | musicComboBox.Items.Add(musicKit.Name); 64 | } 65 | 66 | if (Properties.SelectedKit != null) 67 | musicComboBox.SelectedIndex = Properties.MusicKits.IndexOf(Properties.SelectedKit); 68 | } 69 | 70 | private void CheckAutoStart() 71 | { 72 | RegistryKey registryKey = Registry.CurrentUser.OpenSubKey 73 | ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); 74 | bool autoStart = registryKey.GetValue("CS-Jukebox") != null; 75 | autoCheckBox.Checked = autoStart; 76 | } 77 | 78 | private void RegisterInStartup(bool isChecked) 79 | { 80 | RegistryKey registryKey = Registry.CurrentUser.OpenSubKey 81 | ("SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Run", true); 82 | if (isChecked) 83 | { 84 | registryKey.SetValue("CS-Jukebox", Application.ExecutablePath); 85 | } 86 | else 87 | { 88 | registryKey.DeleteValue("CS-Jukebox"); 89 | } 90 | } 91 | 92 | private void trackBar1_Scroll(object sender, EventArgs e) 93 | { 94 | Properties.MasterVolume = trackBar1.Value; 95 | logic.jukebox.UpdateVolume(); 96 | } 97 | 98 | private void addButton_Click(object sender, EventArgs e) 99 | { 100 | Form musicSelector = new MusicSelector(new MusicKit(""), true); 101 | musicSelector.Location = this.Location; 102 | musicSelector.ShowDialog(this); 103 | RefreshParameters(); 104 | } 105 | 106 | private void editButton_Click(object sender, EventArgs e) 107 | { 108 | if (Properties.SelectedKit != null) 109 | { 110 | Form musicSelector = new MusicSelector(Properties.SelectedKit, false); 111 | musicSelector.Location = this.Location; 112 | musicSelector.ShowDialog(this); 113 | RefreshParameters(); 114 | } 115 | } 116 | 117 | private void musicComboBox_SelectedIndexChanged(object sender, EventArgs e) 118 | { 119 | Properties.SelectedKit = Properties.MusicKits[musicComboBox.SelectedIndex]; 120 | } 121 | 122 | private void MainForm_FormClosing(object sender, FormClosingEventArgs e) 123 | { 124 | logic.Stop(); 125 | Properties.Save(); 126 | } 127 | 128 | private void directoryButton_Click(object sender, EventArgs e) 129 | { 130 | Form dirPopup = new GamePathForm(); 131 | dirPopup.Location = this.Location; 132 | dirPopup.ShowDialog(this); 133 | RefreshParameters(); 134 | } 135 | 136 | private void MainForm_Resize(object sender, EventArgs e) 137 | { 138 | if (WindowState == FormWindowState.Minimized) 139 | { 140 | Hide(); 141 | notifyIcon.Visible = true; 142 | } 143 | } 144 | 145 | private void notifyIcon_MouseClick(object sender, MouseEventArgs e) 146 | { 147 | Show(); 148 | WindowState = FormWindowState.Normal; 149 | notifyIcon.Visible = false; 150 | } 151 | 152 | private void autoCheckBox_CheckedChanged(object sender, EventArgs e) 153 | { 154 | RegisterInStartup(autoCheckBox.Checked); 155 | } 156 | } 157 | } 158 | -------------------------------------------------------------------------------- /CS-Jukebox/MainForm.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | 61 | 17, 17 62 | 63 | 64 | 157, 17 65 | 66 | 67 | 68 | 69 | AAABAAMAEBAAAAAAAABoBQAANgAAACAgAAAAAAAAqAgAAJ4FAAAwMAAAAAAAAKgOAABGDgAAKAAAABAA 70 | AAAgAAAAAQAIAAAAAABAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AJgkJAPH//wAAAAAAAAAAAAAA 71 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA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AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 147 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgICAgICAgICAgICAgICAgI 148 | CAgICAgICAgICAgICAgICAgICAAAAAAAAAAAAAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgI 149 | CAgICAgICAAAAAAAAAAAAAAAAAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAAAAAAA 150 | AAAAAAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAAAAAAAAAAAAAAAAAACAgI 151 | CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAAAAAAAAAAAAAAAAAAAAAICAgICAgICAgICAgI 152 | CAgICAgICAgICAgICAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsLCwsLCwsLCwsL 153 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwgLCwsLCwsLCwsLCwgICAAAAAAAAAAA 154 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwgICwsICwsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 155 | CAgLCwsLCwsLCAgICAsLCAsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCAgI 156 | CAgLCwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwgICAgICwgLCwsLCwsL 157 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsICAgICwgLCwsLCwsLCwgICAAAAAAAAAAA 158 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 159 | CAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsL 160 | CwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsL 161 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAA 162 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 163 | CAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsL 164 | CwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsL 165 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICAgLCwsLCwsLCwgICAAAAAAAAAAA 166 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 167 | CAgICwsLCwsLCwsLCwsLCwsLCwsLCwsLCAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICAgICAgICAgI 168 | CAgICAgICAgICAgICAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgI 169 | CAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICwsLCwsLCwsLCwsLCwsLCwsLCwsLCAgICAAAAAAAAAAA 170 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 171 | CAgLCwgICAsICAgLCAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgL 172 | CAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgLCA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AgICAgICAgICAgICAgICAgICAgICAgICAAAAAAA 278 | AAAAAAAAAAAACAgICAgICAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAAAAAAAAAAAAAAAAAACAgI 279 | CAgICAgICAgICAgICAgICAgICAgICAgICAgICAgAAAAAAAAAAAAAAAAAAAAAAAAICAgICAgICAgICAgI 280 | CAgICAgICAgICAgICAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsLCwsLCwsLCwsL 281 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwgLCwsLCwsLCwsLCwgICAAAAAAAAAAA 282 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwgICwsICwsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 283 | CAgLCwsLCwsLCAgICAsLCAsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCAgI 284 | CAgLCwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwgICAgICwgLCwsLCwsL 285 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsICAgICwgLCwsLCwsLCwgICAAAAAAAAAAA 286 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 287 | CAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsL 288 | CwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsL 289 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAA 290 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 291 | CAgLCwsLCwsLCwsLCwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsL 292 | CwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsL 293 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICAgLCwsLCwsLCwgICAAAAAAAAAAA 294 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 295 | CAgICwsLCwsLCwsLCwsLCwsLCwsLCwsLCAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICAgICAgICAgI 296 | CAgICAgICAgICAgICAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgI 297 | CAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICwsLCwsLCwsLCwsLCwsLCwsLCwsLCAgICAAAAAAAAAAA 298 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 299 | CAgLCwgICAsICAgLCAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgL 300 | CAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgLCAgICwgICAsICAgL 301 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgLCAgICwgICAsICAgLCwgICAAAAAAAAAAA 302 | AAAAAAAAAAAAAAAICAgLCwgICAsICAgLCAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 303 | CAgLCwgICAsICAgLCAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAA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A/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+A 317 | AAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/ 318 | AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP/A 319 | AAAH/wAA/8AAAAf/AAD/wAAAB/8AAP/AAAAH/wAA/+AAAA//AAD/8AAAH/8AAP/4AAA//wAA//wAAH// 320 | AAD//gAA//8AAP//4A///wAA////////AAA= 321 | 322 | 323 | -------------------------------------------------------------------------------- /CS-Jukebox/MusicKit.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CS_Jukebox 8 | { 9 | //Contains references to SongProfiles 10 | public class MusicKit 11 | { 12 | public string Name; 13 | 14 | public SongProfile freezeSong { get; set; } 15 | public SongProfile startSong { get; set; } 16 | public SongProfile bombSong { get; set; } 17 | public SongProfile winSong { get; set; } 18 | public SongProfile loseSong { get; set; } 19 | public SongProfile MVPSong { get; set; } 20 | public SongProfile bombTenSecSong { get; set; } 21 | public SongProfile roundTenSecSong { get; set; } 22 | public SongProfile mainMenuSong { get; set; } 23 | 24 | public MusicKit(string name) 25 | { 26 | Name = name; 27 | 28 | freezeSong = new SongProfile(); 29 | startSong = new SongProfile(); 30 | bombSong = new SongProfile(); 31 | winSong = new SongProfile(); 32 | loseSong = new SongProfile(); 33 | MVPSong = new SongProfile(); 34 | bombTenSecSong = new SongProfile(); 35 | roundTenSecSong = new SongProfile(); 36 | mainMenuSong = new SongProfile(); 37 | } 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /CS-Jukebox/MusicSelector.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Windows.Forms; 3 | 4 | namespace CS_Jukebox 5 | { 6 | public partial class MusicSelector : Form 7 | { 8 | MusicKit currentKit = null; //Music kit currently being edited 9 | bool createMode = false; 10 | 11 | public MusicSelector(MusicKit newKit, bool? createKit) 12 | { 13 | InitializeComponent(); 14 | MaximizeBox = false; 15 | 16 | if (createKit.HasValue) createMode = createKit.Value; 17 | currentKit = newKit; 18 | 19 | LoadKitParameters(); 20 | } 21 | 22 | private void MusicSelector_Load(object sender, EventArgs e) 23 | { 24 | 25 | } 26 | 27 | //Loads parameters into controls such as textboxes and trackbars 28 | private void LoadKitParameters() 29 | { 30 | nameTextBox.Text = currentKit.Name; 31 | 32 | SetParamsFromSong(currentKit.freezeSong, freezeTextBox, freezeTrackBar, freezeStartTextBox); 33 | SetParamsFromSong(currentKit.startSong, startTextBox, startTrackBar, startStartTextBox); 34 | SetParamsFromSong(currentKit.bombSong, bombTextBox, bombTrackBar, bombStartTextBox); 35 | SetParamsFromSong(currentKit.winSong, wonTextBox, wonTrackBar, wonStartTextBox); 36 | SetParamsFromSong(currentKit.loseSong, lostTextBox, lostTrackBar, lostStartTextBox); 37 | SetParamsFromSong(currentKit.MVPSong, MVPTextBox, MVPTrackBar, MVPStartTextBox); 38 | SetParamsFromSong(currentKit.bombTenSecSong, bombTenSecTextBox, bombTenSecTrackBar, bombTenSecStartBox); 39 | SetParamsFromSong(currentKit.roundTenSecSong, roundTenSecTextBox, roundTenSecTrackBar, roundTenSecStartBox); 40 | SetParamsFromSong(currentKit.mainMenuSong, menuTextBox, menuTrackBar, menuStartTextBox); 41 | } 42 | 43 | private void saveButton_Click(object sender, EventArgs e) 44 | { 45 | if (nameTextBox.Text == "") 46 | { 47 | //Show warning prompt 48 | MessageBox.Show("Please enter a name.", "Warning", MessageBoxButtons.OK); 49 | } 50 | else 51 | { 52 | currentKit.freezeSong = GetSongFromParams(freezeTextBox, freezeTrackBar, freezeStartTextBox); 53 | currentKit.startSong = GetSongFromParams(startTextBox, startTrackBar, startStartTextBox); 54 | currentKit.bombSong = GetSongFromParams(bombTextBox, bombTrackBar, bombStartTextBox); 55 | currentKit.winSong = GetSongFromParams(wonTextBox, wonTrackBar, wonStartTextBox); 56 | currentKit.loseSong = GetSongFromParams(lostTextBox, lostTrackBar, lostStartTextBox); 57 | currentKit.MVPSong = GetSongFromParams(MVPTextBox, MVPTrackBar, MVPStartTextBox); 58 | currentKit.bombTenSecSong = GetSongFromParams(bombTenSecTextBox, bombTenSecTrackBar, bombTenSecStartBox); 59 | currentKit.roundTenSecSong = GetSongFromParams(roundTenSecTextBox, roundTenSecTrackBar, roundTenSecStartBox); 60 | currentKit.mainMenuSong = GetSongFromParams(menuTextBox, menuTrackBar, menuStartTextBox); 61 | 62 | if (createMode) 63 | { 64 | //Add kit to list if it is a new kit 65 | currentKit.Name = nameTextBox.Text; 66 | Properties.MusicKits.Add(currentKit); 67 | Properties.SelectedKit = currentKit; 68 | } 69 | else if (nameTextBox.Text != currentKit.Name) 70 | { 71 | //Detect if a music kit was renamed 72 | Properties.DeleteKitFile(currentKit.Name); 73 | currentKit.Name = nameTextBox.Text; 74 | } 75 | 76 | Properties.Save(); 77 | 78 | //Add some form of delegate method to invoke in MainForm.cs 79 | Close(); 80 | } 81 | } 82 | 83 | //Returns a new SongProfile based on values of given form controls 84 | private SongProfile GetSongFromParams(TextBox pathTextBox, TrackBar volumeTrackbar, TextBox startTextBox) 85 | { 86 | SongProfile newSong = new SongProfile(pathTextBox.Text, volumeTrackbar.Value); 87 | newSong.Start = startTextBox.Enabled ? int.Parse(startTextBox.Text) : 0; 88 | return newSong; 89 | } 90 | 91 | //Sets parameters of controls from song 92 | private void SetParamsFromSong(SongProfile songProfile, 93 | TextBox pathTextBox, 94 | TrackBar volumeTrackbar, 95 | TextBox startTextBox) 96 | { 97 | pathTextBox.Text = songProfile.Path; 98 | volumeTrackbar.Value = songProfile.Volume; 99 | startTextBox.Text = songProfile.Start.ToString(); 100 | } 101 | 102 | private void cancelButton_Click(object sender, EventArgs e) 103 | { 104 | Close(); 105 | } 106 | 107 | private void deleteButton_Click(object sender, EventArgs e) 108 | { 109 | DialogResult confirmResult = MessageBox.Show("Are you sure you want to delete this kit?", "Delete Music Kit", MessageBoxButtons.YesNo); 110 | 111 | if (createMode) 112 | { 113 | Close(); 114 | } 115 | 116 | if (confirmResult == DialogResult.Yes) 117 | { 118 | Properties.DeleteKitFile(currentKit.Name); 119 | Properties.MusicKits.Remove(currentKit); 120 | Properties.SaveKits(); 121 | 122 | Close(); 123 | } 124 | } 125 | 126 | //Click handlers for browse buttons 127 | 128 | private void OpenSongFile(TextBox textBox) 129 | { 130 | if (openFileDialog1.ShowDialog() == DialogResult.OK) 131 | { 132 | textBox.Text = openFileDialog1.FileName; 133 | } 134 | } 135 | 136 | private void freezeButton_Click(object sender, EventArgs e) 137 | { 138 | OpenSongFile(freezeTextBox); 139 | } 140 | 141 | private void startButton_Click(object sender, EventArgs e) 142 | { 143 | OpenSongFile(startTextBox); 144 | } 145 | 146 | private void bombButton_Click(object sender, EventArgs e) 147 | { 148 | OpenSongFile(bombTextBox); 149 | } 150 | 151 | private void wonButton_Click(object sender, EventArgs e) 152 | { 153 | OpenSongFile(wonTextBox); 154 | } 155 | 156 | private void lostButton_Click(object sender, EventArgs e) 157 | { 158 | OpenSongFile(lostTextBox); 159 | } 160 | 161 | private void MVPButton_Click(object sender, EventArgs e) 162 | { 163 | OpenSongFile(MVPTextBox); 164 | } 165 | 166 | private void bombTenSecButton_Click(object sender, EventArgs e) 167 | { 168 | OpenSongFile(bombTenSecTextBox); 169 | } 170 | 171 | private void roundTenSecButton_Click(object sender, EventArgs e) 172 | { 173 | OpenSongFile(roundTenSecTextBox); 174 | } 175 | 176 | private void menuButton_Click(object sender, EventArgs e) 177 | { 178 | OpenSongFile(menuTextBox); 179 | } 180 | 181 | private void freezeStartTextbox_KeyPress(object sender, KeyPressEventArgs e) 182 | { 183 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && 184 | (e.KeyChar != '.')) 185 | { 186 | e.Handled = true; 187 | } 188 | } 189 | 190 | private void startStartTextBox_KeyPress(object sender, KeyPressEventArgs e) 191 | { 192 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && 193 | (e.KeyChar != '.')) 194 | { 195 | e.Handled = true; 196 | } 197 | } 198 | 199 | private void bombStartTextBox_KeyPress(object sender, KeyPressEventArgs e) 200 | { 201 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && 202 | (e.KeyChar != '.')) 203 | { 204 | e.Handled = true; 205 | } 206 | } 207 | 208 | private void wonStartTextBox_KeyPress(object sender, KeyPressEventArgs e) 209 | { 210 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && 211 | (e.KeyChar != '.')) 212 | { 213 | e.Handled = true; 214 | } 215 | } 216 | 217 | private void lostStartTextBox_KeyPress(object sender, KeyPressEventArgs e) 218 | { 219 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && 220 | (e.KeyChar != '.')) 221 | { 222 | e.Handled = true; 223 | } 224 | } 225 | 226 | private void MVPStartTextBox_KeyPress(object sender, KeyPressEventArgs e) 227 | { 228 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && 229 | (e.KeyChar != '.')) 230 | { 231 | e.Handled = true; 232 | } 233 | } 234 | 235 | private void bombTenSecStartBox_KeyPress(object sender, KeyPressEventArgs e) 236 | { 237 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && 238 | (e.KeyChar != '.')) 239 | { 240 | e.Handled = true; 241 | } 242 | } 243 | 244 | private void roundTenSecStartBox_KeyPress(object sender, KeyPressEventArgs e) 245 | { 246 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && 247 | (e.KeyChar != '.')) 248 | { 249 | e.Handled = true; 250 | } 251 | } 252 | 253 | private void menuStartTextBox_KeyPress(object sender, KeyPressEventArgs e) 254 | { 255 | if (!char.IsControl(e.KeyChar) && !char.IsDigit(e.KeyChar) && 256 | (e.KeyChar != '.')) 257 | { 258 | e.Handled = true; 259 | } 260 | } 261 | } 262 | } 263 | -------------------------------------------------------------------------------- /CS-Jukebox/MusicSelector.resx: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | text/microsoft-resx 50 | 51 | 52 | 2.0 53 | 54 | 55 | System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 56 | 57 | 58 | System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 59 | 60 | 61 | 17, 17 62 | 63 | 64 | 65 | 66 | AAABAAMAEBAAAAAAAABoBQAANgAAACAgAAAAAAAAqAgAAJ4FAAAwMAAAAAAAAKgOAABGDgAAKAAAABAA 67 | AAAgAAAAAQAIAAAAAABAAQAAAAAAAAAAAAAAAAAAAAAAAAAAAAD///8AJgkJAPH//wAAAAAAAAAAAAAA 68 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 69 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 70 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 71 | AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 72 | AAAAAAAAAAAAAAAAAAA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sLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsL 161 | CwsICwgLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICwgLCwsLCwsL 162 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsICAgLCwsLCwsLCwgICAAAAAAAAAAA 163 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 164 | CAgICwsLCwsLCwsLCwsLCwsLCwsLCwsLCAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICAgICAgICAgI 165 | CAgICAgICAgICAgICAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICAgICAgICAgICAgICAgICAgICAgI 166 | CAgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgICwsLCwsLCwsLCwsLCwsLCwsLCwsLCAgICAAAAAAAAAAA 167 | AAAAAAAAAAAAAAAICAgLCwsLCwsLCwsLCwsLCwsLCwsLCwsLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 168 | CAgLCwgICAsICAgLCAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgL 169 | CAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgLCAgICwgICAsICAgL 170 | CwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgLCAgICwgICAsICAgLCwgICAAAAAAAAAAA 171 | AAAAAAAAAAAAAAAICAgLCwgICAsICAgLCAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAI 172 | CAgLCwgICAsICAgLCAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAAAICAgLCwgICAsICAgL 173 | CAgICwgICAsICAgLCwgICAAAAAAAAAAAAAAAAAAAAAAAAA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/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/ 187 | AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP+AAAAD/wAA/4AAAAP/AAD/gAAAA/8AAP/A 188 | AAAH/wAA/8AAAAf/AAD/wAAAB/8AAP/AAAAH/wAA/+AAAA//AAD/8AAAH/8AAP/4AAA//wAA//wAAH// 189 | AAD//gAA//8AAP//4A///wAA////////AAA= 190 | 191 | 192 | -------------------------------------------------------------------------------- /CS-Jukebox/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Threading.Tasks; 5 | using System.Windows.Forms; 6 | 7 | namespace CS_Jukebox 8 | { 9 | static class Program 10 | { 11 | /// 12 | /// The main entry point for the application. 13 | /// 14 | [STAThread] 15 | static void Main() 16 | { 17 | Application.SetHighDpiMode(HighDpiMode.SystemAware); 18 | Application.EnableVisualStyles(); 19 | Application.SetCompatibleTextRenderingDefault(false); 20 | Application.Run(new MainForm()); 21 | } 22 | } 23 | } 24 | -------------------------------------------------------------------------------- /CS-Jukebox/Properties.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | using System.IO; 7 | using System.Runtime.Serialization; 8 | using System.Windows.Forms; 9 | using Newtonsoft.Json; 10 | 11 | namespace CS_Jukebox 12 | { 13 | static class Properties 14 | { 15 | //Paths 16 | public static readonly string ConfigPath = @"\csgo\cfg\gamestate_integration_jukebox.cfg"; 17 | public static readonly string ConfigName = @"\gamestate_integration_jukebox.cfg"; 18 | public static readonly string PropertiesFilePath = @"\properties.json"; 19 | public static readonly string MusicKitsPath = @"\kits"; 20 | 21 | public static string GameDir = null; 22 | public static int MasterVolume; 23 | public static MusicKit SelectedKit 24 | { 25 | get { return selectedKit; } 26 | set { SetKit(value); } 27 | } 28 | 29 | public static List MusicKits = null; 30 | 31 | private static string startDir; 32 | 33 | private static MusicKit selectedKit = null; 34 | private static string SelectedKitName = null; 35 | 36 | //Calls all load methods 37 | public static void Load() 38 | { 39 | LoadProperties(); 40 | LoadKits(); 41 | } 42 | 43 | //Calls all save methods 44 | public static void Save() 45 | { 46 | SaveProperties(); 47 | SaveKits(); 48 | } 49 | 50 | //Converts settings to json file then saves it 51 | public static void SaveProperties() 52 | { 53 | string dir = startDir + PropertiesFilePath; 54 | 55 | PropertiesFile propFile = new PropertiesFile(); 56 | propFile.GameDir = GameDir; 57 | propFile.SelectedKitName = SelectedKitName; 58 | propFile.MasterVolume = MasterVolume; 59 | Console.WriteLine(propFile.GameDir); 60 | 61 | string jsonFile = JsonConvert.SerializeObject(propFile); 62 | 63 | Console.WriteLine("Saving json properties: "); 64 | Console.WriteLine(jsonFile); 65 | File.WriteAllText(dir, jsonFile); 66 | } 67 | 68 | //Reads properties file then deserializes it 69 | public static void LoadProperties() 70 | { 71 | //startDir = Directory.GetCurrentDirectory(); 72 | startDir = GetAppDirectory(); 73 | Console.WriteLine("App Directory: " + startDir); 74 | string dir = startDir + PropertiesFilePath; 75 | PropertiesFile propFile; 76 | 77 | try 78 | { 79 | string jsonFile = File.ReadAllText(dir); 80 | propFile = JsonConvert.DeserializeObject(jsonFile); 81 | GameDir = propFile.GameDir; 82 | SelectedKitName = propFile.SelectedKitName; 83 | MasterVolume = propFile.MasterVolume; 84 | } 85 | catch (FileNotFoundException e) 86 | { 87 | propFile = new PropertiesFile(); 88 | } 89 | } 90 | 91 | private static string GetAppDirectory() 92 | { 93 | string[] execPath = Application.ExecutablePath.Split('\\'); 94 | string appDir = ""; 95 | 96 | for (int i = 0; i < execPath.Length - 1; i++) 97 | { 98 | appDir += execPath[i]; 99 | if (i < execPath.Length - 2) appDir += "\\"; 100 | } 101 | 102 | return appDir; 103 | } 104 | 105 | //Copies the config from local folder to CS:GO cfg folder 106 | public static void CreateConfig() 107 | {string configPath = Properties.GameDir + Properties.ConfigPath; 108 | string configSrc = startDir + Properties.ConfigName; 109 | 110 | if (File.Exists(configPath)) 111 | { 112 | File.Delete(configPath); 113 | File.Copy(configSrc, configPath); 114 | } 115 | else 116 | { 117 | File.Copy(configSrc, configPath); 118 | } 119 | } 120 | 121 | public static void SaveKits() 122 | { 123 | string dir = startDir + MusicKitsPath; 124 | 125 | Directory.CreateDirectory(dir); 126 | 127 | foreach (MusicKit musicKit in MusicKits) 128 | { 129 | Console.WriteLine("Saving song: " + musicKit.Name); 130 | string kitDir = dir + @"\" + musicKit.Name + ".json"; 131 | Console.WriteLine(kitDir); 132 | string jsonFile = JsonConvert.SerializeObject(musicKit); 133 | Console.WriteLine(jsonFile); 134 | File.WriteAllText(kitDir, jsonFile); 135 | } 136 | } 137 | 138 | public static void LoadKits() 139 | { 140 | string dir = startDir + MusicKitsPath; 141 | MusicKits = new List(); 142 | 143 | if (Directory.Exists(dir)) 144 | { 145 | foreach (string filePath in Directory.GetFiles(dir)) 146 | { 147 | if (!filePath.EndsWith(".json")) continue; 148 | string jsonFile = ""; 149 | 150 | try 151 | { 152 | jsonFile = File.ReadAllText(filePath); 153 | } 154 | catch (Exception e) 155 | { 156 | Console.WriteLine("Exception when trying to load music kits."); 157 | Console.WriteLine(e.StackTrace); 158 | } 159 | finally 160 | { 161 | MusicKit musicKit = JsonConvert.DeserializeObject(jsonFile); 162 | MusicKits.Add(musicKit); 163 | } 164 | } 165 | } 166 | else 167 | { 168 | Directory.CreateDirectory(dir); 169 | } 170 | 171 | //Find a value for SelectedKit if applicable 172 | if (MusicKits.Count > 0) 173 | { 174 | foreach (MusicKit musicKit in MusicKits) 175 | { 176 | if (musicKit.Name.Equals(SelectedKitName)) 177 | { 178 | SelectedKit = musicKit; 179 | } 180 | } 181 | 182 | if (SelectedKit == null) 183 | { 184 | SelectedKit = MusicKits[0]; 185 | } 186 | } 187 | } 188 | 189 | //Deletes the json file for a kit but not the kit itself 190 | public static void DeleteKitFile(string kitName) 191 | { 192 | string dir = startDir + MusicKitsPath; 193 | string kitDir = dir + @"\" + kitName + ".json"; 194 | File.Delete(kitDir); 195 | } 196 | 197 | private static void SetKit(MusicKit newKit) 198 | { 199 | selectedKit = newKit; 200 | SelectedKitName = selectedKit.Name; 201 | } 202 | 203 | //Inner class for properties parameters 204 | private class PropertiesFile 205 | { 206 | public string GameDir; 207 | public string SelectedKitName; 208 | public int MasterVolume; 209 | } 210 | } 211 | } 212 | -------------------------------------------------------------------------------- /CS-Jukebox/SongProfile.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using System.Threading.Tasks; 6 | 7 | namespace CS_Jukebox 8 | { 9 | //Contains reference to the path of a song and saves volume 10 | public class SongProfile 11 | { 12 | public string Path; 13 | public int Volume; 14 | public int Start; 15 | 16 | public SongProfile() 17 | { 18 | Path = ""; 19 | Volume = 100; 20 | } 21 | 22 | public SongProfile(string path, int volume) 23 | { 24 | Path = path; 25 | Volume = volume; 26 | } 27 | } 28 | } 29 | -------------------------------------------------------------------------------- /CS-Jukebox/WinAPI.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Diagnostics; 4 | using System.Linq; 5 | using System.Runtime.InteropServices; 6 | using System.Text; 7 | using System.Threading.Tasks; 8 | 9 | namespace CS_Jukebox 10 | { 11 | public static class WinAPI 12 | { 13 | //Used to get Handle for Foreground Window 14 | [DllImport("user32.dll", CharSet = CharSet.Auto)] 15 | private static extern IntPtr GetForegroundWindow(); 16 | 17 | //Used to get ID of any Window 18 | [DllImport("user32.dll", CharSet = CharSet.Auto)] 19 | private static extern int GetWindowThreadProcessId(IntPtr hWnd, out int lpdwProcessId); 20 | public delegate bool WindowEnumProc(IntPtr hwnd, IntPtr lparam); 21 | 22 | [DllImport("user32.dll")] 23 | [return: MarshalAs(UnmanagedType.Bool)] 24 | public static extern bool EnumChildWindows(IntPtr hwnd, WindowEnumProc callback, IntPtr lParam); 25 | private static Process _realProcess; 26 | 27 | public static string GetActiveProcess() 28 | { 29 | string app = ""; 30 | var foregroundProcess = Process.GetProcessById(GetWindowProcessId(GetforegroundWindow())); 31 | if (foregroundProcess.ProcessName == "ApplicationFrameHost") 32 | { 33 | foregroundProcess = GetRealProcess(foregroundProcess); 34 | } 35 | if (foregroundProcess != null) 36 | { 37 | app = foregroundProcess.ProcessName; 38 | } 39 | return app; 40 | } 41 | 42 | private static int GetWindowProcessId(IntPtr hwnd) 43 | { 44 | int pid; 45 | GetWindowThreadProcessId(hwnd, out pid); 46 | return pid; 47 | } 48 | 49 | private static IntPtr GetforegroundWindow() 50 | { 51 | return GetForegroundWindow(); 52 | } 53 | 54 | private static Process GetRealProcess(Process foregroundProcess) 55 | { 56 | EnumChildWindows(foregroundProcess.MainWindowHandle, ChildWindowCallback, IntPtr.Zero); 57 | return _realProcess; 58 | } 59 | 60 | private static bool ChildWindowCallback(IntPtr hwnd, IntPtr lparam) 61 | { 62 | var process = Process.GetProcessById(GetWindowProcessId(hwnd)); 63 | if (process.ProcessName != "ApplicationFrameHost") 64 | { 65 | _realProcess = process; 66 | } 67 | return true; 68 | } 69 | } 70 | } 71 | -------------------------------------------------------------------------------- /CS-Jukebox/gamestate_integration_jukebox.cfg: -------------------------------------------------------------------------------- 1 | "Jukebox Integration v 1.0" 2 | { 3 | "uri" "http://localhost:3010" 4 | "timeout" "5.0" 5 | "buffer" "0.1" 6 | "throttle" "0.5" 7 | "heartbeat" "10" 8 | "data" 9 | { 10 | "provider" "1" 11 | "map" "1" 12 | "round" "1" 13 | "bomb" "1" 14 | "phase_countdowns" "1" 15 | "player_id" "1" 16 | "player_weapons" "1" 17 | "player_match_stats" "1" 18 | "player_state" "1" 19 | } 20 | } -------------------------------------------------------------------------------- /CS-Jukebox/icon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzhabib/CS-Jukebox/b4d1c9452c5c6be5148a848613277cd0c27129e8/CS-Jukebox/icon.ico -------------------------------------------------------------------------------- /CS-Jukebox/logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzhabib/CS-Jukebox/b4d1c9452c5c6be5148a848613277cd0c27129e8/CS-Jukebox/logo.ico -------------------------------------------------------------------------------- /CSGSI/CSGSI.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {8D55804C-2CF1-4A65-9C3E-8E41CD809535} 8 | Library 9 | Properties 10 | CSGSI 11 | CSGSI 12 | v4.5 13 | 512 14 | 15 | 16 | true 17 | full 18 | false 19 | bin\Debug\ 20 | DEBUG;TRACE 21 | prompt 22 | 4 23 | 24 | 25 | pdbonly 26 | true 27 | bin\Release\ 28 | TRACE 29 | prompt 30 | 4 31 | bin\Release\CSGSI.XML 32 | 33 | 34 | 35 | ..\packages\Newtonsoft.Json.12.0.1\lib\net45\Newtonsoft.Json.dll 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 88 | -------------------------------------------------------------------------------- /CSGSI/Events/BombDefusedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using CSGSI.Nodes; 2 | 3 | namespace CSGSI.Events 4 | { 5 | /// 6 | /// A delegate to handle the BombDefused event. 7 | /// 8 | /// 9 | public delegate void BombDefusedHandler(BombDefusedEventArgs e); 10 | 11 | /// 12 | /// Contains information about the BombDefused event (e.g. the defuser). 13 | /// 14 | public class BombDefusedEventArgs 15 | { 16 | /// 17 | /// The player that defused the bomb. 18 | /// 19 | public PlayerNode Defuser; 20 | 21 | /// 22 | /// Initializes a new instance from the given information. 23 | /// 24 | /// The defuser. 25 | public BombDefusedEventArgs(PlayerNode probableDefuser) 26 | { 27 | Defuser = probableDefuser; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /CSGSI/Events/BombExplodedEventArgs.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Events 2 | { 3 | /// 4 | /// A delegate to handle the BombExploded event. 5 | /// 6 | /// 7 | public delegate void BombExplodedHandler(BombExplodedEventArgs e); 8 | 9 | /// 10 | /// Contains information about the BombExploded event (currently none). 11 | /// 12 | public class BombExplodedEventArgs 13 | { 14 | /// 15 | /// Initializes a new instance. 16 | /// 17 | public BombExplodedEventArgs() 18 | { 19 | } 20 | } 21 | } -------------------------------------------------------------------------------- /CSGSI/Events/BombPlantedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using CSGSI.Nodes; 2 | 3 | namespace CSGSI.Events 4 | { 5 | /// 6 | /// A delegate to handle the BombPlanted event. 7 | /// 8 | /// 9 | public delegate void BombPlantedHandler(BombPlantedEventArgs e); 10 | 11 | /// 12 | /// Contains information about the BombPlanted event (e.g. the planter). 13 | /// 14 | public class BombPlantedEventArgs 15 | { 16 | /// 17 | /// The player that planted the bomb. 18 | /// 19 | public PlayerNode Planter; 20 | 21 | /// 22 | /// Initializes a new instance from the given information. 23 | /// 24 | /// The planter. 25 | public BombPlantedEventArgs(PlayerNode planter) 26 | { 27 | Planter = planter; 28 | } 29 | } 30 | } -------------------------------------------------------------------------------- /CSGSI/Events/PlayerFlashedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using CSGSI.Nodes; 2 | 3 | namespace CSGSI.Events 4 | { 5 | /// 6 | /// A delegate to handle the PlayerFlashed event. 7 | /// 8 | /// 9 | public delegate void PlayerFlashedHandler(PlayerFlashedEventArgs e); 10 | 11 | /// 12 | /// Contains information about the PlayerFlashed event (e.g. the player that got flashed and how much). 13 | /// 14 | public class PlayerFlashedEventArgs 15 | { 16 | /// 17 | /// The player that was flashed. 18 | /// 19 | public PlayerNode Player; 20 | 21 | /// 22 | /// How much the player got flashed. 23 | /// 24 | public int Flashed => Player.State.Flashed; 25 | 26 | /// 27 | /// Initializes a new instance from the given information. 28 | /// 29 | /// The player that got flashed. 30 | public PlayerFlashedEventArgs(PlayerNode player) 31 | { 32 | Player = player; 33 | } 34 | } 35 | } -------------------------------------------------------------------------------- /CSGSI/Events/RoundBeginEventArgs.cs: -------------------------------------------------------------------------------- 1 | using CSGSI.Nodes; 2 | 3 | namespace CSGSI.Events 4 | { 5 | /// 6 | /// A delegate to handle the RoundBegin event. 7 | /// 8 | /// 9 | public delegate void RoundBeginHandler(RoundBeginEventArgs e); 10 | 11 | /// 12 | /// Contains information about the RoundBegin event (e.g. the current map, scores of each team etc.). 13 | /// 14 | public class RoundBeginEventArgs 15 | { 16 | /// 17 | /// Information about the map state. 18 | /// 19 | public MapNode Map; 20 | 21 | /// 22 | /// The total amount of rounds (i.e. T Score + CT Score + 1) 23 | /// 24 | public int TotalRound => Map.TeamCT.Score + Map.TeamT.Score + 1; 25 | 26 | /// 27 | /// The current score of the terrorist team. 28 | /// 29 | public int TScore => Map.TeamT.Score; 30 | 31 | /// 32 | /// The current score of the counter-terrorist team. 33 | /// 34 | public int CTScore => Map.TeamCT.Score; 35 | 36 | /// 37 | /// Initializes a new instance from the given . 38 | /// 39 | /// The that should be used to initialize this instance. 40 | public RoundBeginEventArgs(GameState gameState) 41 | { 42 | Map = gameState.Map; 43 | } 44 | } 45 | } -------------------------------------------------------------------------------- /CSGSI/Events/RoundEndEventArgs.cs: -------------------------------------------------------------------------------- 1 | using CSGSI.Nodes; 2 | using System.Linq; 3 | 4 | namespace CSGSI.Events 5 | { 6 | /// 7 | /// A delegate to handle the RoundEnd event. 8 | /// 9 | /// 10 | public delegate void RoundEndHandler(RoundEndEventArgs e); 11 | 12 | /// 13 | /// Contains information about the RoundEnd event (e.g. the team that won this round). 14 | /// 15 | public class RoundEndEventArgs 16 | { 17 | /// 18 | /// The team that won the round that just ended. 19 | /// 20 | public RoundWinTeam Winner; 21 | 22 | /// 23 | /// The reason why this round ended. 24 | /// 25 | public RoundWinReason Reason; 26 | 27 | /// 28 | /// Initializes a new instance from the given . 29 | /// 30 | /// The that should be used to initialize this instance. 31 | public RoundEndEventArgs(GameState gameState) 32 | { 33 | Winner = gameState.Round.WinTeam; 34 | 35 | //relying on the fact that the rounds are listed in the correct order... 36 | Reason = gameState.Map.RoundWins.RoundWinReasons.LastOrDefault(); 37 | } 38 | } 39 | } -------------------------------------------------------------------------------- /CSGSI/Events/RoundPhaseChangedEventArgs.cs: -------------------------------------------------------------------------------- 1 | using CSGSI.Nodes; 2 | 3 | namespace CSGSI.Events 4 | { 5 | /// 6 | /// A delegate to handle the RoundPhaseChanged event. 7 | /// 8 | /// 9 | public delegate void RoundPhaseChangedHandler(RoundPhaseChangedEventArgs e); 10 | 11 | /// 12 | /// Contains information about the PlayerGotKill event (e.g. previous and current phase). 13 | /// 14 | public class RoundPhaseChangedEventArgs 15 | { 16 | /// 17 | /// The phase that was active before this event was fired. 18 | /// 19 | public RoundPhase PreviousPhase; 20 | 21 | /// 22 | /// The phase that is active now. 23 | /// 24 | public RoundPhase CurrentPhase; 25 | 26 | /// 27 | /// Initializes a new instance from the given . 28 | /// 29 | /// The that should be used to initialize this instance. 30 | public RoundPhaseChangedEventArgs(GameState gameState) 31 | { 32 | PreviousPhase = gameState.Previously.Round.Phase; 33 | CurrentPhase = gameState.Round.Phase; 34 | } 35 | } 36 | } -------------------------------------------------------------------------------- /CSGSI/GameState.cs: -------------------------------------------------------------------------------- 1 | using CSGSI.Nodes; 2 | using Newtonsoft.Json.Linq; 3 | 4 | namespace CSGSI 5 | { 6 | /// 7 | /// This object represents the entire game state 8 | /// 9 | public class GameState 10 | { 11 | private readonly JObject _data; 12 | 13 | private ProviderNode _provider; 14 | private MapNode _map; 15 | private RoundNode _round; 16 | private GrenadesNode _grenades; 17 | private PlayerNode _player; 18 | private AllPlayersNode _allPlayers; 19 | private BombNode _bomb; 20 | private PhaseCountdownsNode _phaseCountdowns; 21 | private GameState _previously; 22 | private GameState _added; 23 | private AuthNode _auth; 24 | 25 | /// 26 | /// Contains information about the game that is sending the data and the Steam user that is running the game itself. 27 | /// 28 | public ProviderNode Provider 29 | { 30 | get 31 | { 32 | if (_provider == null) 33 | { 34 | _provider = new ProviderNode(_data["provider"]?.ToString() ?? ""); 35 | } 36 | 37 | return _provider; 38 | } 39 | set 40 | { 41 | _provider = value; 42 | } 43 | } 44 | 45 | /// 46 | /// Contains information about the current map and match (i.e. match score and remaining timeouts) 47 | /// 48 | public MapNode Map 49 | { 50 | get 51 | { 52 | if (_map == null) 53 | { 54 | _map = new MapNode(_data["map"]?.ToString() ?? ""); 55 | } 56 | 57 | return _map; 58 | } 59 | set 60 | { 61 | _map = value; 62 | } 63 | } 64 | 65 | /// 66 | /// Contains information about the state of the current round (e.g. phase or the winning team) 67 | /// 68 | public RoundNode Round 69 | { 70 | get 71 | { 72 | if (_round == null) 73 | { 74 | string roundJson = _data["round"]?.ToString() ?? "{}"; 75 | _round = new RoundNode(roundJson); 76 | } 77 | 78 | return _round; 79 | } 80 | set 81 | { 82 | _round = value; 83 | } 84 | } 85 | 86 | /// 87 | /// Contains information about the grenades that currently exist. 88 | /// 89 | public GrenadesNode Grenades 90 | { 91 | get 92 | { 93 | if (_grenades == null) 94 | { 95 | _grenades = new GrenadesNode(_data["grenades"]?.ToString() ?? ""); 96 | } 97 | 98 | return _grenades; 99 | } 100 | set 101 | { 102 | _grenades = value; 103 | } 104 | } 105 | 106 | /// 107 | /// Contains information about the player (i.e. in the current POV, meaning this changes frequently during spectating) 108 | /// 109 | public PlayerNode Player 110 | { 111 | get 112 | { 113 | if (_player == null) 114 | { 115 | _player = new PlayerNode(_data["player"]?.ToString() ?? ""); 116 | } 117 | 118 | return _player; 119 | } 120 | set 121 | { 122 | _player = value; 123 | } 124 | } 125 | 126 | /// 127 | /// Contains information about all players. 128 | /// !! This node is only available when spectating the match with access to every players' POV !! 129 | /// 130 | public AllPlayersNode AllPlayers 131 | { 132 | get 133 | { 134 | if (_allPlayers == null) 135 | { 136 | _allPlayers = new AllPlayersNode(_data["allplayers"]?.ToString() ?? ""); 137 | } 138 | 139 | return _allPlayers; 140 | } 141 | set 142 | { 143 | _allPlayers = value; 144 | } 145 | } 146 | 147 | /// 148 | /// Contains information about the bomb. 149 | /// 150 | public BombNode Bomb 151 | { 152 | get 153 | { 154 | if (_bomb == null) 155 | { 156 | _bomb = new BombNode(_data["bomb"]?.ToString() ?? ""); 157 | } 158 | return _bomb; 159 | } 160 | set 161 | { 162 | _bomb = value; 163 | } 164 | } 165 | 166 | /// 167 | /// Contains information about the current "phase" that the round (e.g. bomb planted) is in and how long the phase is going to last. 168 | /// 169 | public PhaseCountdownsNode PhaseCountdowns 170 | { 171 | get 172 | { 173 | if (_phaseCountdowns == null) 174 | { 175 | _phaseCountdowns = new PhaseCountdownsNode(_data["phase_countdowns"]?.ToString() ?? ""); 176 | } 177 | 178 | return _phaseCountdowns; 179 | } 180 | set 181 | { 182 | _phaseCountdowns = value; 183 | } 184 | } 185 | 186 | /// 187 | /// When information has changed from the previous gamestate to the current one, the old values (before the change) are stored in this node. 188 | /// 189 | public GameState Previously 190 | { 191 | get 192 | { 193 | if (_previously == null) 194 | { 195 | _previously = new GameState(_data["previously"]?.ToString() ?? ""); 196 | } 197 | 198 | return _previously; 199 | } 200 | set 201 | { 202 | _previously = value; 203 | } 204 | } 205 | 206 | /// 207 | /// When information has been received that was not present in the previous gamestate, the new values are (also) stored in this node. 208 | /// 209 | public GameState Added 210 | { 211 | get 212 | { 213 | if (_added == null) 214 | { 215 | _added = new GameState(_data["added"]?.ToString() ?? ""); 216 | } 217 | return _added; 218 | } 219 | set 220 | { 221 | _added = value; 222 | } 223 | } 224 | 225 | /// 226 | /// An auth code/phrase that can be set in your gamestate_integration_*.cfg. 227 | /// 228 | public AuthNode Auth 229 | { 230 | get 231 | { 232 | if (_auth == null) 233 | { 234 | _auth = new AuthNode(_data["auth"]?.ToString() ?? ""); 235 | } 236 | 237 | return _auth; 238 | } 239 | set 240 | { 241 | _auth = value; 242 | } 243 | } 244 | 245 | /// 246 | /// The JSON string that was used to generate this object 247 | /// 248 | public string JSON { get; private set; } 249 | 250 | /// 251 | /// Initialises a new GameState object using a JSON string 252 | /// 253 | /// 254 | public GameState(string JSONstring) 255 | { 256 | if (JSONstring.Equals("")) 257 | { 258 | JSONstring = "{}"; 259 | } 260 | 261 | JSON = JSONstring; 262 | _data = JObject.Parse(JSONstring); 263 | } 264 | } 265 | } -------------------------------------------------------------------------------- /CSGSI/GameStateListener.cs: -------------------------------------------------------------------------------- 1 | using CSGSI.Events; 2 | using CSGSI.Nodes; 3 | using System; 4 | using System.ComponentModel; 5 | using System.IO; 6 | using System.Linq; 7 | using System.Net; 8 | using System.Text.RegularExpressions; 9 | using System.Threading; 10 | 11 | namespace CSGSI 12 | { 13 | /// 14 | /// A delegate to handle the NewGameState event. 15 | /// 16 | /// The new . 17 | public delegate void NewGameStateHandler(GameState gs); 18 | 19 | /// 20 | /// A class that listens for HTTP POST requests 21 | /// 22 | public class GameStateListener : IGameStateListener 23 | { 24 | private AutoResetEvent _waitForConnection = new AutoResetEvent(false); 25 | private GameState _currentGameState; 26 | private HttpListener _listener; 27 | 28 | /// 29 | /// The most recently received GameState. 30 | /// 31 | public GameState CurrentGameState 32 | { 33 | get 34 | { 35 | return _currentGameState; 36 | } 37 | private set 38 | { 39 | if (_currentGameState == value) 40 | return; 41 | _currentGameState = value; 42 | RaiseEvent(NewGameState, _currentGameState); 43 | if (EnableRaisingIntricateEvents) 44 | ProcessGameState(_currentGameState); 45 | } 46 | } 47 | 48 | /// 49 | /// Gets the port that this GameStateListener instance is listening to. 50 | /// 51 | public int Port { get; private set; } 52 | 53 | /// 54 | /// Gets a value indicating if the listening process is running. 55 | /// 56 | public bool Running { get; private set; } = false; 57 | 58 | /// 59 | /// Is raised after a new GameState has been received. 60 | /// 61 | public event NewGameStateHandler NewGameState = delegate { }; 62 | 63 | /// 64 | /// A GameStateListener that listens for connections to http://localhost:<Port>/. 65 | /// 66 | /// 67 | public GameStateListener(int Port) 68 | { 69 | this.Port = Port; 70 | } 71 | 72 | /// 73 | /// A GameStateListener that listens for connections to the specified URI. 74 | /// 75 | /// The URI to listen to 76 | public GameStateListener(string URI) 77 | { 78 | if (!URI.EndsWith("/")) 79 | URI += "/"; 80 | 81 | Regex URIPattern = new Regex("^https?:\\/\\/.+:([0-9]*)\\/$", RegexOptions.IgnoreCase); 82 | Match PortMatch = URIPattern.Match(URI); 83 | if (!PortMatch.Success) 84 | { 85 | throw new ArgumentException("Not a valid URI: " + URI); 86 | } 87 | Port = Convert.ToInt32(PortMatch.Groups[1].Value); 88 | 89 | _listener = new HttpListener(); 90 | _listener.Prefixes.Add(URI); 91 | } 92 | 93 | /// 94 | /// Starts listening for HTTP POST requests on the specified port. 95 | /// 96 | /// Returns true on success 97 | public bool Start() 98 | { 99 | if (Running) 100 | return false; 101 | 102 | _listener = new HttpListener(); 103 | _listener.Prefixes.Add("http://localhost:" + Port + "/"); 104 | Thread ListenerThread = new Thread(new ThreadStart(Run)); 105 | try 106 | { 107 | _listener.Start(); 108 | } 109 | catch (HttpListenerException) 110 | { 111 | return false; 112 | } 113 | Running = true; 114 | ListenerThread.Start(); 115 | return true; 116 | } 117 | 118 | /// 119 | /// Stops listening for HTTP POST requests 120 | /// 121 | public void Stop() 122 | { 123 | Running = false; 124 | _listener.Close(); 125 | (_listener as IDisposable).Dispose(); 126 | } 127 | 128 | private void Run() 129 | { 130 | while (Running) 131 | { 132 | _listener.BeginGetContext(ReceiveGameState, _listener); 133 | _waitForConnection.WaitOne(); 134 | _waitForConnection.Reset(); 135 | } 136 | try 137 | { 138 | _listener.Stop(); 139 | } 140 | catch (ObjectDisposedException) 141 | { /* _listener was already disposed, do nothing */ } 142 | } 143 | 144 | private void ReceiveGameState(IAsyncResult result) 145 | { 146 | HttpListenerContext context; 147 | try 148 | { 149 | context = _listener.EndGetContext(result); 150 | } 151 | catch (ObjectDisposedException) 152 | { 153 | // Listener was Closed due to call of Stop(); 154 | return; 155 | } 156 | catch (HttpListenerException) 157 | { 158 | return; 159 | } 160 | finally 161 | { 162 | _waitForConnection.Set(); 163 | } 164 | 165 | HttpListenerRequest request = context.Request; 166 | string JSON; 167 | 168 | using (Stream inputStream = request.InputStream) 169 | { 170 | using (StreamReader sr = new StreamReader(inputStream)) 171 | { 172 | JSON = sr.ReadToEnd(); 173 | } 174 | } 175 | using (HttpListenerResponse response = context.Response) 176 | { 177 | response.StatusCode = (int)HttpStatusCode.OK; 178 | response.StatusDescription = "OK"; 179 | response.Close(); 180 | } 181 | CurrentGameState = new GameState(JSON); 182 | } 183 | 184 | #region Intricate Events 185 | 186 | /// 187 | /// Determines whether intricate events are raised or ignored. Most of these events are only available when spectating a match! 188 | /// 189 | public bool EnableRaisingIntricateEvents { get; set; } = false; 190 | 191 | /// 192 | /// Processes a GameState to determine which events have to be raised. 193 | /// 194 | /// 195 | private void ProcessGameState(GameState gs) 196 | { 197 | if (!EnableRaisingIntricateEvents) 198 | return; 199 | 200 | if (RoundPhaseChanged != null) 201 | { 202 | if (gs.Previously.Round.Phase != RoundPhase.Undefined && 203 | gs.Round.Phase != RoundPhase.Undefined && 204 | gs.Previously.Round.Phase != gs.Round.Phase) 205 | { 206 | RaiseEvent(RoundPhaseChanged, new RoundPhaseChangedEventArgs(gs)); 207 | } 208 | } 209 | 210 | if (PlayerFlashed != null) 211 | { 212 | foreach (var previousPlayer in gs.Previously.AllPlayers) 213 | { 214 | var currentPlayer = gs.AllPlayers.GetBySteamID(previousPlayer.SteamID); 215 | if (previousPlayer.State.Flashed == 0 && 216 | previousPlayer.State.Flashed < currentPlayer.State.Flashed) 217 | { 218 | RaiseEvent(PlayerFlashed, new PlayerFlashedEventArgs(currentPlayer)); 219 | } 220 | } 221 | } 222 | 223 | if (BombPlanted != null) 224 | { 225 | var planter = gs.Previously.AllPlayers.PlayerList.SingleOrDefault(player => player.Weapons.WeaponList.Any(weapon => weapon.Type == WeaponType.C4)); 226 | if (planter != null && 227 | gs.Previously.Bomb.State == BombState.Planting && 228 | gs.Bomb.State == BombState.Planted) 229 | { 230 | RaiseEvent(BombPlanted, new BombPlantedEventArgs(gs.AllPlayers.GetBySteamID(planter.SteamID))); 231 | } 232 | } 233 | 234 | if (BombDefused != null) 235 | { 236 | if (gs.Previously.Bomb.State == BombState.Planted && gs.Bomb.State == BombState.Defused) 237 | { 238 | var defuser = gs.AllPlayers.PlayerList.SingleOrDefault(player => gs.AllPlayers.GetBySteamID(player.SteamID).MatchStats.Score > player.MatchStats.Score); 239 | if (defuser == null) 240 | defuser = new PlayerNode(""); 241 | 242 | RaiseEvent(BombDefused, new BombDefusedEventArgs(defuser)); 243 | } 244 | } 245 | 246 | if (RoundEnd != null) 247 | { 248 | if (gs.Previously.Round.Phase == RoundPhase.Live && gs.Round.Phase == RoundPhase.Over) 249 | { 250 | RaiseEvent(RoundEnd, new RoundEndEventArgs(gs)); 251 | } 252 | } 253 | 254 | if (RoundBegin != null) 255 | { 256 | if (gs.Previously.Round.Phase == RoundPhase.FreezeTime && gs.Round.Phase == RoundPhase.Live) 257 | { 258 | RaiseEvent(RoundBegin, new RoundBeginEventArgs(gs)); 259 | } 260 | } 261 | 262 | if (BombExploded != null) 263 | { 264 | if (gs.Previously.Bomb.State == BombState.Planted && gs.Bomb.State == BombState.Exploded) 265 | { 266 | RaiseEvent(BombExploded); 267 | } 268 | } 269 | } 270 | 271 | /// 272 | /// Is raised when the round phase changes (for example "Live", "FreezeTime" etc.). 273 | /// 274 | public event RoundPhaseChangedHandler RoundPhaseChanged; 275 | 276 | /// 277 | /// Is raised when a player is flashed. Includes information about how much the player was flashed (0 - 255). 278 | /// 279 | public event PlayerFlashedHandler PlayerFlashed; 280 | 281 | /// 282 | /// Is raised when the bomb is planted. Contains information about who planted the bomb. 283 | /// 284 | public event BombPlantedHandler BombPlanted; 285 | 286 | /// 287 | /// Is raised when the bomb is defused. Contains information about the (probable) defuser (player who's Score increased with this GameState). 288 | /// 289 | public event BombDefusedHandler BombDefused; 290 | 291 | /// 292 | /// Is raised when the bomb explodes. 293 | /// 294 | public event BombExplodedHandler BombExploded; 295 | 296 | /// 297 | /// Is raised when the round ends. Contains information about which team won the round. 298 | /// 299 | public event RoundEndHandler RoundEnd; 300 | 301 | /// 302 | /// Is raised when a round begins (i.e. exits freeze time). Contains information about team scores and total round amount. 303 | /// 304 | public event RoundBeginHandler RoundBegin; 305 | 306 | private void RaiseEvent(MulticastDelegate handler, object data) 307 | { 308 | foreach (Delegate d in handler.GetInvocationList()) 309 | { 310 | if (d.Target is ISynchronizeInvoke) 311 | { 312 | (d.Target as ISynchronizeInvoke).BeginInvoke(d, new object[] { data }); 313 | } 314 | else 315 | { 316 | d.DynamicInvoke(data); 317 | } 318 | } 319 | } 320 | 321 | private void RaiseEvent(MulticastDelegate handler) 322 | { 323 | foreach (Delegate d in handler.GetInvocationList()) 324 | { 325 | if (d.Target is ISynchronizeInvoke) 326 | { 327 | (d.Target as ISynchronizeInvoke).BeginInvoke(d, null); 328 | } 329 | else 330 | { 331 | d.DynamicInvoke(null); 332 | } 333 | } 334 | } 335 | 336 | #endregion Intricate Events 337 | } 338 | } -------------------------------------------------------------------------------- /CSGSI/IGameStateListener.cs: -------------------------------------------------------------------------------- 1 | using CSGSI.Events; 2 | 3 | namespace CSGSI 4 | { 5 | /// 6 | /// Interface for GameStateListeners. 7 | /// 8 | public interface IGameStateListener 9 | { 10 | /// 11 | /// The most recently received . 12 | /// 13 | GameState CurrentGameState { get; } 14 | 15 | /// 16 | /// Gets or sets whether game related events should be raised. 17 | /// 18 | bool EnableRaisingIntricateEvents { get; set; } 19 | 20 | /// 21 | /// The port that is listened to. 22 | /// 23 | int Port { get; } 24 | 25 | /// 26 | /// Indicates whether this instance is currently listening. 27 | /// 28 | bool Running { get; } 29 | 30 | /// 31 | /// An event that is raised when the bomb is defused. 32 | /// 33 | event BombDefusedHandler BombDefused; 34 | 35 | /// 36 | /// An event that is raised when the bomb explodes. 37 | /// 38 | event BombExplodedHandler BombExploded; 39 | 40 | /// 41 | /// An event that is raised when the bomb is planted. 42 | /// 43 | event BombPlantedHandler BombPlanted; 44 | 45 | /// 46 | /// An event that is raised when a new was received. 47 | /// 48 | event NewGameStateHandler NewGameState; 49 | 50 | /// 51 | /// An event that is raised when a player gets flashed. 52 | /// 53 | event PlayerFlashedHandler PlayerFlashed; 54 | 55 | /// 56 | /// An event that is raised when a round begins (i.e. exits freeze time). 57 | /// 58 | event RoundBeginHandler RoundBegin; 59 | 60 | /// 61 | /// An event that is raised when a round ends. 62 | /// 63 | event RoundEndHandler RoundEnd; 64 | 65 | /// 66 | /// An event that is raised when the round phase changes. 67 | /// 68 | event RoundPhaseChangedHandler RoundPhaseChanged; 69 | 70 | /// 71 | /// Starts listening for HTTP POST requests. 72 | /// 73 | /// if successful, otherwise . 74 | bool Start(); 75 | 76 | /// 77 | /// Stops listening for HTTP POST requests. 78 | /// 79 | void Stop(); 80 | } 81 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/AllPlayersNode.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | 5 | namespace CSGSI.Nodes 6 | { 7 | /// 8 | /// A node that contains a list of s. 9 | /// This is only available when watching a demo or when spectating on a server with mp_forcecamera 1 10 | /// 11 | public class AllPlayersNode : NodeBase, IEnumerable 12 | { 13 | /// 14 | /// Gets the amount of players in this node. 15 | /// 16 | public int Count => Players.Count; 17 | 18 | /// 19 | /// A list of all player in this node. 20 | /// 21 | public List Players { get; set; } = new List(); 22 | 23 | /// 24 | /// Gets a list of all player in this node. (kept for compatibility) 25 | /// 26 | public IEnumerable PlayerList => Players; 27 | 28 | /// 29 | /// Gets a player by their in-game name. 30 | /// 31 | /// The name to search by. 32 | /// 33 | public PlayerNode GetByName(string name) 34 | { 35 | PlayerNode pn = Players.Find(x => x.Name == name); 36 | if (pn != null) 37 | return pn; 38 | 39 | return new PlayerNode(""); 40 | } 41 | 42 | /// 43 | /// Gets a player by their Steam-ID. 44 | /// 45 | /// The Steam-ID to search by. 46 | /// 47 | public PlayerNode GetBySteamID(string steamId) 48 | { 49 | PlayerNode pn = Players.Find(x => x.SteamID == steamId); 50 | if (pn != null) 51 | return pn; 52 | 53 | return new PlayerNode(""); 54 | } 55 | 56 | internal AllPlayersNode(string json) 57 | : base(json) 58 | { 59 | foreach (JToken jt in _data.Children()) 60 | { 61 | PlayerNode pn = new PlayerNode(jt.First.ToString()) 62 | { 63 | SteamID = jt.Value()?.Name ?? "" 64 | }; 65 | Players.Add(pn); 66 | } 67 | } 68 | 69 | /// 70 | /// Gets the player with index <index> 71 | /// 72 | /// 73 | /// 74 | public PlayerNode this[int index] 75 | { 76 | get 77 | { 78 | if (index > Players.Count - 1) 79 | { 80 | return new PlayerNode(""); 81 | } 82 | 83 | return Players[index]; 84 | } 85 | } 86 | 87 | /// 88 | /// Gets all players that are on the specified team. 89 | /// 90 | /// The team. 91 | /// 92 | public List GetByTeam(PlayerTeam team) 93 | { 94 | return Players.FindAll(x => x.Team == team); 95 | } 96 | 97 | /// 98 | /// Gets an enumerator that can be used to loop through all players in this node. 99 | /// 100 | /// 101 | public IEnumerator GetEnumerator() 102 | { 103 | return Players.GetEnumerator(); 104 | } 105 | 106 | IEnumerator IEnumerable.GetEnumerator() 107 | { 108 | return Players.GetEnumerator(); 109 | } 110 | } 111 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/AuthNode.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// A node that contains information related to authentication. 5 | /// 6 | public class AuthNode : NodeBase 7 | { 8 | /// 9 | /// The provided authentication token. 10 | /// 11 | public string Token { get; set; } 12 | 13 | internal AuthNode(string json) 14 | : base(json) 15 | { 16 | Token = GetString("token"); 17 | } 18 | } 19 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/BombNode.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// Contains information about the bomb. This node is only available when spectating! 5 | /// 6 | public class BombNode : NodeBase 7 | { 8 | /// 9 | /// The current state of the bomb. 10 | /// 11 | public BombState State { get; set; } 12 | 13 | /// 14 | /// The current position of the bomb. 15 | /// 16 | public Vector3 Position { get; set; } 17 | 18 | /// 19 | /// The time remaining for the current state (i.e. time remaining until explosion if bomb is planted, time remaining until defused if defusing, etc). 20 | /// 21 | public float Countdown { get; set; } 22 | 23 | /// 24 | /// Initializes a new from the given JSON string. 25 | /// 26 | /// 27 | public BombNode(string json) 28 | : base(json) 29 | { 30 | State = GetEnum("state"); 31 | Position = GetVector3("position"); 32 | Countdown = GetFloat("countdown"); 33 | } 34 | } 35 | 36 | /// 37 | /// Represents the state of the bomb. 38 | /// 39 | public enum BombState 40 | { 41 | /// 42 | /// Bomb is in unknown state. 43 | /// 44 | Undefined, 45 | 46 | /// 47 | /// Bomb was dropped. 48 | /// 49 | Dropped, 50 | 51 | /// 52 | /// Bomb is currently being carried by a player. 53 | /// 54 | Carried, 55 | 56 | /// 57 | /// Bomb is currently being planted. 58 | /// 59 | Planting, 60 | 61 | /// 62 | /// Bomb was planted. 63 | /// 64 | Planted, 65 | 66 | /// 67 | /// Bomb is currently being defused. 68 | /// 69 | Defusing, 70 | 71 | /// 72 | /// Bomb was defused. 73 | /// 74 | Defused, 75 | 76 | /// 77 | /// Bomb has exploded. 78 | /// 79 | Exploded 80 | } 81 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/Flame.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// Represents a flame that was generated by a molotov/incendiary grenade. 5 | /// 6 | public class Flame 7 | { 8 | /// 9 | /// The ID of this flame. 10 | /// 11 | public string ID { get; set; } 12 | 13 | /// 14 | /// The position of this flame. 15 | /// 16 | public Vector3 Position { get; set; } 17 | 18 | /// 19 | /// Initializes a new Flame with the given ID and position. 20 | /// 21 | /// The ID of this flame. 22 | /// The position of this flame. 23 | public Flame(string id, Vector3 position) 24 | { 25 | ID = id; 26 | Position = position; 27 | } 28 | } 29 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/GrenadeNode.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System.Collections.Generic; 3 | 4 | namespace CSGSI.Nodes 5 | { 6 | /// 7 | /// Contains information about a grenade. 8 | /// 9 | public class GrenadeNode : NodeBase 10 | { 11 | /// 12 | /// The ID of this grenade. -1 if ID could not be successfully parsed. 13 | /// 14 | public int ID { get; set; } 15 | 16 | /// 17 | /// The SteamID of the owner of this grenade. 18 | /// 19 | public string Owner { get; set; } 20 | 21 | /// 22 | /// The current position of this grenade. 23 | /// 24 | public Vector3 Position { get; set; } 25 | 26 | /// 27 | /// The current velocity of this grenade. 28 | /// 29 | public Vector3 Velocity { get; set; } 30 | 31 | /// 32 | /// How long (in seconds) this grenade has existed. 33 | /// 34 | public float Lifetime { get; set; } 35 | 36 | /// 37 | /// The type of this grenade. 38 | /// 39 | public GrenadeType Type { get; set; } 40 | 41 | /// 42 | /// How long (in seconds) the effect of this grenade has been active (e.g. the blooming of a smoke grenade). 43 | /// 44 | public float EffectTime { get; set; } 45 | 46 | /// 47 | /// Information about the flames that this grenade has generated (if this is a molotov/incendiary grenade). 48 | /// 49 | public List Flames { get; set; } = new List(); 50 | 51 | /// 52 | /// Initializes a new instance from the given JSON string, with the given ID. 53 | /// 54 | /// The JSON that this should be parsed from. 55 | /// The ID of this grenade. 56 | public GrenadeNode(string json, int id) 57 | : base(json) 58 | { 59 | ID = id; 60 | Owner = GetString("owner"); 61 | Position = GetVector3("position"); 62 | Velocity = GetVector3("velocity"); 63 | Lifetime = GetFloat("lifetime"); 64 | Type = GetEnum("type"); 65 | EffectTime = GetFloat("effecttime"); 66 | 67 | var flamesProperty = _data.Property("flames"); 68 | if (flamesProperty != null) 69 | { 70 | foreach (var obj in flamesProperty.Children()) 71 | { 72 | foreach (var flame in obj.Properties()) 73 | { 74 | Flames.Add(new Flame(flame.Name, Vector3.FromComponentString(flame.Value.ToString()))); 75 | } 76 | } 77 | } 78 | } 79 | } 80 | 81 | /// 82 | /// Represents the type of a grenade. 83 | /// 84 | public enum GrenadeType 85 | { 86 | /// 87 | /// Unknown grenade type. 88 | /// 89 | Undefined, 90 | 91 | /// 92 | /// Flashbang. 93 | /// 94 | Flashbang, 95 | 96 | /// 97 | /// Decoy grenade. 98 | /// 99 | Decoy, 100 | 101 | /// 102 | /// Incendiary grenade (CT). 103 | /// 104 | Firebomb, 105 | 106 | /// 107 | /// Smoke grenade. 108 | /// 109 | Smoke, 110 | 111 | /// 112 | /// Molotov (T). 113 | /// 114 | Inferno, 115 | 116 | /// 117 | /// HE/Frag grenade. 118 | /// 119 | Frag 120 | } 121 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/GrenadesNode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace CSGSI.Nodes 6 | { 7 | /// 8 | /// Contains information about all grenades that currently exist. 9 | /// 10 | public class GrenadesNode : NodeBase, IEnumerable 11 | { 12 | /// 13 | /// The list of all grenades that currently exist. 14 | /// 15 | public List Grenades { get; set; } = new List(); 16 | 17 | /// 18 | /// Initializes a new from the given JSON. 19 | /// 20 | /// The JSON that should be used to initialize this instance. 21 | public GrenadesNode(string json) 22 | : base(json) 23 | { 24 | foreach (var c in _data.Properties()) 25 | { 26 | int id = -1; 27 | int.TryParse(c.Name, out id); 28 | Grenades.Add(new GrenadeNode(c.Value.ToString(), id)); 29 | } 30 | } 31 | 32 | /// 33 | /// Returns an with all grenades of the given type. 34 | /// 35 | /// The type of grenades that should be returned. 36 | /// An with all grenades of the given type. 37 | public IEnumerable GetAllOfType(GrenadeType type) 38 | { 39 | return Grenades.Where(grenade => grenade.Type == type); 40 | } 41 | 42 | /// 43 | /// Returns an to iterate through all existing grenades. 44 | /// 45 | /// 46 | public IEnumerator GetEnumerator() 47 | { 48 | return Grenades.GetEnumerator(); 49 | } 50 | 51 | IEnumerator IEnumerable.GetEnumerator() 52 | { 53 | return Grenades.GetEnumerator(); 54 | } 55 | } 56 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/MapNode.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// A node that contains information about the current match. 5 | /// 6 | public class MapNode : NodeBase 7 | { 8 | /// 9 | /// Contains information about the rounds that have already ended. 10 | /// 11 | public MapRoundWinsNode RoundWins { get; set; } 12 | 13 | /// 14 | /// The game mode (e.g. Deathmatch, Casual etc.) 15 | /// 16 | public MapMode Mode { get; set; } 17 | 18 | /// 19 | /// The name of the current map (e.g. "de_mirage") 20 | /// 21 | public string Name { get; set; } 22 | 23 | /// 24 | /// The current phase of the match (e.g. Live, Warmup etc.) 25 | /// 26 | public MapPhase Phase { get; set; } 27 | 28 | /// 29 | /// The current round number 30 | /// Attention: This is set to 0 for both warmup and pistol-round, check .Phase to prevent errors. 31 | /// 32 | public int Round { get; set; } 33 | 34 | /// 35 | /// Contains information about the Counter-Terrorist team such as current score. 36 | /// 37 | public MapTeamNode TeamCT { get; set; } 38 | 39 | /// 40 | /// Contains information about the Terrorist team such as current score. 41 | /// 42 | public MapTeamNode TeamT { get; set; } 43 | 44 | /// 45 | /// Presumable used for tournaments. 46 | /// 47 | public int NumMatchesToWinSeries { get; set; } 48 | 49 | /// 50 | /// The amount of people currently spectating. 51 | /// 52 | public int CurrentSpectators { get; set; } 53 | 54 | /// 55 | /// Presumably used for tournaments to keep track of how many souvenir drops have been dropped to spectators. 56 | /// 57 | public int SouvenirsTotal { get; set; } 58 | 59 | internal MapNode(string json) 60 | : base(json) 61 | { 62 | RoundWins = new MapRoundWinsNode(_data["round_wins"]?.ToString() ?? ""); 63 | Mode = GetEnum("mode"); 64 | Name = GetString("name"); 65 | Phase = GetEnum("phase"); 66 | Round = GetInt32("round"); 67 | TeamCT = new MapTeamNode(_data["team_ct"]?.ToString() ?? ""); 68 | TeamT = new MapTeamNode(_data["team_t"]?.ToString() ?? ""); 69 | NumMatchesToWinSeries = GetInt32("num_matches_to_win_series"); 70 | CurrentSpectators = GetInt32("current_spectators"); 71 | SouvenirsTotal = GetInt32("souvenirs_total"); 72 | } 73 | } 74 | 75 | /// 76 | /// Indicates a phase of a match. 77 | /// 78 | public enum MapPhase 79 | { 80 | /// 81 | /// Undefined 82 | /// 83 | Undefined, 84 | 85 | /// 86 | /// The match is currently in warmup. 87 | /// 88 | Warmup, 89 | 90 | /// 91 | /// Match is live. 92 | /// 93 | Live, 94 | 95 | /// 96 | /// Match is currently in an intermission (e.g. half time pause). 97 | /// 98 | Intermission, 99 | 100 | /// 101 | /// Match has ended (i.e. currently displaying the end scoreboard). 102 | /// 103 | GameOver 104 | } 105 | 106 | /// 107 | /// Indicates a gamemode. 108 | /// 109 | public enum MapMode 110 | { 111 | /// 112 | /// Undefined 113 | /// 114 | Undefined, 115 | 116 | /// 117 | /// Casual mode 118 | /// 119 | Casual, 120 | 121 | /// 122 | /// Competitive mode 123 | /// 124 | Competitive, 125 | 126 | /// 127 | /// Deathmatch mode 128 | /// 129 | DeathMatch, 130 | 131 | /// 132 | /// Gun Game mode 133 | /// 134 | GunGameProgressive, 135 | 136 | /// 137 | /// Arms Race & Demolition mode 138 | /// 139 | GunGameTRBomb, 140 | 141 | /// 142 | /// Coop-Mission mode 143 | /// 144 | CoopMission, 145 | 146 | /// 147 | /// Wingman 148 | /// 149 | ScrimComp2v2, 150 | 151 | /// 152 | /// Custom mode 153 | /// 154 | Custom, 155 | 156 | /// 157 | /// Danger Zone 158 | /// 159 | Survival 160 | } 161 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/MapRoundWinsNode.cs: -------------------------------------------------------------------------------- 1 | using System.Collections; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | 5 | namespace CSGSI.Nodes 6 | { 7 | /// 8 | /// Contains information about all previously ended rounds. 9 | /// 10 | public class MapRoundWinsNode : NodeBase, IEnumerable 11 | { 12 | /// 13 | /// The list of all previously ended rounds. 14 | /// 15 | public List RoundWinReasons { get; set; } = new List(); 16 | 17 | /// 18 | /// Initializes a new from the given JSON. 19 | /// 20 | /// 21 | public MapRoundWinsNode(string json) 22 | : base(json) 23 | { 24 | int children = _data.Children().Count(); 25 | for (int i = 1; i <= children; i++) 26 | { 27 | RoundWinReasons.Add(GetEnum(i.ToString())); 28 | } 29 | } 30 | 31 | /// 32 | /// Get information about a specific round. 33 | /// 34 | /// The index of the round. 1-indexed. 35 | /// Information about the round. 36 | public RoundWinReason this[int round] 37 | { 38 | get 39 | { 40 | if (round <= 0 || round > RoundWinReasons.Count) 41 | { 42 | return RoundWinReason.Undefined; 43 | } 44 | 45 | return RoundWinReasons[round - 1]; 46 | } 47 | } 48 | 49 | /// 50 | /// Returns an to iterate through all existing rounds. 51 | /// 52 | /// 53 | public IEnumerator GetEnumerator() 54 | { 55 | return RoundWinReasons.GetEnumerator(); 56 | } 57 | 58 | IEnumerator IEnumerable.GetEnumerator() 59 | { 60 | return RoundWinReasons.GetEnumerator(); 61 | } 62 | } 63 | 64 | /// 65 | /// Represents the reason why a round was won. 66 | /// 67 | public enum RoundWinReason 68 | { 69 | /// 70 | /// Unknown reason. 71 | /// 72 | Undefined, 73 | 74 | /// 75 | /// Counter Terrorists won because the entire Terrorist team was eliminated. 76 | /// 77 | CtWinElimination, 78 | 79 | /// 80 | /// Terrorists won because the entire Counter Terrorist team was eliminated. 81 | /// 82 | TWinElimination, 83 | 84 | /// 85 | /// Counter Terrorists won because the bomb was defused. 86 | /// 87 | CtWinDefuse, 88 | 89 | /// 90 | /// Counter Terrorists won because the round ended. 91 | /// 92 | CtWinTime, 93 | 94 | /// 95 | /// Terrorists won because the bomb exploded. 96 | /// 97 | TWinBomb 98 | } 99 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/MapTeamNode.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// A node containing information about a team. 5 | /// 6 | public class MapTeamNode : NodeBase 7 | { 8 | /// 9 | /// The current score of this team. 10 | /// 11 | public int Score { get; set; } 12 | 13 | /// 14 | /// The amount of remaining time-outs this team has left. 15 | /// 16 | public int TimeoutsRemaining { get; set; } 17 | 18 | /// 19 | /// Unknown. 20 | /// 21 | public int MatchesWonThisSeries { get; set; } 22 | 23 | /// 24 | /// Name of the team (e.g. Clan name if all players have the same tag or FACEIT teams). 25 | /// 26 | public string Name { get; set; } 27 | 28 | internal MapTeamNode(string json) 29 | : base(json) 30 | { 31 | Score = GetInt32("score"); 32 | TimeoutsRemaining = GetInt32("timeouts_remaining"); 33 | MatchesWonThisSeries = GetInt32("matches_won_this_series"); 34 | Name = GetString("name"); 35 | } 36 | } 37 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/MatchStatsNode.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// A node containing information about a players stats. 5 | /// 6 | public class MatchStatsNode : NodeBase 7 | { 8 | /// 9 | /// The amount of kills this player currently has. 10 | /// 11 | public int Kills { get; set; } 12 | 13 | /// 14 | /// The amount of assists this player currently has. 15 | /// 16 | public int Assists { get; set; } 17 | 18 | /// 19 | /// The amount of deaths this player currently has. 20 | /// 21 | public int Deaths { get; set; } 22 | 23 | /// 24 | /// The amount of MVPs this player currently has. 25 | /// 26 | public int MVPs { get; set; } 27 | 28 | /// 29 | /// The current score of the player. 30 | /// 31 | public int Score { get; set; } 32 | 33 | internal MatchStatsNode(string JSON) 34 | : base(JSON) 35 | { 36 | Kills = GetInt32("kills"); 37 | Assists = GetInt32("assists"); 38 | Deaths = GetInt32("deaths"); 39 | MVPs = GetInt32("mvps"); 40 | Score = GetInt32("score"); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/NodeBase.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System; 3 | using System.Globalization; 4 | 5 | namespace CSGSI.Nodes 6 | { 7 | /// 8 | /// The base type for all nodes. 9 | /// 10 | public class NodeBase 11 | { 12 | /// 13 | /// The data that was passed via JSON. 14 | /// 15 | protected JObject _data; 16 | 17 | /// 18 | /// The raw JSON string that was used to construct this node. 19 | /// 20 | public string JSON { get; private set; } 21 | 22 | /// 23 | /// Whether or not this node contains data (i.e. JSON string is not empty) 24 | /// 25 | public bool HasData => !string.IsNullOrWhiteSpace(JSON); 26 | 27 | internal NodeBase(string json) 28 | { 29 | //for some reason empty/non existant children in the JSON are now being set to "true". 30 | //e.g.: "round": true 31 | if (json.Equals("") || json.Equals("true", StringComparison.InvariantCultureIgnoreCase)) 32 | { 33 | json = "{}"; 34 | } 35 | _data = JObject.Parse(json); 36 | JSON = json; 37 | } 38 | 39 | internal string GetString(string name) 40 | { 41 | return _data?[name]?.ToString() ?? ""; 42 | } 43 | 44 | internal int GetInt32(string name) 45 | { 46 | if (int.TryParse(_data[name]?.ToString() ?? "-1", out int result)) 47 | { 48 | return result; 49 | } 50 | return -1; 51 | } 52 | 53 | internal T GetEnum(string name) 54 | { 55 | string value = (_data[name]?.ToString().Replace(" ", String.Empty).Replace("_", string.Empty) ?? "Undefined"); 56 | return (T)Enum.Parse(typeof(T), value, true); 57 | } 58 | 59 | internal bool GetBool(string name) 60 | { 61 | return _data?[name]?.ToObject() ?? false; 62 | } 63 | 64 | internal Vector3 GetVector3(string name) 65 | { 66 | if (_data[name] == null) 67 | { 68 | return Vector3.Empty; 69 | } 70 | 71 | return Vector3.FromComponentString(_data[name].ToString()); 72 | } 73 | 74 | internal float GetFloat(string name) 75 | { 76 | if (float.TryParse(_data[name]?.ToString() ?? "-1", NumberStyles.Any, CultureInfo.InvariantCulture, out float value)) 77 | { 78 | return value; 79 | } 80 | 81 | return -1; 82 | } 83 | } 84 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/PhaseCountdownsNode.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// A node containing information about a phases state. 5 | /// 6 | public class PhaseCountdownsNode : NodeBase 7 | { 8 | /// 9 | /// The phase that this node represents. 10 | /// 11 | public PhaseCountdownsPhase Phase { get; set; } 12 | 13 | /// 14 | /// How long (in seconds) the current phase is going to last (unless interrupted by a phase change, i.e. Live -> Bomb). 15 | /// 16 | public float PhaseEndsIn { get; set; } 17 | 18 | internal PhaseCountdownsNode(string json) 19 | : base(json) 20 | { 21 | Phase = GetEnum("phase"); 22 | PhaseEndsIn = GetFloat("phase_ends_in"); 23 | } 24 | } 25 | 26 | /// 27 | /// Indicates a phase in the match that has a cooldown associated with it. 28 | /// 29 | public enum PhaseCountdownsPhase 30 | { 31 | /// 32 | /// Undefined 33 | /// 34 | Undefined, 35 | 36 | /// 37 | /// Match is live. 38 | /// 39 | Live, 40 | 41 | /// 42 | /// Round is over but the next round has not started yet. 43 | /// 44 | Over, 45 | 46 | /// 47 | /// Match is currently in freezetime. 48 | /// 49 | FreezeTime, 50 | 51 | /// 52 | /// Bomb is currently being defused. 53 | /// 54 | Defuse, 55 | 56 | /// 57 | /// Bomb was planted and is ticking down. 58 | /// 59 | Bomb, 60 | 61 | /// 62 | /// Match is currently in a time-out called by the T team. 63 | /// 64 | Timeout_T, 65 | 66 | /// 67 | /// Match is currently in a time-out called by the CT team. 68 | /// 69 | Timeout_CT 70 | } 71 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/PlayerNode.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// Contains information about a player. 5 | /// 6 | public class PlayerNode : NodeBase 7 | { 8 | /// 9 | /// The Steam ID of this player. 10 | /// 11 | public string SteamID { get; set; } 12 | 13 | /// 14 | /// The in game name of this player. 15 | /// 16 | public string Name { get; set; } 17 | 18 | /// 19 | /// The id assigned to this player for observers 20 | /// Example: if ObserverSlot = 4 then a spectator can press the "4" key to switch to this players' view 21 | /// 22 | public int ObserverSlot { get; set; } 23 | 24 | /// 25 | /// The team that this player is currently on. 26 | /// 27 | public PlayerTeam Team { get; set; } //TODO: test on faceit-servers 28 | 29 | /// 30 | /// The players clan tag. 31 | /// 32 | public string Clan { get; set; } 33 | 34 | /// 35 | /// The players current activity/state. 36 | /// 37 | public PlayerActivity Activity { get; set; } 38 | 39 | /// 40 | /// Contains information about this players' current inventory 41 | /// 42 | public WeaponsNode Weapons { get; set; } 43 | 44 | /// 45 | /// Contains information such as kills/deaths 46 | /// 47 | public MatchStatsNode MatchStats { get; set; } 48 | 49 | /// 50 | /// Contains information about the players' state (i.e. health, flashbang-status etc.) 51 | /// 52 | public PlayerStateNode State { get; set; } 53 | 54 | /// 55 | /// The position of this player in the world. 56 | /// 57 | public Vector3 Position { get; set; } 58 | 59 | /// 60 | /// The direction the player is currently facing. 61 | /// 62 | public Vector3 Forward { get; set; } 63 | 64 | /// 65 | /// The Steam ID of the player that this player is spectating. 66 | /// 67 | public string SpecTarget { get; set; } 68 | 69 | internal PlayerNode(string json) 70 | : base(json) 71 | { 72 | SteamID = GetString("steamid"); 73 | Name = GetString("name"); 74 | ObserverSlot = GetInt32("observer_slot"); 75 | Team = GetEnum("team"); 76 | Clan = GetString("clan"); 77 | State = new PlayerStateNode(_data?.SelectToken("state")?.ToString() ?? "{}"); 78 | Weapons = new WeaponsNode(_data?.SelectToken("weapons")?.ToString() ?? "{}"); 79 | MatchStats = new MatchStatsNode(_data?.SelectToken("match_stats")?.ToString() ?? "{}"); 80 | Activity = GetEnum("activity"); 81 | Position = GetVector3("position"); 82 | Forward = GetVector3("forward"); 83 | SpecTarget = GetString("spectarget"); 84 | } 85 | } 86 | 87 | /// 88 | /// Indicates a player activity/state. 89 | /// 90 | public enum PlayerActivity 91 | { 92 | /// 93 | /// Undefined 94 | /// 95 | Undefined, 96 | 97 | /// 98 | /// Is in a menu (also applies to opening the in game menu with ESC). 99 | /// 100 | Menu, 101 | 102 | /// 103 | /// Playing or spectating. 104 | /// 105 | Playing, 106 | 107 | /// 108 | /// Console is open. 109 | /// 110 | TextInput 111 | } 112 | 113 | /// 114 | /// Represents the team of a player. 115 | /// 116 | public enum PlayerTeam 117 | { 118 | /// 119 | /// Undefined 120 | /// 121 | Undefined, 122 | 123 | /// 124 | /// The terrorist team. 125 | /// 126 | T, 127 | 128 | /// 129 | /// The counter-terrorist team. 130 | /// 131 | CT 132 | } 133 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/PlayerStateNode.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// A node containing information about a players state. 5 | /// 6 | public class PlayerStateNode : NodeBase 7 | { 8 | /// 9 | /// The current HP of the player. 10 | /// 11 | public int Health { get; set; } 12 | 13 | /// 14 | /// The current armore of the player. 15 | /// 16 | public int Armor { get; set; } 17 | 18 | /// 19 | /// Indicates whether or not the player has a helmet. 20 | /// 21 | public bool Helmet { get; set; } 22 | 23 | /// 24 | /// Goes from 0 (not flashed) to 255 (fully flashed). After getting flashed, this will slowly go back down to 0. 25 | /// 26 | public int Flashed { get; set; } 27 | 28 | /// 29 | /// Goes from 0 (not in smoke) to 255 (fully in smoke). Indicates how obscured the players vision is by the smoke, with 255 being a completely grey screen. 30 | /// 31 | public int Smoked { get; set; } 32 | 33 | /// 34 | /// Goes from 0 (not burning) to 255 (standing in a molotov/incendiary) 35 | /// 36 | public int Burning { get; set; } 37 | 38 | /// 39 | /// The current money of the player. 40 | /// 41 | public int Money { get; set; } 42 | 43 | /// 44 | /// The amount of kills this player got this round. 45 | /// 46 | public int RoundKills { get; set; } 47 | 48 | /// 49 | /// The amount of headshot kills this player got this round. 50 | /// 51 | public int RoundKillHS { get; set; } 52 | 53 | /// 54 | /// The total amount of damage that this player has done this round. 55 | /// 56 | public int RoundTotalDmg { get; set; } 57 | 58 | /// 59 | /// Indicates whether or not this player has a defuse kit. 60 | /// 61 | public bool DefuseKit { get; set; } 62 | 63 | /// 64 | /// The total value of the players' current weapons + equipment (armor included) 65 | /// 66 | public int EquipValue { get; set; } 67 | 68 | internal PlayerStateNode(string json) 69 | : base(json) 70 | { 71 | Health = GetInt32("health"); 72 | Armor = GetInt32("armor"); 73 | Helmet = GetBool("helmet"); 74 | Flashed = GetInt32("flashed"); 75 | Smoked = GetInt32("smoked"); 76 | Burning = GetInt32("burning"); 77 | Money = GetInt32("money"); 78 | RoundKills = GetInt32("round_kills"); 79 | RoundKillHS = GetInt32("round_killhs"); 80 | RoundTotalDmg = GetInt32("round_totaldmg"); 81 | DefuseKit = GetBool("defusekit"); 82 | EquipValue = GetInt32("equip_value"); 83 | } 84 | } 85 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/ProviderNode.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// A node containing information about the entity that provided this gamestate. 5 | /// 6 | public class ProviderNode : NodeBase 7 | { 8 | /// 9 | /// The name of the entity. 10 | /// 11 | public string Name { get; set; } 12 | 13 | /// 14 | /// The App-ID of the entity. (730 in the case of CS:GO) 15 | /// 16 | public int AppID { get; set; } 17 | 18 | /// 19 | /// The version of the game. (not delimited by '.' as it is usually shown) 20 | /// 21 | public string Version { get; set; } 22 | 23 | /// 24 | /// The Steam-ID of the entity. 25 | /// 26 | public string SteamID { get; private set; } 27 | 28 | /// 29 | /// A Unix time stamp of when this data was sent. 30 | /// 31 | public string TimeStamp { get; private set; } 32 | 33 | internal ProviderNode(string json) 34 | : base(json) 35 | { 36 | Name = GetString("name"); 37 | AppID = GetInt32("appid"); 38 | Version = GetString("version"); 39 | SteamID = GetString("steamid"); 40 | TimeStamp = GetString("timestamp"); 41 | } 42 | } 43 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/RoundNode.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// A node containing information about the current round. 5 | /// 6 | public class RoundNode : NodeBase 7 | { 8 | /// 9 | /// The phase that the round is currently in. 10 | /// 11 | public RoundPhase Phase { get; set; } 12 | 13 | /// 14 | /// The current state of the bomb (does not include states like "Dropped" or "Planting"). 15 | /// 16 | public BombState Bomb { get; set; } 17 | 18 | /// 19 | /// The team that won the current round (only available when Phase == Over) 20 | /// 21 | public RoundWinTeam WinTeam { get; set; } 22 | 23 | internal RoundNode(string json) 24 | : base(json) 25 | { 26 | Phase = GetEnum("phase"); 27 | Bomb = GetEnum("bomb"); 28 | WinTeam = GetEnum("win_team"); 29 | } 30 | } 31 | 32 | /// 33 | /// Represents the phase of a round. 34 | /// 35 | public enum RoundPhase 36 | { 37 | /// 38 | /// Unknown round phase. 39 | /// 40 | Undefined, 41 | 42 | /// 43 | /// Round is live. 44 | /// 45 | Live, 46 | 47 | /// 48 | /// Round is over. 49 | /// 50 | Over, 51 | 52 | /// 53 | /// Round is currently in freeze time. 54 | /// 55 | FreezeTime 56 | } 57 | 58 | /// 59 | /// Represents the winning team of a round. 60 | /// 61 | public enum RoundWinTeam 62 | { 63 | /// 64 | /// Unknown winning team. 65 | /// 66 | Undefined, 67 | 68 | /// 69 | /// Terrorists won. 70 | /// 71 | T, 72 | 73 | /// 74 | /// Counter-Terrorists won. 75 | /// 76 | CT 77 | } 78 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/WeaponNode.cs: -------------------------------------------------------------------------------- 1 | namespace CSGSI.Nodes 2 | { 3 | /// 4 | /// A node containing information about a weapon. 5 | /// 6 | public class WeaponNode : NodeBase 7 | { 8 | /// 9 | /// The name of the weapon, for example "weapon_knife". 10 | /// 11 | public string Name { get; set; } 12 | 13 | /// 14 | /// The skin this weapon currently has, for example "cu_gut_lore". 15 | /// 16 | public string Paintkit { get; set; } 17 | 18 | /// 19 | /// The type of the weapon. 20 | /// 21 | public WeaponType Type { get; set; } 22 | 23 | /// 24 | /// The current ammunition. 25 | /// 26 | public int AmmoClip { get; set; } 27 | 28 | /// 29 | /// The maximum ammunition per magazine. 30 | /// 31 | public int AmmoClipMax { get; set; } 32 | 33 | /// 34 | /// The remaining ammunition that is not currently in the magazine. 35 | /// 36 | public int AmmoReserve { get; set; } 37 | 38 | /// 39 | /// The current state of this weapon. 40 | /// 41 | public WeaponState State { get; set; } 42 | 43 | internal WeaponNode(string JSON) 44 | : base(JSON) 45 | { 46 | Name = GetString("name"); 47 | Paintkit = GetString("paintkit"); 48 | Type = GetEnum("type"); 49 | AmmoClip = GetInt32("ammo_clip"); 50 | AmmoClipMax = GetInt32("ammo_clip_max"); 51 | AmmoReserve = GetInt32("ammo_reserve"); 52 | State = GetEnum("state"); 53 | } 54 | } 55 | 56 | /// 57 | /// Represents the type of a weapon. 58 | /// 59 | public enum WeaponType 60 | { 61 | /// 62 | /// Unknown weapon type. 63 | /// 64 | Undefined, 65 | 66 | /// 67 | /// Rifle. 68 | /// 69 | Rifle, 70 | 71 | /// 72 | /// Sniper rifle. 73 | /// 74 | SniperRifle, 75 | 76 | /// 77 | /// Submachine gun. 78 | /// 79 | SubmachineGun, 80 | 81 | /// 82 | /// Shotgun. 83 | /// 84 | Shotgun, 85 | 86 | /// 87 | /// Machine gun. 88 | /// 89 | MachineGun, 90 | 91 | /// 92 | /// Pistol. 93 | /// 94 | Pistol, 95 | 96 | /// 97 | /// Knife. 98 | /// 99 | Knife, 100 | 101 | /// 102 | /// Grenade. 103 | /// 104 | Grenade, 105 | 106 | /// 107 | /// Bomb/C4. 108 | /// 109 | C4, 110 | 111 | /// 112 | /// Used for example for the coop stimpacks. 113 | /// 114 | StackableItem, 115 | 116 | /// 117 | /// Tablet in Danger Zone. 118 | /// 119 | Tablet, 120 | 121 | /// 122 | /// Bare fists in Danger Zone. 123 | /// 124 | Fists, 125 | 126 | /// 127 | /// Breach charge in Danger Zone. 128 | /// 129 | BreachCharge, 130 | 131 | /// 132 | /// Melee weapons (such as hammer/wrench) in Danger Zone. 133 | /// 134 | Melee 135 | } 136 | 137 | /// 138 | /// Represents the state of a weapon. 139 | /// 140 | public enum WeaponState 141 | { 142 | /// 143 | /// Unknown weapon state. 144 | /// 145 | Undefined, 146 | 147 | /// 148 | /// The weapon is currently equipped. 149 | /// 150 | Active, 151 | 152 | /// 153 | /// The weapon is not currently equipped. 154 | /// 155 | Holstered, 156 | 157 | /// 158 | /// The weapon is currently equipped and is being reloaded. 159 | /// 160 | Reloading 161 | } 162 | } -------------------------------------------------------------------------------- /CSGSI/Nodes/WeaponsNode.cs: -------------------------------------------------------------------------------- 1 | using Newtonsoft.Json.Linq; 2 | using System.Collections.Generic; 3 | 4 | namespace CSGSI.Nodes 5 | { 6 | /// 7 | /// A node containing a collection of s. 8 | /// 9 | public class WeaponsNode : NodeBase 10 | { 11 | /// 12 | /// The list of all weapons in this node. 13 | /// 14 | public List Weapons { get; set; } = new List(); 15 | 16 | /// 17 | /// Gets the list of s. 18 | /// 19 | public IEnumerable WeaponList => Weapons; 20 | 21 | /// 22 | /// The amount of weapons this node contains. 23 | /// 24 | public int Count => Weapons.Count; 25 | 26 | /// 27 | /// The weapon/equipment the player has currently pulled out. 28 | /// 29 | public WeaponNode ActiveWeapon 30 | { 31 | get 32 | { 33 | foreach (WeaponNode weapon in Weapons) 34 | { 35 | if (weapon.State == WeaponState.Active || weapon.State == WeaponState.Reloading) 36 | return weapon; 37 | } 38 | 39 | return new WeaponNode(""); 40 | } 41 | } 42 | 43 | internal WeaponsNode(string json) 44 | : base(json) 45 | { 46 | foreach (JToken weapon in _data.Children()) 47 | { 48 | Weapons.Add(new WeaponNode(weapon.First.ToString())); 49 | } 50 | } 51 | 52 | /// 53 | /// Gets the weapon with index <index> 54 | /// 55 | /// 56 | /// 57 | public WeaponNode this[int index] 58 | { 59 | get 60 | { 61 | if (index > Weapons.Count - 1) 62 | { 63 | return new WeaponNode(""); 64 | } 65 | 66 | return Weapons[index]; 67 | } 68 | } 69 | } 70 | } -------------------------------------------------------------------------------- /CSGSI/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.InteropServices; 3 | 4 | // General Information about an assembly is controlled through the following 5 | // set of attributes. Change these attribute values to modify the information 6 | // associated with an assembly. 7 | [assembly: AssemblyTitle("CSGSI")] 8 | [assembly: AssemblyDescription("A simple Game State Integration handler for CS:GO")] 9 | [assembly: AssemblyConfiguration("")] 10 | [assembly: AssemblyCompany("")] 11 | [assembly: AssemblyProduct("CSGSI")] 12 | [assembly: AssemblyCopyright("")] 13 | [assembly: AssemblyTrademark("")] 14 | [assembly: AssemblyCulture("")] 15 | 16 | // Setting ComVisible to false makes the types in this assembly not visible 17 | // to COM components. If you need to access a type in this assembly from 18 | // COM, set the ComVisible attribute to true on that type. 19 | [assembly: ComVisible(false)] 20 | 21 | // The following GUID is for the ID of the typelib if this project is exposed to COM 22 | [assembly: Guid("12de3576-5e68-4a3a-9355-faf4500e71bc")] 23 | 24 | // Version information for an assembly consists of the following four values: 25 | // 26 | // Major Version 27 | // Minor Version 28 | // Build Number 29 | // Revision 30 | // 31 | // You can specify all the values or you can default the Build and Revision Numbers 32 | // by using the '*' as shown below: 33 | // [assembly: AssemblyVersion("1.0.*")] 34 | [assembly: AssemblyVersion("1.3.1.0")] 35 | [assembly: AssemblyFileVersion("1.3.1.0")] -------------------------------------------------------------------------------- /CSGSI/Vector3.cs: -------------------------------------------------------------------------------- 1 | using System.Globalization; 2 | 3 | namespace CSGSI 4 | { 5 | /// 6 | /// A 3 dimensional vector. 7 | /// 8 | public struct Vector3 9 | { 10 | /// 11 | /// The X component of the vector (left/right). 12 | /// 13 | public double X; 14 | 15 | /// 16 | /// The Y component of the vector (up/down). 17 | /// 18 | public double Y; 19 | 20 | /// 21 | /// The Z component of the vector (forward/backward). 22 | /// 23 | public double Z; 24 | 25 | /// 26 | /// Returns a Vector3 instance with X, Y and Z set to 0. 27 | /// 28 | public static Vector3 Empty => new Vector3(0, 0, 0); 29 | 30 | /// 31 | /// Initializes a new vector with the given X, Y and Z components. 32 | /// 33 | /// 34 | /// 35 | /// 36 | public Vector3(double x, double y, double z) 37 | { 38 | this.X = x; 39 | this.Y = y; 40 | this.Z = z; 41 | } 42 | 43 | /// 44 | /// Initializes a new from the given component string. 45 | /// 46 | /// A string in the format "x,y,z". Whitespace is permitted. 47 | /// A new with the given component values. 48 | public static Vector3 FromComponentString(string components) 49 | { 50 | string[] xyz = components.Split(','); 51 | if (xyz.Length != 3) 52 | return Vector3.Empty; 53 | 54 | if (double.TryParse(xyz[0].Trim(), NumberStyles.Any, CultureInfo.InvariantCulture, out double x) && 55 | double.TryParse(xyz[1].Trim(), NumberStyles.Any, CultureInfo.InvariantCulture, out double y) && 56 | double.TryParse(xyz[2].Trim(), NumberStyles.Any, CultureInfo.InvariantCulture, out double z)) 57 | { 58 | return new Vector3(x, y, z); 59 | } 60 | 61 | return Vector3.Empty; 62 | } 63 | 64 | /// 65 | /// Generates a string formatted like so: 66 | /// (X, Y, Z) 67 | /// 68 | /// The string representation of this vector. 69 | public override string ToString() 70 | { 71 | return $"({X}, {Y}, {Z})"; 72 | } 73 | } 74 | } -------------------------------------------------------------------------------- /CSGSI/packages.config: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # CS-Jukebox 2 | Introducing CS-Jukebox, a tool that allows you to play your own custom music kits in CS2! 3 | 4 | [![CS Jukebox Trailer](https://img.youtube.com/vi/s9UX5aizHTY/0.jpg)](https://www.youtube.com/watch?v=s9UX5aizHTY) 5 | ![image](https://user-images.githubusercontent.com/26579319/128274959-d2ada5f1-ac48-4d88-b7c0-4cf9a42ea790.png) 6 | 7 | # Getting Started 8 | 1. [Download the latest release](https://github.com/zzhabib/CS-Jukebox/releases/download/v1.01/CS.Jukebox.v1.01.zip) (Windows only). 9 | 2. Extract the folder inside the zip. 10 | 3. Launch CS-Jukebox.exe 11 | 4. Jukebox will ask you to locate the root folder for CS2. This is the folder "game" in your game root (steamapps\common\Counter-Strike Global Offensive\game) 12 | 5. If CS2 is open, it must be restarted for Jukebox to work. 13 | 14 | # How to create kits 15 | Creating a music kit can be easily done inside CS-Jukebox 16 | 1. Click the "Add" button on the main screen. 17 | 2. Create a name for the music kit. 18 | 3. For each song, click browse to navigate to a song downloaded on your computer. 19 | 4. Adjust any controls such as Volume or Start Position. 20 | 5. Click Save and enjoy your music kit. 21 | 22 | # How it works 23 | CS-Jukebox works by using CS2's official GameState Integration 24 | to read data from the game such as round phases, bomb states, and teams. This method is safe and will not cause any VAC bans. 25 | 26 | Credit to [rakijah](https://github.com/rakijah) for creating [CSGSI](https://github.com/rakijah/CSGSI) & TimosCodd (https://github.com/TimosCodd) for porting over to CS2. 27 | -------------------------------------------------------------------------------- /sampleicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zzhabib/CS-Jukebox/b4d1c9452c5c6be5148a848613277cd0c27129e8/sampleicon.ico --------------------------------------------------------------------------------