├── .gitignore ├── BDSNetRunner.sln ├── BDSNetRunner ├── BDS.hpp ├── BDSNetRunner.vcxproj ├── BDSNetRunner.vcxproj.filters ├── BDSNetRunner.vcxproj.user ├── Component.h ├── Detours │ ├── include │ │ ├── detours.h │ │ ├── detver.h │ │ └── syelog.h │ └── lib.X64 │ │ ├── detours.lib │ │ └── syelog.lib ├── Events.h ├── GUI │ ├── SimpleForm.cpp │ └── SimpleForm.h ├── MCBDS插件开发助手.zip ├── RVAs.hpp ├── THook.h ├── commands │ └── commands.h ├── cpp.hint ├── dllmain.cpp ├── framework.h ├── json │ ├── include │ │ └── json │ │ │ ├── allocator.h │ │ │ ├── assertions.h │ │ │ ├── config.h │ │ │ ├── forwards.h │ │ │ ├── json.h │ │ │ ├── json_features.h │ │ │ ├── reader.h │ │ │ ├── value.h │ │ │ ├── version.h │ │ │ └── writer.h │ └── lib │ │ └── jsoncpp.lib ├── mod.cpp ├── mod.h ├── pch.cpp ├── pch.h ├── scoreboard │ ├── scoreboard.cpp │ └── scoreboard.hpp └── tick │ ├── tick.cpp │ └── tick.h ├── CSRDemo ├── BDS │ ├── Component.cs │ ├── Events.cs │ ├── MCCSAPI.cs │ └── Plugin.cs ├── C#插件开发指南.txt ├── CSRDemo.csproj ├── Hook.cs ├── Program.cs └── Properties │ └── AssemblyInfo.cs ├── LICENSE └── README.md /.gitignore: -------------------------------------------------------------------------------- 1 | 2 | # Created by https://www.toptal.com/developers/gitignore/api/visualstudio,csharp,c++ 3 | # Edit at https://www.toptal.com/developers/gitignore?templates=visualstudio,csharp,c++ 4 | 5 | ### C++ ### 6 | # Prerequisites 7 | *.d 8 | 9 | # Compiled Object files 10 | *.slo 11 | *.lo 12 | *.o 13 | *.obj 14 | 15 | # Precompiled Headers 16 | *.gch 17 | *.pch 18 | 19 | # Linker files 20 | *.ilk 21 | 22 | # Debugger Files 23 | *.pdb 24 | 25 | # Compiled Dynamic libraries 26 | *.so 27 | *.dylib 28 | *.dll 29 | 30 | # Fortran module files 31 | *.mod 32 | *.smod 33 | 34 | # Compiled Static libraries 35 | *.lai 36 | *.la 37 | *.a 38 | *.lib 39 | 40 | # Executables 41 | *.exe 42 | *.out 43 | *.app 44 | 45 | ### Csharp ### 46 | ## Ignore Visual Studio temporary files, build results, and 47 | ## files generated by popular Visual Studio add-ons. 48 | ## 49 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 50 | 51 | # User-specific files 52 | *.rsuser 53 | *.suo 54 | *.user 55 | *.userosscache 56 | *.sln.docstates 57 | 58 | # User-specific files (MonoDevelop/Xamarin Studio) 59 | *.userprefs 60 | 61 | # Mono auto generated files 62 | mono_crash.* 63 | 64 | # Build results 65 | [Dd]ebug/ 66 | [Dd]ebugPublic/ 67 | [Rr]elease/ 68 | [Rr]eleases/ 69 | x64/ 70 | x86/ 71 | [Aa][Rr][Mm]/ 72 | [Aa][Rr][Mm]64/ 73 | bld/ 74 | [Bb]in/ 75 | [Oo]bj/ 76 | [Ll]og/ 77 | [Ll]ogs/ 78 | 79 | # Visual Studio 2015/2017 cache/options directory 80 | .vs/ 81 | # Uncomment if you have tasks that create the project's static files in wwwroot 82 | #wwwroot/ 83 | 84 | # Visual Studio 2017 auto generated files 85 | Generated\ Files/ 86 | 87 | # MSTest test Results 88 | [Tt]est[Rr]esult*/ 89 | [Bb]uild[Ll]og.* 90 | 91 | # NUnit 92 | *.VisualState.xml 93 | TestResult.xml 94 | nunit-*.xml 95 | 96 | # Build Results of an ATL Project 97 | [Dd]ebugPS/ 98 | [Rr]eleasePS/ 99 | dlldata.c 100 | 101 | # Benchmark Results 102 | BenchmarkDotNet.Artifacts/ 103 | 104 | # .NET Core 105 | project.lock.json 106 | project.fragment.lock.json 107 | artifacts/ 108 | 109 | # StyleCop 110 | StyleCopReport.xml 111 | 112 | # Files built by Visual Studio 113 | *_i.c 114 | *_p.c 115 | *_h.h 116 | *.meta 117 | *.iobj 118 | *.ipdb 119 | *.pgc 120 | *.pgd 121 | *.rsp 122 | *.sbr 123 | *.tlb 124 | *.tli 125 | *.tlh 126 | *.tmp 127 | *.tmp_proj 128 | *_wpftmp.csproj 129 | *.log 130 | *.vspscc 131 | *.vssscc 132 | .builds 133 | *.pidb 134 | *.svclog 135 | *.scc 136 | 137 | # Chutzpah Test files 138 | _Chutzpah* 139 | 140 | # Visual C++ cache files 141 | ipch/ 142 | *.aps 143 | *.ncb 144 | *.opendb 145 | *.opensdf 146 | *.sdf 147 | *.cachefile 148 | *.VC.db 149 | *.VC.VC.opendb 150 | 151 | # Visual Studio profiler 152 | *.psess 153 | *.vsp 154 | *.vspx 155 | *.sap 156 | 157 | # Visual Studio Trace Files 158 | *.e2e 159 | 160 | # TFS 2012 Local Workspace 161 | $tf/ 162 | 163 | # Guidance Automation Toolkit 164 | *.gpState 165 | 166 | # ReSharper is a .NET coding add-in 167 | _ReSharper*/ 168 | *.[Rr]e[Ss]harper 169 | *.DotSettings.user 170 | 171 | # TeamCity is a build add-in 172 | _TeamCity* 173 | 174 | # DotCover is a Code Coverage Tool 175 | *.dotCover 176 | 177 | # AxoCover is a Code Coverage Tool 178 | .axoCover/* 179 | !.axoCover/settings.json 180 | 181 | # Coverlet is a free, cross platform Code Coverage Tool 182 | coverage*[.json, .xml, .info] 183 | 184 | # Visual Studio code coverage results 185 | *.coverage 186 | *.coveragexml 187 | 188 | # NCrunch 189 | _NCrunch_* 190 | .*crunch*.local.xml 191 | nCrunchTemp_* 192 | 193 | # MightyMoose 194 | *.mm.* 195 | AutoTest.Net/ 196 | 197 | # Web workbench (sass) 198 | .sass-cache/ 199 | 200 | # Installshield output folder 201 | [Ee]xpress/ 202 | 203 | # DocProject is a documentation generator add-in 204 | DocProject/buildhelp/ 205 | DocProject/Help/*.HxT 206 | DocProject/Help/*.HxC 207 | DocProject/Help/*.hhc 208 | DocProject/Help/*.hhk 209 | DocProject/Help/*.hhp 210 | DocProject/Help/Html2 211 | DocProject/Help/html 212 | 213 | # Click-Once directory 214 | publish/ 215 | 216 | # Publish Web Output 217 | *.[Pp]ublish.xml 218 | *.azurePubxml 219 | # Note: Comment the next line if you want to checkin your web deploy settings, 220 | # but database connection strings (with potential passwords) will be unencrypted 221 | *.pubxml 222 | *.publishproj 223 | 224 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 225 | # checkin your Azure Web App publish settings, but sensitive information contained 226 | # in these scripts will be unencrypted 227 | PublishScripts/ 228 | 229 | # NuGet Packages 230 | *.nupkg 231 | # NuGet Symbol Packages 232 | *.snupkg 233 | # The packages folder can be ignored because of Package Restore 234 | **/[Pp]ackages/* 235 | # except build/, which is used as an MSBuild target. 236 | !**/[Pp]ackages/build/ 237 | # Uncomment if necessary however generally it will be regenerated when needed 238 | #!**/[Pp]ackages/repositories.config 239 | # NuGet v3's project.json files produces more ignorable files 240 | *.nuget.props 241 | *.nuget.targets 242 | 243 | # Microsoft Azure Build Output 244 | csx/ 245 | *.build.csdef 246 | 247 | # Microsoft Azure Emulator 248 | ecf/ 249 | rcf/ 250 | 251 | # Windows Store app package directories and files 252 | AppPackages/ 253 | BundleArtifacts/ 254 | Package.StoreAssociation.xml 255 | _pkginfo.txt 256 | *.appx 257 | *.appxbundle 258 | *.appxupload 259 | 260 | # Visual Studio cache files 261 | # files ending in .cache can be ignored 262 | *.[Cc]ache 263 | # but keep track of directories ending in .cache 264 | !?*.[Cc]ache/ 265 | 266 | # Others 267 | ClientBin/ 268 | ~$* 269 | *~ 270 | *.dbmdl 271 | *.dbproj.schemaview 272 | *.jfm 273 | *.pfx 274 | *.publishsettings 275 | orleans.codegen.cs 276 | 277 | # Including strong name files can present a security risk 278 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 279 | #*.snk 280 | 281 | # Since there are multiple workflows, uncomment next line to ignore bower_components 282 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 283 | #bower_components/ 284 | 285 | # RIA/Silverlight projects 286 | Generated_Code/ 287 | 288 | # Backup & report files from converting an old project file 289 | # to a newer Visual Studio version. Backup files are not needed, 290 | # because we have git ;-) 291 | _UpgradeReport_Files/ 292 | Backup*/ 293 | UpgradeLog*.XML 294 | UpgradeLog*.htm 295 | ServiceFabricBackup/ 296 | *.rptproj.bak 297 | 298 | # SQL Server files 299 | *.mdf 300 | *.ldf 301 | *.ndf 302 | 303 | # Business Intelligence projects 304 | *.rdl.data 305 | *.bim.layout 306 | *.bim_*.settings 307 | *.rptproj.rsuser 308 | *- [Bb]ackup.rdl 309 | *- [Bb]ackup ([0-9]).rdl 310 | *- [Bb]ackup ([0-9][0-9]).rdl 311 | 312 | # Microsoft Fakes 313 | FakesAssemblies/ 314 | 315 | # GhostDoc plugin setting file 316 | *.GhostDoc.xml 317 | 318 | # Node.js Tools for Visual Studio 319 | .ntvs_analysis.dat 320 | node_modules/ 321 | 322 | # Visual Studio 6 build log 323 | *.plg 324 | 325 | # Visual Studio 6 workspace options file 326 | *.opt 327 | 328 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 329 | *.vbw 330 | 331 | # Visual Studio LightSwitch build output 332 | **/*.HTMLClient/GeneratedArtifacts 333 | **/*.DesktopClient/GeneratedArtifacts 334 | **/*.DesktopClient/ModelManifest.xml 335 | **/*.Server/GeneratedArtifacts 336 | **/*.Server/ModelManifest.xml 337 | _Pvt_Extensions 338 | 339 | # Paket dependency manager 340 | .paket/paket.exe 341 | paket-files/ 342 | 343 | # FAKE - F# Make 344 | .fake/ 345 | 346 | # CodeRush personal settings 347 | .cr/personal 348 | 349 | # Python Tools for Visual Studio (PTVS) 350 | __pycache__/ 351 | *.pyc 352 | 353 | # Cake - Uncomment if you are using it 354 | # tools/** 355 | # !tools/packages.config 356 | 357 | # Tabs Studio 358 | *.tss 359 | 360 | # Telerik's JustMock configuration file 361 | *.jmconfig 362 | 363 | # BizTalk build output 364 | *.btp.cs 365 | *.btm.cs 366 | *.odx.cs 367 | *.xsd.cs 368 | 369 | # OpenCover UI analysis results 370 | OpenCover/ 371 | 372 | # Azure Stream Analytics local run output 373 | ASALocalRun/ 374 | 375 | # MSBuild Binary and Structured Log 376 | *.binlog 377 | 378 | # NVidia Nsight GPU debugger configuration file 379 | *.nvuser 380 | 381 | # MFractors (Xamarin productivity tool) working folder 382 | .mfractor/ 383 | 384 | # Local History for Visual Studio 385 | .localhistory/ 386 | 387 | # BeatPulse healthcheck temp database 388 | healthchecksdb 389 | 390 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 391 | MigrationBackup/ 392 | 393 | # Ionide (cross platform F# VS Code tools) working folder 394 | .ionide/ 395 | 396 | ### VisualStudio ### 397 | 398 | # User-specific files 399 | 400 | # User-specific files (MonoDevelop/Xamarin Studio) 401 | 402 | # Mono auto generated files 403 | 404 | # Build results 405 | 406 | # Visual Studio 2015/2017 cache/options directory 407 | # Uncomment if you have tasks that create the project's static files in wwwroot 408 | 409 | # Visual Studio 2017 auto generated files 410 | 411 | # MSTest test Results 412 | 413 | # NUnit 414 | 415 | # Build Results of an ATL Project 416 | 417 | # Benchmark Results 418 | 419 | # .NET Core 420 | 421 | # StyleCop 422 | 423 | # Files built by Visual Studio 424 | 425 | # Chutzpah Test files 426 | 427 | # Visual C++ cache files 428 | 429 | # Visual Studio profiler 430 | 431 | # Visual Studio Trace Files 432 | 433 | # TFS 2012 Local Workspace 434 | 435 | # Guidance Automation Toolkit 436 | 437 | # ReSharper is a .NET coding add-in 438 | 439 | # TeamCity is a build add-in 440 | 441 | # DotCover is a Code Coverage Tool 442 | 443 | # AxoCover is a Code Coverage Tool 444 | 445 | # Coverlet is a free, cross platform Code Coverage Tool 446 | 447 | # Visual Studio code coverage results 448 | 449 | # NCrunch 450 | 451 | # MightyMoose 452 | 453 | # Web workbench (sass) 454 | 455 | # Installshield output folder 456 | 457 | # DocProject is a documentation generator add-in 458 | 459 | # Click-Once directory 460 | 461 | # Publish Web Output 462 | # Note: Comment the next line if you want to checkin your web deploy settings, 463 | # but database connection strings (with potential passwords) will be unencrypted 464 | 465 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 466 | # checkin your Azure Web App publish settings, but sensitive information contained 467 | # in these scripts will be unencrypted 468 | 469 | # NuGet Packages 470 | # NuGet Symbol Packages 471 | # The packages folder can be ignored because of Package Restore 472 | # except build/, which is used as an MSBuild target. 473 | # Uncomment if necessary however generally it will be regenerated when needed 474 | # NuGet v3's project.json files produces more ignorable files 475 | 476 | # Microsoft Azure Build Output 477 | 478 | # Microsoft Azure Emulator 479 | 480 | # Windows Store app package directories and files 481 | 482 | # Visual Studio cache files 483 | # files ending in .cache can be ignored 484 | # but keep track of directories ending in .cache 485 | 486 | # Others 487 | 488 | # Including strong name files can present a security risk 489 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 490 | 491 | # Since there are multiple workflows, uncomment next line to ignore bower_components 492 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 493 | 494 | # RIA/Silverlight projects 495 | 496 | # Backup & report files from converting an old project file 497 | # to a newer Visual Studio version. Backup files are not needed, 498 | # because we have git ;-) 499 | 500 | # SQL Server files 501 | 502 | # Business Intelligence projects 503 | 504 | # Microsoft Fakes 505 | 506 | # GhostDoc plugin setting file 507 | 508 | # Node.js Tools for Visual Studio 509 | 510 | # Visual Studio 6 build log 511 | 512 | # Visual Studio 6 workspace options file 513 | 514 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 515 | 516 | # Visual Studio LightSwitch build output 517 | 518 | # Paket dependency manager 519 | 520 | # FAKE - F# Make 521 | 522 | # CodeRush personal settings 523 | 524 | # Python Tools for Visual Studio (PTVS) 525 | 526 | # Cake - Uncomment if you are using it 527 | # tools/** 528 | # !tools/packages.config 529 | 530 | # Tabs Studio 531 | 532 | # Telerik's JustMock configuration file 533 | 534 | # BizTalk build output 535 | 536 | # OpenCover UI analysis results 537 | 538 | # Azure Stream Analytics local run output 539 | 540 | # MSBuild Binary and Structured Log 541 | 542 | # NVidia Nsight GPU debugger configuration file 543 | 544 | # MFractors (Xamarin productivity tool) working folder 545 | 546 | # Local History for Visual Studio 547 | 548 | # BeatPulse healthcheck temp database 549 | 550 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 551 | 552 | # Ionide (cross platform F# VS Code tools) working folder 553 | 554 | # End of https://www.toptal.com/developers/gitignore/api/visualstudio,csharp,c++ 555 | -------------------------------------------------------------------------------- /BDSNetRunner.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 16 4 | VisualStudioVersion = 16.0.30225.117 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "BDSNetRunner", "BDSNetRunner\BDSNetRunner.vcxproj", "{7A346829-4514-4FD0-ADD1-DBBA49C4EE96}" 7 | EndProject 8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CSRDemo", "CSRDemo\CSRDemo.csproj", "{95E4503B-BF15-499B-B5B2-FC0F3E425A3E}" 9 | EndProject 10 | Global 11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 12 | Debug|Any CPU = Debug|Any CPU 13 | Debug|x64 = Debug|x64 14 | Debug|x86 = Debug|x86 15 | Release|Any CPU = Release|Any CPU 16 | Release|x64 = Release|x64 17 | Release|x86 = Release|x86 18 | EndGlobalSection 19 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 20 | {7A346829-4514-4FD0-ADD1-DBBA49C4EE96}.Debug|Any CPU.ActiveCfg = Debug|Win32 21 | {7A346829-4514-4FD0-ADD1-DBBA49C4EE96}.Debug|x64.ActiveCfg = Debug|x64 22 | {7A346829-4514-4FD0-ADD1-DBBA49C4EE96}.Debug|x64.Build.0 = Debug|x64 23 | {7A346829-4514-4FD0-ADD1-DBBA49C4EE96}.Debug|x86.ActiveCfg = Debug|Win32 24 | {7A346829-4514-4FD0-ADD1-DBBA49C4EE96}.Debug|x86.Build.0 = Debug|Win32 25 | {7A346829-4514-4FD0-ADD1-DBBA49C4EE96}.Release|Any CPU.ActiveCfg = Release|Win32 26 | {7A346829-4514-4FD0-ADD1-DBBA49C4EE96}.Release|x64.ActiveCfg = Release|x64 27 | {7A346829-4514-4FD0-ADD1-DBBA49C4EE96}.Release|x64.Build.0 = Release|x64 28 | {7A346829-4514-4FD0-ADD1-DBBA49C4EE96}.Release|x86.ActiveCfg = Release|Win32 29 | {7A346829-4514-4FD0-ADD1-DBBA49C4EE96}.Release|x86.Build.0 = Release|Win32 30 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 31 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Debug|Any CPU.Build.0 = Debug|Any CPU 32 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Debug|x64.ActiveCfg = Debug|Any CPU 33 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Debug|x64.Build.0 = Debug|Any CPU 34 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Debug|x86.ActiveCfg = Debug|Any CPU 35 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Debug|x86.Build.0 = Debug|Any CPU 36 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Release|Any CPU.ActiveCfg = Release|Any CPU 37 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Release|Any CPU.Build.0 = Release|Any CPU 38 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Release|x64.ActiveCfg = Release|Any CPU 39 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Release|x64.Build.0 = Release|Any CPU 40 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Release|x86.ActiveCfg = Release|Any CPU 41 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E}.Release|x86.Build.0 = Release|Any CPU 42 | EndGlobalSection 43 | GlobalSection(SolutionProperties) = preSolution 44 | HideSolutionNode = FALSE 45 | EndGlobalSection 46 | GlobalSection(ExtensibilityGlobals) = postSolution 47 | SolutionGuid = {E05E92C7-EFFD-4264-98EA-5203A3375294} 48 | EndGlobalSection 49 | EndGlobal 50 | -------------------------------------------------------------------------------- /BDSNetRunner/BDS.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/BDS.hpp -------------------------------------------------------------------------------- /BDSNetRunner/BDSNetRunner.vcxproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | Win32 7 | 8 | 9 | Release 10 | Win32 11 | 12 | 13 | Debug 14 | x64 15 | 16 | 17 | Release 18 | x64 19 | 20 | 21 | 22 | 16.0 23 | Win32Proj 24 | {7a346829-4514-4fd0-add1-dbba49c4ee96} 25 | NetHookDemo 26 | 10.0 27 | 28 | 29 | 30 | DynamicLibrary 31 | true 32 | v142 33 | Unicode 34 | 35 | 36 | DynamicLibrary 37 | false 38 | v142 39 | true 40 | Unicode 41 | 42 | 43 | DynamicLibrary 44 | true 45 | v142 46 | Unicode 47 | 48 | 49 | DynamicLibrary 50 | false 51 | v142 52 | true 53 | Unicode 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 62 | 63 | 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | true 75 | 76 | 77 | false 78 | 79 | 80 | true 81 | .\libcurl\include;$(IncludePath) 82 | 83 | 84 | false 85 | .\json\include;$(IncludePath) 86 | 87 | 88 | 89 | Level3 90 | true 91 | WIN32;_DEBUG;NETHOOKDEMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 92 | true 93 | Use 94 | pch.h 95 | 96 | 97 | Windows 98 | true 99 | false 100 | 101 | 102 | 103 | 104 | Level3 105 | true 106 | true 107 | true 108 | WIN32;NDEBUG;NETHOOKDEMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 109 | true 110 | Use 111 | pch.h 112 | 113 | 114 | Windows 115 | true 116 | true 117 | true 118 | false 119 | 120 | 121 | 122 | 123 | Level3 124 | true 125 | _DEBUG;NETHOOKDEMO_EXPORTS;_WINDOWS;_USRDLL;%(PreprocessorDefinitions) 126 | true 127 | NotUsing 128 | pch.h 129 | 130 | 131 | Windows 132 | true 133 | false 134 | 135 | 136 | 137 | 138 | Level3 139 | true 140 | true 141 | true 142 | NDEBUG;NETHOOKDEMO_EXPORTS;_WINDOWS;_USRDLL;BUILDING_LIBCURL;%(PreprocessorDefinitions) 143 | true 144 | NotUsing 145 | pch.h 146 | MultiThreaded 147 | CompileAsCpp 148 | 149 | 150 | Windows 151 | true 152 | true 153 | true 154 | false 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 164 | 165 | 166 | 167 | 168 | 169 | 170 | 171 | 172 | 173 | 174 | 175 | 176 | Create 177 | Create 178 | Create 179 | Create 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | -------------------------------------------------------------------------------- /BDSNetRunner/BDSNetRunner.vcxproj.filters: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | {4FC737F1-C7A5-4376-A066-2A32D752A2FF} 6 | cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx 7 | 8 | 9 | {93995380-89BD-4b04-88EB-625FBE52EBFB} 10 | h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd 11 | 12 | 13 | {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} 14 | rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms 15 | 16 | 17 | {3c1bfc7e-9739-497e-b8cb-025341b1a393} 18 | 19 | 20 | {d1b33610-4943-45c9-9df6-065d0f961943} 21 | 22 | 23 | {4be85fce-a02a-4867-8761-7c3d9dee9d37} 24 | 25 | 26 | {e3443547-d4e7-432c-bf96-1973e43f4a80} 27 | 28 | 29 | {4955dd28-1b51-4530-9b5c-3a704d510fe1} 30 | 31 | 32 | 33 | 34 | 头文件 35 | 36 | 37 | 头文件 38 | 39 | 40 | 头文件 41 | 42 | 43 | 头文件 44 | 45 | 46 | 头文件 47 | 48 | 49 | 头文件 50 | 51 | 52 | 头文件 53 | 54 | 55 | GUI 56 | 57 | 58 | commands 59 | 60 | 61 | tick 62 | 63 | 64 | scoreboard 65 | 66 | 67 | 头文件 68 | 69 | 70 | 71 | 72 | 源文件 73 | 74 | 75 | 源文件 76 | 77 | 78 | 源文件 79 | 80 | 81 | GUI 82 | 83 | 84 | tick 85 | 86 | 87 | scoreboard 88 | 89 | 90 | 91 | 92 | 93 | 符号工具 94 | 95 | 96 | -------------------------------------------------------------------------------- /BDSNetRunner/BDSNetRunner.vcxproj.user: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | -------------------------------------------------------------------------------- /BDSNetRunner/Component.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/Component.h -------------------------------------------------------------------------------- /BDSNetRunner/Detours/include/detver.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Common version parameters. 4 | // 5 | // Microsoft Research Detours Package, Version 4.0.1 6 | // 7 | // Copyright (c) Microsoft Corporation. All rights reserved. 8 | // 9 | 10 | #define _USING_V110_SDK71_ 1 11 | #include "winver.h" 12 | #if 0 13 | #include 14 | #include 15 | #else 16 | #ifndef DETOURS_STRINGIFY 17 | #define DETOURS_STRINGIFY(x) DETOURS_STRINGIFY_(x) 18 | #define DETOURS_STRINGIFY_(x) #x 19 | #endif 20 | 21 | #define VER_FILEFLAGSMASK 0x3fL 22 | #define VER_FILEFLAGS 0x0L 23 | #define VER_FILEOS 0x00040004L 24 | #define VER_FILETYPE 0x00000002L 25 | #define VER_FILESUBTYPE 0x00000000L 26 | #endif 27 | #define VER_DETOURS_BITS DETOUR_STRINGIFY(DETOURS_BITS) 28 | -------------------------------------------------------------------------------- /BDSNetRunner/Detours/include/syelog.h: -------------------------------------------------------------------------------- 1 | ////////////////////////////////////////////////////////////////////////////// 2 | // 3 | // Detours Test Program (syelog.h of syelog.lib) 4 | // 5 | // Microsoft Research Detours Package 6 | // 7 | // Copyright (c) Microsoft Corporation. All rights reserved. 8 | // 9 | #pragma once 10 | #ifndef _SYELOGD_H_ 11 | #define _SYELOGD_H_ 12 | #include 13 | 14 | #pragma pack(push, 1) 15 | #pragma warning(push) 16 | #pragma warning(disable: 4200) 17 | 18 | ////////////////////////////////////////////////////////////////////////////// 19 | // 20 | // 21 | #define SYELOG_PIPE_NAMEA "\\\\.\\pipe\\syelog" 22 | #define SYELOG_PIPE_NAMEW L"\\\\.\\pipe\\syelog" 23 | #ifdef UNICODE 24 | #define SYELOG_PIPE_NAME SYELOG_PIPE_NAMEW 25 | #else 26 | #define SYELOG_PIPE_NAME SYELOG_PIPE_NAMEA 27 | #endif 28 | 29 | ////////////////////////////////////////////////////////////////////////////// 30 | // 31 | #define SYELOG_MAXIMUM_MESSAGE 4086 // 4096 - sizeof(header stuff) 32 | 33 | typedef struct _SYELOG_MESSAGE 34 | { 35 | USHORT nBytes; 36 | BYTE nFacility; 37 | BYTE nSeverity; 38 | DWORD nProcessId; 39 | FILETIME ftOccurance; 40 | BOOL fTerminate; 41 | CHAR szMessage[SYELOG_MAXIMUM_MESSAGE]; 42 | } SYELOG_MESSAGE, *PSYELOG_MESSAGE; 43 | 44 | 45 | // Facility Codes. 46 | // 47 | #define SYELOG_FACILITY_KERNEL 0x10 // OS Kernel 48 | #define SYELOG_FACILITY_SECURITY 0x20 // OS Security 49 | #define SYELOG_FACILITY_LOGGING 0x30 // OS Logging-internal 50 | #define SYELOG_FACILITY_SERVICE 0x40 // User-mode system daemon 51 | #define SYELOG_FACILITY_APPLICATION 0x50 // User-mode application 52 | #define SYELOG_FACILITY_USER 0x60 // User self-generated. 53 | #define SYELOG_FACILITY_LOCAL0 0x70 // Locally defined. 54 | #define SYELOG_FACILITY_LOCAL1 0x71 // Locally defined. 55 | #define SYELOG_FACILITY_LOCAL2 0x72 // Locally defined. 56 | #define SYELOG_FACILITY_LOCAL3 0x73 // Locally defined. 57 | #define SYELOG_FACILITY_LOCAL4 0x74 // Locally defined. 58 | #define SYELOG_FACILITY_LOCAL5 0x75 // Locally defined. 59 | #define SYELOG_FACILITY_LOCAL6 0x76 // Locally defined. 60 | #define SYELOG_FACILITY_LOCAL7 0x77 // Locally defined. 61 | #define SYELOG_FACILITY_LOCAL8 0x78 // Locally defined. 62 | #define SYELOG_FACILITY_LOCAL9 0x79 // Locally defined. 63 | 64 | // Severity Codes. 65 | // 66 | #define SYELOG_SEVERITY_FATAL 0x00 // System is dead. 67 | #define SYELOG_SEVERITY_ALERT 0x10 // Take action immediately. 68 | #define SYELOG_SEVERITY_CRITICAL 0x20 // Critical condition. 69 | #define SYELOG_SEVERITY_ERROR 0x30 // Error 70 | #define SYELOG_SEVERITY_WARNING 0x40 // Warning 71 | #define SYELOG_SEVERITY_NOTICE 0x50 // Significant condition. 72 | #define SYELOG_SEVERITY_INFORMATION 0x60 // Informational 73 | #define SYELOG_SEVERITY_AUDIT_FAIL 0x66 // Audit Failed 74 | #define SYELOG_SEVERITY_AUDIT_PASS 0x67 // Audit Succeeeded 75 | #define SYELOG_SEVERITY_DEBUG 0x70 // Debugging 76 | 77 | // Logging Functions. 78 | // 79 | VOID SyelogOpen(PCSTR pszIdentifier, BYTE nFacility); 80 | VOID Syelog(BYTE nSeverity, PCSTR pszMsgf, ...); 81 | VOID SyelogV(BYTE nSeverity, PCSTR pszMsgf, va_list args); 82 | VOID SyelogClose(BOOL fTerminate); 83 | 84 | #pragma warning(pop) 85 | #pragma pack(pop) 86 | 87 | #endif // _SYELOGD_H_ 88 | // 89 | ///////////////////////////////////////////////////////////////// End of File. 90 | -------------------------------------------------------------------------------- /BDSNetRunner/Detours/lib.X64/detours.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/Detours/lib.X64/detours.lib -------------------------------------------------------------------------------- /BDSNetRunner/Detours/lib.X64/syelog.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/Detours/lib.X64/syelog.lib -------------------------------------------------------------------------------- /BDSNetRunner/Events.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/Events.h -------------------------------------------------------------------------------- /BDSNetRunner/GUI/SimpleForm.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | std::string createSimpleFormString(std::string title, std::string content, Json::Value & bttxts) { 5 | Json::Value jv; 6 | jv["type"] = "form"; 7 | jv["title"] = title; 8 | jv["content"] = content; 9 | jv["buttons"] = bttxts; 10 | return jv.toStyledString(); 11 | } 12 | 13 | std::string createModalFormString(std::string title, std::string content, std::string button1, std::string button2) { 14 | Json::Value jv; 15 | jv["type"] = "modal"; 16 | jv["title"] = title; 17 | jv["content"] = content; 18 | jv["button1"] = button1; 19 | jv["button2"] = button2; 20 | return jv.toStyledString(); 21 | } 22 | -------------------------------------------------------------------------------- /BDSNetRunner/GUI/SimpleForm.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/GUI/SimpleForm.h -------------------------------------------------------------------------------- /BDSNetRunner/MCBDS插件开发助手.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/MCBDS插件开发助手.zip -------------------------------------------------------------------------------- /BDSNetRunner/RVAs.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/RVAs.hpp -------------------------------------------------------------------------------- /BDSNetRunner/THook.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/THook.h -------------------------------------------------------------------------------- /BDSNetRunner/commands/commands.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | enum class OriginType : char { 6 | Player = 0, 7 | Block = 1, 8 | MinecartBlock = 2, 9 | DevConsole = 3, 10 | Test = 4, 11 | AutomationPlayer = 5, 12 | ClientAutomation = 6, 13 | DedicatedServer = 7, 14 | Actor = 8, 15 | Virtual = 9, 16 | GameArgument = 10, 17 | ActorServer = 11 18 | }; 19 | 20 | class CommandOrigin { 21 | public: 22 | CommandOrigin(CommandOrigin const&) = delete; 23 | virtual ~CommandOrigin() = 0; 24 | virtual std::string& getRequestId() const = 0; 25 | virtual std::string getName() const = 0; 26 | virtual Vec3* getBlockPosition(Vec3*) const = 0; 27 | virtual Vec3 getWorldPosition() const = 0; 28 | virtual VA getLevel() const = 0; // Level* getLevel() const 29 | virtual Dimension* getDimension() const = 0; 30 | virtual Actor* getEntity() const = 0; 31 | virtual VA getPermissionsLevel() const = 0; // enum CommandPermissionLevel getPermissionsLevel() const 32 | virtual std::unique_ptr clone() const = 0; 33 | virtual bool unk1() const = 0; 34 | virtual bool unk2() const = 0; 35 | virtual bool hasChatPerms() const = 0; 36 | virtual bool hasTellPerms() const = 0; 37 | virtual bool canUseAbility(VA) const = 0; // bool canUseAbility(AbilitiesIndex) const 38 | virtual bool isWorldBuilder() const = 0; 39 | virtual bool canUseCommandsWithoutCheatsEnabled() const = 0; 40 | virtual bool isSelectorExpansionAllowed() const = 0; 41 | virtual VA getSourceId_net() const = 0; // NetworkIdentifier getSourceId_net() const 42 | virtual char getSourceSubId() const = 0; 43 | virtual CommandOrigin* getOutputReceiver() const = 0; 44 | virtual OriginType getOriginType() const = 0; 45 | virtual void toCommandOriginData_stub() const = 0; 46 | virtual VA const& getUUID() const = 0; // mce::UUID const& getUUID() const 47 | virtual void handleCommandOutputCallback_stub(void*) = 0; 48 | virtual void _setUUID(VA const&) = 0; // void _setUUID(mce::UUID const&) 49 | }; 50 | 51 | class CommandContext { 52 | public: 53 | std::string CMD; 54 | CommandOrigin* Ori; 55 | int Version = 10; 56 | std::string& getCmd() { 57 | return CMD; 58 | } 59 | class CommandOrigin& getOrigin() { 60 | return *Ori; 61 | } 62 | }; -------------------------------------------------------------------------------- /BDSNetRunner/cpp.hint: -------------------------------------------------------------------------------- 1 | // 提示文件帮助 Visual Studio IDE 解释 Visual C++ 标识符, 2 | // 如函数和宏的名称。 3 | // 有关详细信息,请参见 https://go.microsoft.com/fwlink/?linkid=865984 4 | #define MCCSAPI __declspec (dllexport) 5 | -------------------------------------------------------------------------------- /BDSNetRunner/dllmain.cpp: -------------------------------------------------------------------------------- 1 | // dllmain.cpp : 定义 DLL 应用程序的入口点。 2 | #include "pch.h" 3 | 4 | #pragma comment(lib, "./Detours/lib.X64/detours.lib") 5 | #pragma comment(lib, "./json/lib/jsoncpp.lib") 6 | #pragma comment ( lib, "ws2_32.lib") 7 | #pragma comment ( lib, "wldap32.lib") 8 | #pragma comment ( lib, "Crypt32.lib") 9 | #pragma comment ( lib, "Normaliz.lib") 10 | 11 | #include "mod.h" 12 | 13 | 14 | 15 | BOOL APIENTRY DllMain( HMODULE hModule, 16 | DWORD ul_reason_for_call, 17 | LPVOID lpReserved 18 | ) 19 | { 20 | switch (ul_reason_for_call) 21 | { 22 | case DLL_PROCESS_ATTACH: 23 | init(); 24 | break; 25 | case DLL_THREAD_ATTACH: 26 | case DLL_THREAD_DETACH: 27 | break; 28 | case DLL_PROCESS_DETACH: 29 | exit(); 30 | break; 31 | } 32 | return TRUE; 33 | } 34 | 35 | -------------------------------------------------------------------------------- /BDSNetRunner/framework.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define WIN32_LEAN_AND_MEAN // 从 Windows 头文件中排除极少使用的内容 4 | // Windows 头文件 5 | #include 6 | -------------------------------------------------------------------------------- /BDSNetRunner/json/include/json/allocator.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_ALLOCATOR_H_INCLUDED 7 | #define JSON_ALLOCATOR_H_INCLUDED 8 | 9 | #include 10 | #include 11 | 12 | #pragma pack(push, 8) 13 | 14 | namespace Json { 15 | template class SecureAllocator { 16 | public: 17 | // Type definitions 18 | using value_type = T; 19 | using pointer = T*; 20 | using const_pointer = const T*; 21 | using reference = T&; 22 | using const_reference = const T&; 23 | using size_type = std::size_t; 24 | using difference_type = std::ptrdiff_t; 25 | 26 | /** 27 | * Allocate memory for N items using the standard allocator. 28 | */ 29 | pointer allocate(size_type n) { 30 | // allocate using "global operator new" 31 | return static_cast(::operator new(n * sizeof(T))); 32 | } 33 | 34 | /** 35 | * Release memory which was allocated for N items at pointer P. 36 | * 37 | * The memory block is filled with zeroes before being released. 38 | * The pointer argument is tagged as "volatile" to prevent the 39 | * compiler optimizing out this critical step. 40 | */ 41 | void deallocate(volatile pointer p, size_type n) { 42 | std::memset(p, 0, n * sizeof(T)); 43 | // free using "global operator delete" 44 | ::operator delete(p); 45 | } 46 | 47 | /** 48 | * Construct an item in-place at pointer P. 49 | */ 50 | template void construct(pointer p, Args&&... args) { 51 | // construct using "placement new" and "perfect forwarding" 52 | ::new (static_cast(p)) T(std::forward(args)...); 53 | } 54 | 55 | size_type max_size() const { return size_t(-1) / sizeof(T); } 56 | 57 | pointer address(reference x) const { return std::addressof(x); } 58 | 59 | const_pointer address(const_reference x) const { return std::addressof(x); } 60 | 61 | /** 62 | * Destroy an item in-place at pointer P. 63 | */ 64 | void destroy(pointer p) { 65 | // destroy using "explicit destructor" 66 | p->~T(); 67 | } 68 | 69 | // Boilerplate 70 | SecureAllocator() {} 71 | template SecureAllocator(const SecureAllocator&) {} 72 | template struct rebind { using other = SecureAllocator; }; 73 | }; 74 | 75 | template 76 | bool operator==(const SecureAllocator&, const SecureAllocator&) { 77 | return true; 78 | } 79 | 80 | template 81 | bool operator!=(const SecureAllocator&, const SecureAllocator&) { 82 | return false; 83 | } 84 | 85 | } // namespace Json 86 | 87 | #pragma pack(pop) 88 | 89 | #endif // JSON_ALLOCATOR_H_INCLUDED 90 | -------------------------------------------------------------------------------- /BDSNetRunner/json/include/json/assertions.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_ASSERTIONS_H_INCLUDED 7 | #define JSON_ASSERTIONS_H_INCLUDED 8 | 9 | #include 10 | #include 11 | 12 | #if !defined(JSON_IS_AMALGAMATION) 13 | #include "config.h" 14 | #endif // if !defined(JSON_IS_AMALGAMATION) 15 | 16 | /** It should not be possible for a maliciously designed file to 17 | * cause an abort() or seg-fault, so these macros are used only 18 | * for pre-condition violations and internal logic errors. 19 | */ 20 | #if JSON_USE_EXCEPTION 21 | 22 | // @todo <= add detail about condition in exception 23 | #define JSON_ASSERT(condition) \ 24 | { \ 25 | if (!(condition)) { \ 26 | Json::throwLogicError("assert json failed"); \ 27 | } \ 28 | } 29 | 30 | #define JSON_FAIL_MESSAGE(message) \ 31 | { \ 32 | OStringStream oss; \ 33 | oss << message; \ 34 | Json::throwLogicError(oss.str()); \ 35 | abort(); \ 36 | } 37 | 38 | #else // JSON_USE_EXCEPTION 39 | 40 | #define JSON_ASSERT(condition) assert(condition) 41 | 42 | // The call to assert() will show the failure message in debug builds. In 43 | // release builds we abort, for a core-dump or debugger. 44 | #define JSON_FAIL_MESSAGE(message) \ 45 | { \ 46 | OStringStream oss; \ 47 | oss << message; \ 48 | assert(false && oss.str().c_str()); \ 49 | abort(); \ 50 | } 51 | 52 | #endif 53 | 54 | #define JSON_ASSERT_MESSAGE(condition, message) \ 55 | if (!(condition)) { \ 56 | JSON_FAIL_MESSAGE(message); \ 57 | } 58 | 59 | #endif // JSON_ASSERTIONS_H_INCLUDED 60 | -------------------------------------------------------------------------------- /BDSNetRunner/json/include/json/config.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_CONFIG_H_INCLUDED 7 | #define JSON_CONFIG_H_INCLUDED 8 | #include 9 | #include 10 | #include 11 | #include 12 | #include 13 | #include 14 | #include 15 | #include 16 | 17 | // If non-zero, the library uses exceptions to report bad input instead of C 18 | // assertion macros. The default is to use exceptions. 19 | #ifndef JSON_USE_EXCEPTION 20 | #define JSON_USE_EXCEPTION 1 21 | #endif 22 | 23 | // Temporary, tracked for removal with issue #982. 24 | #ifndef JSON_USE_NULLREF 25 | #define JSON_USE_NULLREF 1 26 | #endif 27 | 28 | /// If defined, indicates that the source file is amalgamated 29 | /// to prevent private header inclusion. 30 | /// Remarks: it is automatically defined in the generated amalgamated header. 31 | // #define JSON_IS_AMALGAMATION 32 | 33 | // Export macros for DLL visibility 34 | #if defined(JSON_DLL_BUILD) 35 | #if defined(_MSC_VER) || defined(__MINGW32__) 36 | #define JSON_API __declspec(dllexport) 37 | #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING 38 | #elif defined(__GNUC__) || defined(__clang__) 39 | #define JSON_API __attribute__((visibility("default"))) 40 | #endif // if defined(_MSC_VER) 41 | 42 | #elif defined(JSON_DLL) 43 | #if defined(_MSC_VER) || defined(__MINGW32__) 44 | #define JSON_API __declspec(dllimport) 45 | #define JSONCPP_DISABLE_DLL_INTERFACE_WARNING 46 | #endif // if defined(_MSC_VER) 47 | #endif // ifdef JSON_DLL_BUILD 48 | 49 | #if !defined(JSON_API) 50 | #define JSON_API 51 | #endif 52 | 53 | #if defined(_MSC_VER) && _MSC_VER < 1800 54 | #error \ 55 | "ERROR: Visual Studio 12 (2013) with _MSC_VER=1800 is the oldest supported compiler with sufficient C++11 capabilities" 56 | #endif 57 | 58 | #if defined(_MSC_VER) && _MSC_VER < 1900 59 | // As recommended at 60 | // https://stackoverflow.com/questions/2915672/snprintf-and-visual-studio-2010 61 | extern JSON_API int msvc_pre1900_c99_snprintf(char* outBuf, size_t size, 62 | const char* format, ...); 63 | #define jsoncpp_snprintf msvc_pre1900_c99_snprintf 64 | #else 65 | #define jsoncpp_snprintf std::snprintf 66 | #endif 67 | 68 | // If JSON_NO_INT64 is defined, then Json only support C++ "int" type for 69 | // integer 70 | // Storages, and 64 bits integer support is disabled. 71 | // #define JSON_NO_INT64 1 72 | 73 | // JSONCPP_OVERRIDE is maintained for backwards compatibility of external tools. 74 | // C++11 should be used directly in JSONCPP. 75 | #define JSONCPP_OVERRIDE override 76 | 77 | #if __cplusplus >= 201103L 78 | #define JSONCPP_NOEXCEPT noexcept 79 | #define JSONCPP_OP_EXPLICIT explicit 80 | #elif defined(_MSC_VER) && _MSC_VER < 1900 81 | #define JSONCPP_NOEXCEPT throw() 82 | #define JSONCPP_OP_EXPLICIT explicit 83 | #elif defined(_MSC_VER) && _MSC_VER >= 1900 84 | #define JSONCPP_NOEXCEPT noexcept 85 | #define JSONCPP_OP_EXPLICIT explicit 86 | #else 87 | #define JSONCPP_NOEXCEPT throw() 88 | #define JSONCPP_OP_EXPLICIT 89 | #endif 90 | 91 | #ifdef __clang__ 92 | #if __has_extension(attribute_deprecated_with_message) 93 | #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message))) 94 | #endif 95 | #elif defined(__GNUC__) // not clang (gcc comes later since clang emulates gcc) 96 | #if (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 5)) 97 | #define JSONCPP_DEPRECATED(message) __attribute__((deprecated(message))) 98 | #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) 99 | #define JSONCPP_DEPRECATED(message) __attribute__((__deprecated__)) 100 | #endif // GNUC version 101 | #elif defined(_MSC_VER) // MSVC (after clang because clang on Windows emulates 102 | // MSVC) 103 | #define JSONCPP_DEPRECATED(message) __declspec(deprecated(message)) 104 | #endif // __clang__ || __GNUC__ || _MSC_VER 105 | 106 | #if !defined(JSONCPP_DEPRECATED) 107 | #define JSONCPP_DEPRECATED(message) 108 | #endif // if !defined(JSONCPP_DEPRECATED) 109 | 110 | #if defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 6)) 111 | #define JSON_USE_INT64_DOUBLE_CONVERSION 1 112 | #endif 113 | 114 | #if !defined(JSON_IS_AMALGAMATION) 115 | 116 | #include "allocator.h" 117 | #include "version.h" 118 | 119 | #endif // if !defined(JSON_IS_AMALGAMATION) 120 | 121 | namespace Json { 122 | using Int = int; 123 | using UInt = unsigned int; 124 | #if defined(JSON_NO_INT64) 125 | using LargestInt = int; 126 | using LargestUInt = unsigned int; 127 | #undef JSON_HAS_INT64 128 | #else // if defined(JSON_NO_INT64) 129 | // For Microsoft Visual use specific types as long long is not supported 130 | #if defined(_MSC_VER) // Microsoft Visual Studio 131 | using Int64 = __int64; 132 | using UInt64 = unsigned __int64; 133 | #else // if defined(_MSC_VER) // Other platforms, use long long 134 | using Int64 = int64_t; 135 | using UInt64 = uint64_t; 136 | #endif // if defined(_MSC_VER) 137 | using LargestInt = Int64; 138 | using LargestUInt = UInt64; 139 | #define JSON_HAS_INT64 140 | #endif // if defined(JSON_NO_INT64) 141 | 142 | template 143 | using Allocator = 144 | typename std::conditional, 145 | std::allocator>::type; 146 | using String = std::basic_string, Allocator>; 147 | using IStringStream = 148 | std::basic_istringstream; 150 | using OStringStream = 151 | std::basic_ostringstream; 153 | using IStream = std::istream; 154 | using OStream = std::ostream; 155 | } // namespace Json 156 | 157 | // Legacy names (formerly macros). 158 | using JSONCPP_STRING = Json::String; 159 | using JSONCPP_ISTRINGSTREAM = Json::IStringStream; 160 | using JSONCPP_OSTRINGSTREAM = Json::OStringStream; 161 | using JSONCPP_ISTREAM = Json::IStream; 162 | using JSONCPP_OSTREAM = Json::OStream; 163 | 164 | #endif // JSON_CONFIG_H_INCLUDED 165 | -------------------------------------------------------------------------------- /BDSNetRunner/json/include/json/forwards.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_FORWARDS_H_INCLUDED 7 | #define JSON_FORWARDS_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "config.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | 13 | namespace Json { 14 | 15 | // writer.h 16 | class StreamWriter; 17 | class StreamWriterBuilder; 18 | class Writer; 19 | class FastWriter; 20 | class StyledWriter; 21 | class StyledStreamWriter; 22 | 23 | // reader.h 24 | class Reader; 25 | class CharReader; 26 | class CharReaderBuilder; 27 | 28 | // json_features.h 29 | class Features; 30 | 31 | // value.h 32 | using ArrayIndex = unsigned int; 33 | class StaticString; 34 | class Path; 35 | class PathArgument; 36 | class Value; 37 | class ValueIteratorBase; 38 | class ValueIterator; 39 | class ValueConstIterator; 40 | 41 | } // namespace Json 42 | 43 | #endif // JSON_FORWARDS_H_INCLUDED 44 | -------------------------------------------------------------------------------- /BDSNetRunner/json/include/json/json.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_JSON_H_INCLUDED 7 | #define JSON_JSON_H_INCLUDED 8 | 9 | #include "config.h" 10 | #include "json_features.h" 11 | #include "reader.h" 12 | #include "value.h" 13 | #include "writer.h" 14 | 15 | #endif // JSON_JSON_H_INCLUDED 16 | -------------------------------------------------------------------------------- /BDSNetRunner/json/include/json/json_features.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_FEATURES_H_INCLUDED 7 | #define JSON_FEATURES_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "forwards.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | 13 | #pragma pack(push, 8) 14 | 15 | namespace Json { 16 | 17 | /** \brief Configuration passed to reader and writer. 18 | * This configuration object can be used to force the Reader or Writer 19 | * to behave in a standard conforming way. 20 | */ 21 | class JSON_API Features { 22 | public: 23 | /** \brief A configuration that allows all features and assumes all strings 24 | * are UTF-8. 25 | * - C & C++ comments are allowed 26 | * - Trailing commas in objects and arrays are allowed. 27 | * - Root object can be any JSON value 28 | * - Assumes Value strings are encoded in UTF-8 29 | */ 30 | static Features all(); 31 | 32 | /** \brief A configuration that is strictly compatible with the JSON 33 | * specification. 34 | * - Comments are forbidden. 35 | * - Trailing commas in objects and arrays are forbidden. 36 | * - Root object must be either an array or an object value. 37 | * - Assumes Value strings are encoded in UTF-8 38 | */ 39 | static Features strictMode(); 40 | 41 | /** \brief Initialize the configuration like JsonConfig::allFeatures; 42 | */ 43 | Features(); 44 | 45 | /// \c true if comments are allowed. Default: \c true. 46 | bool allowComments_{true}; 47 | 48 | /// \c true if trailing commas in objects and arrays are allowed. Default \c 49 | /// true. 50 | bool allowTrailingCommas_{true}; 51 | 52 | /// \c true if root must be either an array or an object value. Default: \c 53 | /// false. 54 | bool strictRoot_{false}; 55 | 56 | /// \c true if dropped null placeholders are allowed. Default: \c false. 57 | bool allowDroppedNullPlaceholders_{false}; 58 | 59 | /// \c true if numeric object key are allowed. Default: \c false. 60 | bool allowNumericKeys_{false}; 61 | }; 62 | 63 | } // namespace Json 64 | 65 | #pragma pack(pop) 66 | 67 | #endif // JSON_FEATURES_H_INCLUDED 68 | -------------------------------------------------------------------------------- /BDSNetRunner/json/include/json/reader.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_READER_H_INCLUDED 7 | #define JSON_READER_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "json_features.h" 11 | #include "value.h" 12 | #endif // if !defined(JSON_IS_AMALGAMATION) 13 | #include 14 | #include 15 | #include 16 | #include 17 | #include 18 | 19 | // Disable warning C4251: : needs to have dll-interface to 20 | // be used by... 21 | #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 22 | #pragma warning(push) 23 | #pragma warning(disable : 4251) 24 | #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 25 | 26 | #pragma pack(push, 8) 27 | 28 | namespace Json { 29 | 30 | /** \brief Unserialize a JSON document into a 31 | * Value. 32 | * 33 | * \deprecated Use CharReader and CharReaderBuilder. 34 | */ 35 | 36 | class JSONCPP_DEPRECATED( 37 | "Use CharReader and CharReaderBuilder instead.") JSON_API Reader { 38 | public: 39 | using Char = char; 40 | using Location = const Char*; 41 | 42 | /** \brief An error tagged with where in the JSON text it was encountered. 43 | * 44 | * The offsets give the [start, limit) range of bytes within the text. Note 45 | * that this is bytes, not codepoints. 46 | */ 47 | struct StructuredError { 48 | ptrdiff_t offset_start; 49 | ptrdiff_t offset_limit; 50 | String message; 51 | }; 52 | 53 | /** \brief Constructs a Reader allowing all features for parsing. 54 | */ 55 | JSONCPP_DEPRECATED("Use CharReader and CharReaderBuilder instead") 56 | Reader(); 57 | 58 | /** \brief Constructs a Reader allowing the specified feature set for parsing. 59 | */ 60 | JSONCPP_DEPRECATED("Use CharReader and CharReaderBuilder instead") 61 | Reader(const Features& features); 62 | 63 | /** \brief Read a Value from a JSON 64 | * document. 65 | * 66 | * \param document UTF-8 encoded string containing the document 67 | * to read. 68 | * \param[out] root Contains the root value of the document if it 69 | * was successfully parsed. 70 | * \param collectComments \c true to collect comment and allow writing 71 | * them back during serialization, \c false to 72 | * discard comments. This parameter is ignored 73 | * if Features::allowComments_ is \c false. 74 | * \return \c true if the document was successfully parsed, \c false if an 75 | * error occurred. 76 | */ 77 | bool parse(const std::string& document, Value& root, 78 | bool collectComments = true); 79 | 80 | /** \brief Read a Value from a JSON 81 | * document. 82 | * 83 | * \param beginDoc Pointer on the beginning of the UTF-8 encoded 84 | * string of the document to read. 85 | * \param endDoc Pointer on the end of the UTF-8 encoded string 86 | * of the document to read. Must be >= beginDoc. 87 | * \param[out] root Contains the root value of the document if it 88 | * was successfully parsed. 89 | * \param collectComments \c true to collect comment and allow writing 90 | * them back during serialization, \c false to 91 | * discard comments. This parameter is ignored 92 | * if Features::allowComments_ is \c false. 93 | * \return \c true if the document was successfully parsed, \c false if an 94 | * error occurred. 95 | */ 96 | bool parse(const char* beginDoc, const char* endDoc, Value& root, 97 | bool collectComments = true); 98 | 99 | /// \brief Parse from input stream. 100 | /// \see Json::operator>>(std::istream&, Json::Value&). 101 | bool parse(IStream& is, Value& root, bool collectComments = true); 102 | 103 | /** \brief Returns a user friendly string that list errors in the parsed 104 | * document. 105 | * 106 | * \return Formatted error message with the list of errors with their 107 | * location in the parsed document. An empty string is returned if no error 108 | * occurred during parsing. 109 | * \deprecated Use getFormattedErrorMessages() instead (typo fix). 110 | */ 111 | JSONCPP_DEPRECATED("Use getFormattedErrorMessages() instead.") 112 | String getFormatedErrorMessages() const; 113 | 114 | /** \brief Returns a user friendly string that list errors in the parsed 115 | * document. 116 | * 117 | * \return Formatted error message with the list of errors with their 118 | * location in the parsed document. An empty string is returned if no error 119 | * occurred during parsing. 120 | */ 121 | String getFormattedErrorMessages() const; 122 | 123 | /** \brief Returns a vector of structured errors encountered while parsing. 124 | * 125 | * \return A (possibly empty) vector of StructuredError objects. Currently 126 | * only one error can be returned, but the caller should tolerate multiple 127 | * errors. This can occur if the parser recovers from a non-fatal parse 128 | * error and then encounters additional errors. 129 | */ 130 | std::vector getStructuredErrors() const; 131 | 132 | /** \brief Add a semantic error message. 133 | * 134 | * \param value JSON Value location associated with the error 135 | * \param message The error message. 136 | * \return \c true if the error was successfully added, \c false if the Value 137 | * offset exceeds the document size. 138 | */ 139 | bool pushError(const Value& value, const String& message); 140 | 141 | /** \brief Add a semantic error message with extra context. 142 | * 143 | * \param value JSON Value location associated with the error 144 | * \param message The error message. 145 | * \param extra Additional JSON Value location to contextualize the error 146 | * \return \c true if the error was successfully added, \c false if either 147 | * Value offset exceeds the document size. 148 | */ 149 | bool pushError(const Value& value, const String& message, const Value& extra); 150 | 151 | /** \brief Return whether there are any errors. 152 | * 153 | * \return \c true if there are no errors to report \c false if errors have 154 | * occurred. 155 | */ 156 | bool good() const; 157 | 158 | private: 159 | enum TokenType { 160 | tokenEndOfStream = 0, 161 | tokenObjectBegin, 162 | tokenObjectEnd, 163 | tokenArrayBegin, 164 | tokenArrayEnd, 165 | tokenString, 166 | tokenNumber, 167 | tokenTrue, 168 | tokenFalse, 169 | tokenNull, 170 | tokenArraySeparator, 171 | tokenMemberSeparator, 172 | tokenComment, 173 | tokenError 174 | }; 175 | 176 | class Token { 177 | public: 178 | TokenType type_; 179 | Location start_; 180 | Location end_; 181 | }; 182 | 183 | class ErrorInfo { 184 | public: 185 | Token token_; 186 | String message_; 187 | Location extra_; 188 | }; 189 | 190 | using Errors = std::deque; 191 | 192 | bool readToken(Token& token); 193 | void skipSpaces(); 194 | bool match(const Char* pattern, int patternLength); 195 | bool readComment(); 196 | bool readCStyleComment(); 197 | bool readCppStyleComment(); 198 | bool readString(); 199 | void readNumber(); 200 | bool readValue(); 201 | bool readObject(Token& token); 202 | bool readArray(Token& token); 203 | bool decodeNumber(Token& token); 204 | bool decodeNumber(Token& token, Value& decoded); 205 | bool decodeString(Token& token); 206 | bool decodeString(Token& token, String& decoded); 207 | bool decodeDouble(Token& token); 208 | bool decodeDouble(Token& token, Value& decoded); 209 | bool decodeUnicodeCodePoint(Token& token, Location& current, Location end, 210 | unsigned int& unicode); 211 | bool decodeUnicodeEscapeSequence(Token& token, Location& current, 212 | Location end, unsigned int& unicode); 213 | bool addError(const String& message, Token& token, Location extra = nullptr); 214 | bool recoverFromError(TokenType skipUntilToken); 215 | bool addErrorAndRecover(const String& message, Token& token, 216 | TokenType skipUntilToken); 217 | void skipUntilSpace(); 218 | Value& currentValue(); 219 | Char getNextChar(); 220 | void getLocationLineAndColumn(Location location, int& line, 221 | int& column) const; 222 | String getLocationLineAndColumn(Location location) const; 223 | void addComment(Location begin, Location end, CommentPlacement placement); 224 | void skipCommentTokens(Token& token); 225 | 226 | static bool containsNewLine(Location begin, Location end); 227 | static String normalizeEOL(Location begin, Location end); 228 | 229 | using Nodes = std::stack; 230 | Nodes nodes_; 231 | Errors errors_; 232 | String document_; 233 | Location begin_{}; 234 | Location end_{}; 235 | Location current_{}; 236 | Location lastValueEnd_{}; 237 | Value* lastValue_{}; 238 | String commentsBefore_; 239 | Features features_; 240 | bool collectComments_{}; 241 | }; // Reader 242 | 243 | /** Interface for reading JSON from a char array. 244 | */ 245 | class JSON_API CharReader { 246 | public: 247 | virtual ~CharReader() = default; 248 | /** \brief Read a Value from a JSON 249 | * document. The document must be a UTF-8 encoded string containing the 250 | * document to read. 251 | * 252 | * \param beginDoc Pointer on the beginning of the UTF-8 encoded string 253 | * of the document to read. 254 | * \param endDoc Pointer on the end of the UTF-8 encoded string of the 255 | * document to read. Must be >= beginDoc. 256 | * \param[out] root Contains the root value of the document if it was 257 | * successfully parsed. 258 | * \param[out] errs Formatted error messages (if not NULL) a user 259 | * friendly string that lists errors in the parsed 260 | * document. 261 | * \return \c true if the document was successfully parsed, \c false if an 262 | * error occurred. 263 | */ 264 | virtual bool parse(char const* beginDoc, char const* endDoc, Value* root, 265 | String* errs) = 0; 266 | 267 | class JSON_API Factory { 268 | public: 269 | virtual ~Factory() = default; 270 | /** \brief Allocate a CharReader via operator new(). 271 | * \throw std::exception if something goes wrong (e.g. invalid settings) 272 | */ 273 | virtual CharReader* newCharReader() const = 0; 274 | }; // Factory 275 | }; // CharReader 276 | 277 | /** \brief Build a CharReader implementation. 278 | * 279 | * Usage: 280 | * \code 281 | * using namespace Json; 282 | * CharReaderBuilder builder; 283 | * builder["collectComments"] = false; 284 | * Value value; 285 | * String errs; 286 | * bool ok = parseFromStream(builder, std::cin, &value, &errs); 287 | * \endcode 288 | */ 289 | class JSON_API CharReaderBuilder : public CharReader::Factory { 290 | public: 291 | // Note: We use a Json::Value so that we can add data-members to this class 292 | // without a major version bump. 293 | /** Configuration of this builder. 294 | * These are case-sensitive. 295 | * Available settings (case-sensitive): 296 | * - `"collectComments": false or true` 297 | * - true to collect comment and allow writing them back during 298 | * serialization, false to discard comments. This parameter is ignored 299 | * if allowComments is false. 300 | * - `"allowComments": false or true` 301 | * - true if comments are allowed. 302 | * - `"allowTrailingCommas": false or true` 303 | * - true if trailing commas in objects and arrays are allowed. 304 | * - `"strictRoot": false or true` 305 | * - true if root must be either an array or an object value 306 | * - `"allowDroppedNullPlaceholders": false or true` 307 | * - true if dropped null placeholders are allowed. (See 308 | * StreamWriterBuilder.) 309 | * - `"allowNumericKeys": false or true` 310 | * - true if numeric object keys are allowed. 311 | * - `"allowSingleQuotes": false or true` 312 | * - true if '' are allowed for strings (both keys and values) 313 | * - `"stackLimit": integer` 314 | * - Exceeding stackLimit (recursive depth of `readValue()`) will cause an 315 | * exception. 316 | * - This is a security issue (seg-faults caused by deeply nested JSON), so 317 | * the default is low. 318 | * - `"failIfExtra": false or true` 319 | * - If true, `parse()` returns false when extra non-whitespace trails the 320 | * JSON value in the input string. 321 | * - `"rejectDupKeys": false or true` 322 | * - If true, `parse()` returns false when a key is duplicated within an 323 | * object. 324 | * - `"allowSpecialFloats": false or true` 325 | * - If true, special float values (NaNs and infinities) are allowed and 326 | * their values are lossfree restorable. 327 | * 328 | * You can examine 'settings_` yourself to see the defaults. You can also 329 | * write and read them just like any JSON Value. 330 | * \sa setDefaults() 331 | */ 332 | Json::Value settings_; 333 | 334 | CharReaderBuilder(); 335 | ~CharReaderBuilder() override; 336 | 337 | CharReader* newCharReader() const override; 338 | 339 | /** \return true if 'settings' are legal and consistent; 340 | * otherwise, indicate bad settings via 'invalid'. 341 | */ 342 | bool validate(Json::Value* invalid) const; 343 | 344 | /** A simple way to update a specific setting. 345 | */ 346 | Value& operator[](const String& key); 347 | 348 | /** Called by ctor, but you can use this to reset settings_. 349 | * \pre 'settings' != NULL (but Json::null is fine) 350 | * \remark Defaults: 351 | * \snippet src/lib_json/json_reader.cpp CharReaderBuilderDefaults 352 | */ 353 | static void setDefaults(Json::Value* settings); 354 | /** Same as old Features::strictMode(). 355 | * \pre 'settings' != NULL (but Json::null is fine) 356 | * \remark Defaults: 357 | * \snippet src/lib_json/json_reader.cpp CharReaderBuilderStrictMode 358 | */ 359 | static void strictMode(Json::Value* settings); 360 | }; 361 | 362 | /** Consume entire stream and use its begin/end. 363 | * Someday we might have a real StreamReader, but for now this 364 | * is convenient. 365 | */ 366 | bool JSON_API parseFromStream(CharReader::Factory const&, IStream&, Value* root, 367 | String* errs); 368 | 369 | /** \brief Read from 'sin' into 'root'. 370 | * 371 | * Always keep comments from the input JSON. 372 | * 373 | * This can be used to read a file into a particular sub-object. 374 | * For example: 375 | * \code 376 | * Json::Value root; 377 | * cin >> root["dir"]["file"]; 378 | * cout << root; 379 | * \endcode 380 | * Result: 381 | * \verbatim 382 | * { 383 | * "dir": { 384 | * "file": { 385 | * // The input stream JSON would be nested here. 386 | * } 387 | * } 388 | * } 389 | * \endverbatim 390 | * \throw std::exception on parse error. 391 | * \see Json::operator<<() 392 | */ 393 | JSON_API IStream& operator>>(IStream&, Value&); 394 | 395 | } // namespace Json 396 | 397 | #pragma pack(pop) 398 | 399 | #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 400 | #pragma warning(pop) 401 | #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 402 | 403 | #endif // JSON_READER_H_INCLUDED 404 | -------------------------------------------------------------------------------- /BDSNetRunner/json/include/json/value.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_H_INCLUDED 7 | #define JSON_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "forwards.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | 13 | // Conditional NORETURN attribute on the throw functions would: 14 | // a) suppress false positives from static code analysis 15 | // b) possibly improve optimization opportunities. 16 | #if !defined(JSONCPP_NORETURN) 17 | #if defined(_MSC_VER) && _MSC_VER == 1800 18 | #define JSONCPP_NORETURN __declspec(noreturn) 19 | #else 20 | #define JSONCPP_NORETURN [[noreturn]] 21 | #endif 22 | #endif 23 | 24 | #include 25 | #include 26 | #include 27 | #include 28 | #include 29 | #include 30 | 31 | // Disable warning C4251: : needs to have dll-interface to 32 | // be used by... 33 | #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 34 | #pragma warning(push) 35 | #pragma warning(disable : 4251) 36 | #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 37 | 38 | #pragma pack(push, 8) 39 | 40 | /** \brief JSON (JavaScript Object Notation). 41 | */ 42 | namespace Json { 43 | 44 | #if JSON_USE_EXCEPTION 45 | /** Base class for all exceptions we throw. 46 | * 47 | * We use nothing but these internally. Of course, STL can throw others. 48 | */ 49 | class JSON_API Exception : public std::exception { 50 | public: 51 | Exception(String msg); 52 | ~Exception() JSONCPP_NOEXCEPT override; 53 | char const* what() const JSONCPP_NOEXCEPT override; 54 | 55 | protected: 56 | String msg_; 57 | }; 58 | 59 | /** Exceptions which the user cannot easily avoid. 60 | * 61 | * E.g. out-of-memory (when we use malloc), stack-overflow, malicious input 62 | * 63 | * \remark derived from Json::Exception 64 | */ 65 | class JSON_API RuntimeError : public Exception { 66 | public: 67 | RuntimeError(String const& msg); 68 | }; 69 | 70 | /** Exceptions thrown by JSON_ASSERT/JSON_FAIL macros. 71 | * 72 | * These are precondition-violations (user bugs) and internal errors (our bugs). 73 | * 74 | * \remark derived from Json::Exception 75 | */ 76 | class JSON_API LogicError : public Exception { 77 | public: 78 | LogicError(String const& msg); 79 | }; 80 | #endif 81 | 82 | /// used internally 83 | JSONCPP_NORETURN void throwRuntimeError(String const& msg); 84 | /// used internally 85 | JSONCPP_NORETURN void throwLogicError(String const& msg); 86 | 87 | /** \brief Type of the value held by a Value object. 88 | */ 89 | enum ValueType { 90 | nullValue = 0, ///< 'null' value 91 | intValue, ///< signed integer value 92 | uintValue, ///< unsigned integer value 93 | realValue, ///< double value 94 | stringValue, ///< UTF-8 string value 95 | booleanValue, ///< bool value 96 | arrayValue, ///< array value (ordered list) 97 | objectValue ///< object value (collection of name/value pairs). 98 | }; 99 | 100 | enum CommentPlacement { 101 | commentBefore = 0, ///< a comment placed on the line before a value 102 | commentAfterOnSameLine, ///< a comment just after a value on the same line 103 | commentAfter, ///< a comment on the line after a value (only make sense for 104 | /// root value) 105 | numberOfCommentPlacement 106 | }; 107 | 108 | /** \brief Type of precision for formatting of real values. 109 | */ 110 | enum PrecisionType { 111 | significantDigits = 0, ///< we set max number of significant digits in string 112 | decimalPlaces ///< we set max number of digits after "." in string 113 | }; 114 | 115 | /** \brief Lightweight wrapper to tag static string. 116 | * 117 | * Value constructor and objectValue member assignment takes advantage of the 118 | * StaticString and avoid the cost of string duplication when storing the 119 | * string or the member name. 120 | * 121 | * Example of usage: 122 | * \code 123 | * Json::Value aValue( StaticString("some text") ); 124 | * Json::Value object; 125 | * static const StaticString code("code"); 126 | * object[code] = 1234; 127 | * \endcode 128 | */ 129 | class JSON_API StaticString { 130 | public: 131 | explicit StaticString(const char* czstring) : c_str_(czstring) {} 132 | 133 | operator const char*() const { return c_str_; } 134 | 135 | const char* c_str() const { return c_str_; } 136 | 137 | private: 138 | const char* c_str_; 139 | }; 140 | 141 | /** \brief Represents a JSON value. 142 | * 143 | * This class is a discriminated union wrapper that can represents a: 144 | * - signed integer [range: Value::minInt - Value::maxInt] 145 | * - unsigned integer (range: 0 - Value::maxUInt) 146 | * - double 147 | * - UTF-8 string 148 | * - boolean 149 | * - 'null' 150 | * - an ordered list of Value 151 | * - collection of name/value pairs (javascript object) 152 | * 153 | * The type of the held value is represented by a #ValueType and 154 | * can be obtained using type(). 155 | * 156 | * Values of an #objectValue or #arrayValue can be accessed using operator[]() 157 | * methods. 158 | * Non-const methods will automatically create the a #nullValue element 159 | * if it does not exist. 160 | * The sequence of an #arrayValue will be automatically resized and initialized 161 | * with #nullValue. resize() can be used to enlarge or truncate an #arrayValue. 162 | * 163 | * The get() methods can be used to obtain default value in the case the 164 | * required element does not exist. 165 | * 166 | * It is possible to iterate over the list of member keys of an object using 167 | * the getMemberNames() method. 168 | * 169 | * \note #Value string-length fit in size_t, but keys must be < 2^30. 170 | * (The reason is an implementation detail.) A #CharReader will raise an 171 | * exception if a bound is exceeded to avoid security holes in your app, 172 | * but the Value API does *not* check bounds. That is the responsibility 173 | * of the caller. 174 | */ 175 | class JSON_API Value { 176 | friend class ValueIteratorBase; 177 | 178 | public: 179 | using Members = std::vector; 180 | using iterator = ValueIterator; 181 | using const_iterator = ValueConstIterator; 182 | using UInt = Json::UInt; 183 | using Int = Json::Int; 184 | #if defined(JSON_HAS_INT64) 185 | using UInt64 = Json::UInt64; 186 | using Int64 = Json::Int64; 187 | #endif // defined(JSON_HAS_INT64) 188 | using LargestInt = Json::LargestInt; 189 | using LargestUInt = Json::LargestUInt; 190 | using ArrayIndex = Json::ArrayIndex; 191 | 192 | // Required for boost integration, e. g. BOOST_TEST 193 | using value_type = std::string; 194 | 195 | #if JSON_USE_NULLREF 196 | // Binary compatibility kludges, do not use. 197 | static const Value& null; 198 | static const Value& nullRef; 199 | #endif 200 | 201 | // null and nullRef are deprecated, use this instead. 202 | static Value const& nullSingleton(); 203 | 204 | /// Minimum signed integer value that can be stored in a Json::Value. 205 | static constexpr LargestInt minLargestInt = 206 | LargestInt(~(LargestUInt(-1) / 2)); 207 | /// Maximum signed integer value that can be stored in a Json::Value. 208 | static constexpr LargestInt maxLargestInt = LargestInt(LargestUInt(-1) / 2); 209 | /// Maximum unsigned integer value that can be stored in a Json::Value. 210 | static constexpr LargestUInt maxLargestUInt = LargestUInt(-1); 211 | 212 | /// Minimum signed int value that can be stored in a Json::Value. 213 | static constexpr Int minInt = Int(~(UInt(-1) / 2)); 214 | /// Maximum signed int value that can be stored in a Json::Value. 215 | static constexpr Int maxInt = Int(UInt(-1) / 2); 216 | /// Maximum unsigned int value that can be stored in a Json::Value. 217 | static constexpr UInt maxUInt = UInt(-1); 218 | 219 | #if defined(JSON_HAS_INT64) 220 | /// Minimum signed 64 bits int value that can be stored in a Json::Value. 221 | static constexpr Int64 minInt64 = Int64(~(UInt64(-1) / 2)); 222 | /// Maximum signed 64 bits int value that can be stored in a Json::Value. 223 | static constexpr Int64 maxInt64 = Int64(UInt64(-1) / 2); 224 | /// Maximum unsigned 64 bits int value that can be stored in a Json::Value. 225 | static constexpr UInt64 maxUInt64 = UInt64(-1); 226 | #endif // defined(JSON_HAS_INT64) 227 | /// Default precision for real value for string representation. 228 | static constexpr UInt defaultRealPrecision = 17; 229 | // The constant is hard-coded because some compiler have trouble 230 | // converting Value::maxUInt64 to a double correctly (AIX/xlC). 231 | // Assumes that UInt64 is a 64 bits integer. 232 | static constexpr double maxUInt64AsDouble = 18446744073709551615.0; 233 | // Workaround for bug in the NVIDIAs CUDA 9.1 nvcc compiler 234 | // when using gcc and clang backend compilers. CZString 235 | // cannot be defined as private. See issue #486 236 | #ifdef __NVCC__ 237 | public: 238 | #else 239 | private: 240 | #endif 241 | #ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION 242 | class CZString { 243 | public: 244 | enum DuplicationPolicy { noDuplication = 0, duplicate, duplicateOnCopy }; 245 | CZString(ArrayIndex index); 246 | CZString(char const* str, unsigned length, DuplicationPolicy allocate); 247 | CZString(CZString const& other); 248 | CZString(CZString&& other); 249 | ~CZString(); 250 | CZString& operator=(const CZString& other); 251 | CZString& operator=(CZString&& other); 252 | 253 | bool operator<(CZString const& other) const; 254 | bool operator==(CZString const& other) const; 255 | ArrayIndex index() const; 256 | // const char* c_str() const; ///< \deprecated 257 | char const* data() const; 258 | unsigned length() const; 259 | bool isStaticString() const; 260 | 261 | private: 262 | void swap(CZString& other); 263 | 264 | struct StringStorage { 265 | unsigned policy_ : 2; 266 | unsigned length_ : 30; // 1GB max 267 | }; 268 | 269 | char const* cstr_; // actually, a prefixed string, unless policy is noDup 270 | union { 271 | ArrayIndex index_; 272 | StringStorage storage_; 273 | }; 274 | }; 275 | 276 | public: 277 | typedef std::map ObjectValues; 278 | #endif // ifndef JSONCPP_DOC_EXCLUDE_IMPLEMENTATION 279 | 280 | public: 281 | /** 282 | * \brief Create a default Value of the given type. 283 | * 284 | * This is a very useful constructor. 285 | * To create an empty array, pass arrayValue. 286 | * To create an empty object, pass objectValue. 287 | * Another Value can then be set to this one by assignment. 288 | * This is useful since clear() and resize() will not alter types. 289 | * 290 | * Examples: 291 | * \code 292 | * Json::Value null_value; // null 293 | * Json::Value arr_value(Json::arrayValue); // [] 294 | * Json::Value obj_value(Json::objectValue); // {} 295 | * \endcode 296 | */ 297 | Value(ValueType type = nullValue); 298 | Value(Int value); 299 | Value(UInt value); 300 | #if defined(JSON_HAS_INT64) 301 | Value(Int64 value); 302 | Value(UInt64 value); 303 | #endif // if defined(JSON_HAS_INT64) 304 | Value(double value); 305 | Value(const char* value); ///< Copy til first 0. (NULL causes to seg-fault.) 306 | Value(const char* begin, const char* end); ///< Copy all, incl zeroes. 307 | /** 308 | * \brief Constructs a value from a static string. 309 | * 310 | * Like other value string constructor but do not duplicate the string for 311 | * internal storage. The given string must remain alive after the call to 312 | * this constructor. 313 | * 314 | * \note This works only for null-terminated strings. (We cannot change the 315 | * size of this class, so we have nowhere to store the length, which might be 316 | * computed later for various operations.) 317 | * 318 | * Example of usage: 319 | * \code 320 | * static StaticString foo("some text"); 321 | * Json::Value aValue(foo); 322 | * \endcode 323 | */ 324 | Value(const StaticString& value); 325 | Value(const String& value); 326 | Value(bool value); 327 | Value(const Value& other); 328 | Value(Value&& other); 329 | ~Value(); 330 | 331 | /// \note Overwrite existing comments. To preserve comments, use 332 | /// #swapPayload(). 333 | Value& operator=(const Value& other); 334 | Value& operator=(Value&& other); 335 | 336 | /// Swap everything. 337 | void swap(Value& other); 338 | /// Swap values but leave comments and source offsets in place. 339 | void swapPayload(Value& other); 340 | 341 | /// copy everything. 342 | void copy(const Value& other); 343 | /// copy values but leave comments and source offsets in place. 344 | void copyPayload(const Value& other); 345 | 346 | ValueType type() const; 347 | 348 | /// Compare payload only, not comments etc. 349 | bool operator<(const Value& other) const; 350 | bool operator<=(const Value& other) const; 351 | bool operator>=(const Value& other) const; 352 | bool operator>(const Value& other) const; 353 | bool operator==(const Value& other) const; 354 | bool operator!=(const Value& other) const; 355 | int compare(const Value& other) const; 356 | 357 | const char* asCString() const; ///< Embedded zeroes could cause you trouble! 358 | #if JSONCPP_USING_SECURE_MEMORY 359 | unsigned getCStringLength() const; // Allows you to understand the length of 360 | // the CString 361 | #endif 362 | String asString() const; ///< Embedded zeroes are possible. 363 | /** Get raw char* of string-value. 364 | * \return false if !string. (Seg-fault if str or end are NULL.) 365 | */ 366 | bool getString(char const** begin, char const** end) const; 367 | Int asInt() const; 368 | UInt asUInt() const; 369 | #if defined(JSON_HAS_INT64) 370 | Int64 asInt64() const; 371 | UInt64 asUInt64() const; 372 | #endif // if defined(JSON_HAS_INT64) 373 | LargestInt asLargestInt() const; 374 | LargestUInt asLargestUInt() const; 375 | float asFloat() const; 376 | double asDouble() const; 377 | bool asBool() const; 378 | 379 | bool isNull() const; 380 | bool isBool() const; 381 | bool isInt() const; 382 | bool isInt64() const; 383 | bool isUInt() const; 384 | bool isUInt64() const; 385 | bool isIntegral() const; 386 | bool isDouble() const; 387 | bool isNumeric() const; 388 | bool isString() const; 389 | bool isArray() const; 390 | bool isObject() const; 391 | 392 | /// The `as` and `is` member function templates and specializations. 393 | template T as() const = delete; 394 | template bool is() const = delete; 395 | 396 | bool isConvertibleTo(ValueType other) const; 397 | 398 | /// Number of values in array or object 399 | ArrayIndex size() const; 400 | 401 | /// \brief Return true if empty array, empty object, or null; 402 | /// otherwise, false. 403 | bool empty() const; 404 | 405 | /// Return !isNull() 406 | JSONCPP_OP_EXPLICIT operator bool() const; 407 | 408 | /// Remove all object members and array elements. 409 | /// \pre type() is arrayValue, objectValue, or nullValue 410 | /// \post type() is unchanged 411 | void clear(); 412 | 413 | /// Resize the array to newSize elements. 414 | /// New elements are initialized to null. 415 | /// May only be called on nullValue or arrayValue. 416 | /// \pre type() is arrayValue or nullValue 417 | /// \post type() is arrayValue 418 | void resize(ArrayIndex newSize); 419 | 420 | //@{ 421 | /// Access an array element (zero based index). If the array contains less 422 | /// than index element, then null value are inserted in the array so that 423 | /// its size is index+1. 424 | /// (You may need to say 'value[0u]' to get your compiler to distinguish 425 | /// this from the operator[] which takes a string.) 426 | Value& operator[](ArrayIndex index); 427 | Value& operator[](int index); 428 | //@} 429 | 430 | //@{ 431 | /// Access an array element (zero based index). 432 | /// (You may need to say 'value[0u]' to get your compiler to distinguish 433 | /// this from the operator[] which takes a string.) 434 | const Value& operator[](ArrayIndex index) const; 435 | const Value& operator[](int index) const; 436 | //@} 437 | 438 | /// If the array contains at least index+1 elements, returns the element 439 | /// value, otherwise returns defaultValue. 440 | Value get(ArrayIndex index, const Value& defaultValue) const; 441 | /// Return true if index < size(). 442 | bool isValidIndex(ArrayIndex index) const; 443 | /// \brief Append value to array at the end. 444 | /// 445 | /// Equivalent to jsonvalue[jsonvalue.size()] = value; 446 | Value& append(const Value& value); 447 | Value& append(Value&& value); 448 | 449 | /// \brief Insert value in array at specific index 450 | bool insert(ArrayIndex index, const Value& newValue); 451 | bool insert(ArrayIndex index, Value&& newValue); 452 | 453 | /// Access an object value by name, create a null member if it does not exist. 454 | /// \note Because of our implementation, keys are limited to 2^30 -1 chars. 455 | /// Exceeding that will cause an exception. 456 | Value& operator[](const char* key); 457 | /// Access an object value by name, returns null if there is no member with 458 | /// that name. 459 | const Value& operator[](const char* key) const; 460 | /// Access an object value by name, create a null member if it does not exist. 461 | /// \param key may contain embedded nulls. 462 | Value& operator[](const String& key); 463 | /// Access an object value by name, returns null if there is no member with 464 | /// that name. 465 | /// \param key may contain embedded nulls. 466 | const Value& operator[](const String& key) const; 467 | /** \brief Access an object value by name, create a null member if it does not 468 | * exist. 469 | * 470 | * If the object has no entry for that name, then the member name used to 471 | * store the new entry is not duplicated. 472 | * Example of use: 473 | * \code 474 | * Json::Value object; 475 | * static const StaticString code("code"); 476 | * object[code] = 1234; 477 | * \endcode 478 | */ 479 | Value& operator[](const StaticString& key); 480 | /// Return the member named key if it exist, defaultValue otherwise. 481 | /// \note deep copy 482 | Value get(const char* key, const Value& defaultValue) const; 483 | /// Return the member named key if it exist, defaultValue otherwise. 484 | /// \note deep copy 485 | /// \note key may contain embedded nulls. 486 | Value get(const char* begin, const char* end, 487 | const Value& defaultValue) const; 488 | /// Return the member named key if it exist, defaultValue otherwise. 489 | /// \note deep copy 490 | /// \param key may contain embedded nulls. 491 | Value get(const String& key, const Value& defaultValue) const; 492 | /// Most general and efficient version of isMember()const, get()const, 493 | /// and operator[]const 494 | /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30 495 | Value const* find(char const* begin, char const* end) const; 496 | /// Most general and efficient version of object-mutators. 497 | /// \note As stated elsewhere, behavior is undefined if (end-begin) >= 2^30 498 | /// \return non-zero, but JSON_ASSERT if this is neither object nor nullValue. 499 | Value* demand(char const* begin, char const* end); 500 | /// \brief Remove and return the named member. 501 | /// 502 | /// Do nothing if it did not exist. 503 | /// \pre type() is objectValue or nullValue 504 | /// \post type() is unchanged 505 | void removeMember(const char* key); 506 | /// Same as removeMember(const char*) 507 | /// \param key may contain embedded nulls. 508 | void removeMember(const String& key); 509 | /// Same as removeMember(const char* begin, const char* end, Value* removed), 510 | /// but 'key' is null-terminated. 511 | bool removeMember(const char* key, Value* removed); 512 | /** \brief Remove the named map member. 513 | * 514 | * Update 'removed' iff removed. 515 | * \param key may contain embedded nulls. 516 | * \return true iff removed (no exceptions) 517 | */ 518 | bool removeMember(String const& key, Value* removed); 519 | /// Same as removeMember(String const& key, Value* removed) 520 | bool removeMember(const char* begin, const char* end, Value* removed); 521 | /** \brief Remove the indexed array element. 522 | * 523 | * O(n) expensive operations. 524 | * Update 'removed' iff removed. 525 | * \return true if removed (no exceptions) 526 | */ 527 | bool removeIndex(ArrayIndex index, Value* removed); 528 | 529 | /// Return true if the object has a member named key. 530 | /// \note 'key' must be null-terminated. 531 | bool isMember(const char* key) const; 532 | /// Return true if the object has a member named key. 533 | /// \param key may contain embedded nulls. 534 | bool isMember(const String& key) const; 535 | /// Same as isMember(String const& key)const 536 | bool isMember(const char* begin, const char* end) const; 537 | 538 | /// \brief Return a list of the member names. 539 | /// 540 | /// If null, return an empty list. 541 | /// \pre type() is objectValue or nullValue 542 | /// \post if type() was nullValue, it remains nullValue 543 | Members getMemberNames() const; 544 | 545 | /// \deprecated Always pass len. 546 | JSONCPP_DEPRECATED("Use setComment(String const&) instead.") 547 | void setComment(const char* comment, CommentPlacement placement) { 548 | setComment(String(comment, strlen(comment)), placement); 549 | } 550 | /// Comments must be //... or /* ... */ 551 | void setComment(const char* comment, size_t len, CommentPlacement placement) { 552 | setComment(String(comment, len), placement); 553 | } 554 | /// Comments must be //... or /* ... */ 555 | void setComment(String comment, CommentPlacement placement); 556 | bool hasComment(CommentPlacement placement) const; 557 | /// Include delimiters and embedded newlines. 558 | String getComment(CommentPlacement placement) const; 559 | 560 | String toStyledString() const; 561 | 562 | const_iterator begin() const; 563 | const_iterator end() const; 564 | 565 | iterator begin(); 566 | iterator end(); 567 | 568 | // Accessors for the [start, limit) range of bytes within the JSON text from 569 | // which this value was parsed, if any. 570 | void setOffsetStart(ptrdiff_t start); 571 | void setOffsetLimit(ptrdiff_t limit); 572 | ptrdiff_t getOffsetStart() const; 573 | ptrdiff_t getOffsetLimit() const; 574 | 575 | private: 576 | void setType(ValueType v) { 577 | bits_.value_type_ = static_cast(v); 578 | } 579 | bool isAllocated() const { return bits_.allocated_; } 580 | void setIsAllocated(bool v) { bits_.allocated_ = v; } 581 | 582 | void initBasic(ValueType type, bool allocated = false); 583 | void dupPayload(const Value& other); 584 | void releasePayload(); 585 | void dupMeta(const Value& other); 586 | 587 | Value& resolveReference(const char* key); 588 | Value& resolveReference(const char* key, const char* end); 589 | 590 | // struct MemberNamesTransform 591 | //{ 592 | // typedef const char *result_type; 593 | // const char *operator()( const CZString &name ) const 594 | // { 595 | // return name.c_str(); 596 | // } 597 | //}; 598 | 599 | union ValueHolder { 600 | LargestInt int_; 601 | LargestUInt uint_; 602 | double real_; 603 | bool bool_; 604 | char* string_; // if allocated_, ptr to { unsigned, char[] }. 605 | ObjectValues* map_; 606 | } value_; 607 | 608 | struct { 609 | // Really a ValueType, but types should agree for bitfield packing. 610 | unsigned int value_type_ : 8; 611 | // Unless allocated_, string_ must be null-terminated. 612 | unsigned int allocated_ : 1; 613 | } bits_; 614 | 615 | class Comments { 616 | public: 617 | Comments() = default; 618 | Comments(const Comments& that); 619 | Comments(Comments&& that); 620 | Comments& operator=(const Comments& that); 621 | Comments& operator=(Comments&& that); 622 | bool has(CommentPlacement slot) const; 623 | String get(CommentPlacement slot) const; 624 | void set(CommentPlacement slot, String comment); 625 | 626 | private: 627 | using Array = std::array; 628 | std::unique_ptr ptr_; 629 | }; 630 | Comments comments_; 631 | 632 | // [start, limit) byte offsets in the source JSON text from which this Value 633 | // was extracted. 634 | ptrdiff_t start_; 635 | ptrdiff_t limit_; 636 | }; 637 | 638 | template <> inline bool Value::as() const { return asBool(); } 639 | template <> inline bool Value::is() const { return isBool(); } 640 | 641 | template <> inline Int Value::as() const { return asInt(); } 642 | template <> inline bool Value::is() const { return isInt(); } 643 | 644 | template <> inline UInt Value::as() const { return asUInt(); } 645 | template <> inline bool Value::is() const { return isUInt(); } 646 | 647 | #if defined(JSON_HAS_INT64) 648 | template <> inline Int64 Value::as() const { return asInt64(); } 649 | template <> inline bool Value::is() const { return isInt64(); } 650 | 651 | template <> inline UInt64 Value::as() const { return asUInt64(); } 652 | template <> inline bool Value::is() const { return isUInt64(); } 653 | #endif 654 | 655 | template <> inline double Value::as() const { return asDouble(); } 656 | template <> inline bool Value::is() const { return isDouble(); } 657 | 658 | template <> inline String Value::as() const { return asString(); } 659 | template <> inline bool Value::is() const { return isString(); } 660 | 661 | /// These `as` specializations are type conversions, and do not have a 662 | /// corresponding `is`. 663 | template <> inline float Value::as() const { return asFloat(); } 664 | template <> inline const char* Value::as() const { 665 | return asCString(); 666 | } 667 | 668 | /** \brief Experimental and untested: represents an element of the "path" to 669 | * access a node. 670 | */ 671 | class JSON_API PathArgument { 672 | public: 673 | friend class Path; 674 | 675 | PathArgument(); 676 | PathArgument(ArrayIndex index); 677 | PathArgument(const char* key); 678 | PathArgument(String key); 679 | 680 | private: 681 | enum Kind { kindNone = 0, kindIndex, kindKey }; 682 | String key_; 683 | ArrayIndex index_{}; 684 | Kind kind_{kindNone}; 685 | }; 686 | 687 | /** \brief Experimental and untested: represents a "path" to access a node. 688 | * 689 | * Syntax: 690 | * - "." => root node 691 | * - ".[n]" => elements at index 'n' of root node (an array value) 692 | * - ".name" => member named 'name' of root node (an object value) 693 | * - ".name1.name2.name3" 694 | * - ".[0][1][2].name1[3]" 695 | * - ".%" => member name is provided as parameter 696 | * - ".[%]" => index is provided as parameter 697 | */ 698 | class JSON_API Path { 699 | public: 700 | Path(const String& path, const PathArgument& a1 = PathArgument(), 701 | const PathArgument& a2 = PathArgument(), 702 | const PathArgument& a3 = PathArgument(), 703 | const PathArgument& a4 = PathArgument(), 704 | const PathArgument& a5 = PathArgument()); 705 | 706 | const Value& resolve(const Value& root) const; 707 | Value resolve(const Value& root, const Value& defaultValue) const; 708 | /// Creates the "path" to access the specified node and returns a reference on 709 | /// the node. 710 | Value& make(Value& root) const; 711 | 712 | private: 713 | using InArgs = std::vector; 714 | using Args = std::vector; 715 | 716 | void makePath(const String& path, const InArgs& in); 717 | void addPathInArg(const String& path, const InArgs& in, 718 | InArgs::const_iterator& itInArg, PathArgument::Kind kind); 719 | static void invalidPath(const String& path, int location); 720 | 721 | Args args_; 722 | }; 723 | 724 | /** \brief base class for Value iterators. 725 | * 726 | */ 727 | class JSON_API ValueIteratorBase { 728 | public: 729 | using iterator_category = std::bidirectional_iterator_tag; 730 | using size_t = unsigned int; 731 | using difference_type = int; 732 | using SelfType = ValueIteratorBase; 733 | 734 | bool operator==(const SelfType& other) const { return isEqual(other); } 735 | 736 | bool operator!=(const SelfType& other) const { return !isEqual(other); } 737 | 738 | difference_type operator-(const SelfType& other) const { 739 | return other.computeDistance(*this); 740 | } 741 | 742 | /// Return either the index or the member name of the referenced value as a 743 | /// Value. 744 | Value key() const; 745 | 746 | /// Return the index of the referenced Value, or -1 if it is not an 747 | /// arrayValue. 748 | UInt index() const; 749 | 750 | /// Return the member name of the referenced Value, or "" if it is not an 751 | /// objectValue. 752 | /// \note Avoid `c_str()` on result, as embedded zeroes are possible. 753 | String name() const; 754 | 755 | /// Return the member name of the referenced Value. "" if it is not an 756 | /// objectValue. 757 | /// \deprecated This cannot be used for UTF-8 strings, since there can be 758 | /// embedded nulls. 759 | JSONCPP_DEPRECATED("Use `key = name();` instead.") 760 | char const* memberName() const; 761 | /// Return the member name of the referenced Value, or NULL if it is not an 762 | /// objectValue. 763 | /// \note Better version than memberName(). Allows embedded nulls. 764 | char const* memberName(char const** end) const; 765 | 766 | protected: 767 | /*! Internal utility functions to assist with implementing 768 | * other iterator functions. The const and non-const versions 769 | * of the "deref" protected methods expose the protected 770 | * current_ member variable in a way that can often be 771 | * optimized away by the compiler. 772 | */ 773 | const Value& deref() const; 774 | Value& deref(); 775 | 776 | void increment(); 777 | 778 | void decrement(); 779 | 780 | difference_type computeDistance(const SelfType& other) const; 781 | 782 | bool isEqual(const SelfType& other) const; 783 | 784 | void copy(const SelfType& other); 785 | 786 | private: 787 | Value::ObjectValues::iterator current_; 788 | // Indicates that iterator is for a null value. 789 | bool isNull_{true}; 790 | 791 | public: 792 | // For some reason, BORLAND needs these at the end, rather 793 | // than earlier. No idea why. 794 | ValueIteratorBase(); 795 | explicit ValueIteratorBase(const Value::ObjectValues::iterator& current); 796 | }; 797 | 798 | /** \brief const iterator for object and array value. 799 | * 800 | */ 801 | class JSON_API ValueConstIterator : public ValueIteratorBase { 802 | friend class Value; 803 | 804 | public: 805 | using value_type = const Value; 806 | // typedef unsigned int size_t; 807 | // typedef int difference_type; 808 | using reference = const Value&; 809 | using pointer = const Value*; 810 | using SelfType = ValueConstIterator; 811 | 812 | ValueConstIterator(); 813 | ValueConstIterator(ValueIterator const& other); 814 | 815 | private: 816 | /*! \internal Use by Value to create an iterator. 817 | */ 818 | explicit ValueConstIterator(const Value::ObjectValues::iterator& current); 819 | 820 | public: 821 | SelfType& operator=(const ValueIteratorBase& other); 822 | 823 | SelfType operator++(int) { 824 | SelfType temp(*this); 825 | ++*this; 826 | return temp; 827 | } 828 | 829 | SelfType operator--(int) { 830 | SelfType temp(*this); 831 | --*this; 832 | return temp; 833 | } 834 | 835 | SelfType& operator--() { 836 | decrement(); 837 | return *this; 838 | } 839 | 840 | SelfType& operator++() { 841 | increment(); 842 | return *this; 843 | } 844 | 845 | reference operator*() const { return deref(); } 846 | 847 | pointer operator->() const { return &deref(); } 848 | }; 849 | 850 | /** \brief Iterator for object and array value. 851 | */ 852 | class JSON_API ValueIterator : public ValueIteratorBase { 853 | friend class Value; 854 | 855 | public: 856 | using value_type = Value; 857 | using size_t = unsigned int; 858 | using difference_type = int; 859 | using reference = Value&; 860 | using pointer = Value*; 861 | using SelfType = ValueIterator; 862 | 863 | ValueIterator(); 864 | explicit ValueIterator(const ValueConstIterator& other); 865 | ValueIterator(const ValueIterator& other); 866 | 867 | private: 868 | /*! \internal Use by Value to create an iterator. 869 | */ 870 | explicit ValueIterator(const Value::ObjectValues::iterator& current); 871 | 872 | public: 873 | SelfType& operator=(const SelfType& other); 874 | 875 | SelfType operator++(int) { 876 | SelfType temp(*this); 877 | ++*this; 878 | return temp; 879 | } 880 | 881 | SelfType operator--(int) { 882 | SelfType temp(*this); 883 | --*this; 884 | return temp; 885 | } 886 | 887 | SelfType& operator--() { 888 | decrement(); 889 | return *this; 890 | } 891 | 892 | SelfType& operator++() { 893 | increment(); 894 | return *this; 895 | } 896 | 897 | /*! The return value of non-const iterators can be 898 | * changed, so the these functions are not const 899 | * because the returned references/pointers can be used 900 | * to change state of the base class. 901 | */ 902 | reference operator*() { return deref(); } 903 | pointer operator->() { return &deref(); } 904 | }; 905 | 906 | inline void swap(Value& a, Value& b) { a.swap(b); } 907 | 908 | } // namespace Json 909 | 910 | #pragma pack(pop) 911 | 912 | #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 913 | #pragma warning(pop) 914 | #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 915 | 916 | #endif // JSON_H_INCLUDED 917 | -------------------------------------------------------------------------------- /BDSNetRunner/json/include/json/version.h: -------------------------------------------------------------------------------- 1 | #ifndef JSON_VERSION_H_INCLUDED 2 | #define JSON_VERSION_H_INCLUDED 3 | 4 | // Note: version must be updated in three places when doing a release. This 5 | // annoying process ensures that amalgamate, CMake, and meson all report the 6 | // correct version. 7 | // 1. /meson.build 8 | // 2. /include/json/version.h 9 | // 3. /CMakeLists.txt 10 | // IMPORTANT: also update the SOVERSION!! 11 | 12 | #define JSONCPP_VERSION_STRING "1.9.3" 13 | #define JSONCPP_VERSION_MAJOR 1 14 | #define JSONCPP_VERSION_MINOR 9 15 | #define JSONCPP_VERSION_PATCH 3 16 | #define JSONCPP_VERSION_QUALIFIER 17 | #define JSONCPP_VERSION_HEXA \ 18 | ((JSONCPP_VERSION_MAJOR << 24) | (JSONCPP_VERSION_MINOR << 16) | \ 19 | (JSONCPP_VERSION_PATCH << 8)) 20 | 21 | #ifdef JSONCPP_USING_SECURE_MEMORY 22 | #undef JSONCPP_USING_SECURE_MEMORY 23 | #endif 24 | #define JSONCPP_USING_SECURE_MEMORY 0 25 | // If non-zero, the library zeroes any memory that it has allocated before 26 | // it frees its memory. 27 | 28 | #endif // JSON_VERSION_H_INCLUDED 29 | -------------------------------------------------------------------------------- /BDSNetRunner/json/include/json/writer.h: -------------------------------------------------------------------------------- 1 | // Copyright 2007-2010 Baptiste Lepilleur and The JsonCpp Authors 2 | // Distributed under MIT license, or public domain if desired and 3 | // recognized in your jurisdiction. 4 | // See file LICENSE for detail or copy at http://jsoncpp.sourceforge.net/LICENSE 5 | 6 | #ifndef JSON_WRITER_H_INCLUDED 7 | #define JSON_WRITER_H_INCLUDED 8 | 9 | #if !defined(JSON_IS_AMALGAMATION) 10 | #include "value.h" 11 | #endif // if !defined(JSON_IS_AMALGAMATION) 12 | #include 13 | #include 14 | #include 15 | 16 | // Disable warning C4251: : needs to have dll-interface to 17 | // be used by... 18 | #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) && defined(_MSC_VER) 19 | #pragma warning(push) 20 | #pragma warning(disable : 4251) 21 | #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 22 | 23 | #pragma pack(push, 8) 24 | 25 | namespace Json { 26 | 27 | class Value; 28 | 29 | /** 30 | * 31 | * Usage: 32 | * \code 33 | * using namespace Json; 34 | * void writeToStdout(StreamWriter::Factory const& factory, Value const& value) 35 | * { std::unique_ptr const writer( factory.newStreamWriter()); 36 | * writer->write(value, &std::cout); 37 | * std::cout << std::endl; // add lf and flush 38 | * } 39 | * \endcode 40 | */ 41 | class JSON_API StreamWriter { 42 | protected: 43 | OStream* sout_; // not owned; will not delete 44 | public: 45 | StreamWriter(); 46 | virtual ~StreamWriter(); 47 | /** Write Value into document as configured in sub-class. 48 | * Do not take ownership of sout, but maintain a reference during function. 49 | * \pre sout != NULL 50 | * \return zero on success (For now, we always return zero, so check the 51 | * stream instead.) \throw std::exception possibly, depending on 52 | * configuration 53 | */ 54 | virtual int write(Value const& root, OStream* sout) = 0; 55 | 56 | /** \brief A simple abstract factory. 57 | */ 58 | class JSON_API Factory { 59 | public: 60 | virtual ~Factory(); 61 | /** \brief Allocate a CharReader via operator new(). 62 | * \throw std::exception if something goes wrong (e.g. invalid settings) 63 | */ 64 | virtual StreamWriter* newStreamWriter() const = 0; 65 | }; // Factory 66 | }; // StreamWriter 67 | 68 | /** \brief Write into stringstream, then return string, for convenience. 69 | * A StreamWriter will be created from the factory, used, and then deleted. 70 | */ 71 | String JSON_API writeString(StreamWriter::Factory const& factory, 72 | Value const& root); 73 | 74 | /** \brief Build a StreamWriter implementation. 75 | 76 | * Usage: 77 | * \code 78 | * using namespace Json; 79 | * Value value = ...; 80 | * StreamWriterBuilder builder; 81 | * builder["commentStyle"] = "None"; 82 | * builder["indentation"] = " "; // or whatever you like 83 | * std::unique_ptr writer( 84 | * builder.newStreamWriter()); 85 | * writer->write(value, &std::cout); 86 | * std::cout << std::endl; // add lf and flush 87 | * \endcode 88 | */ 89 | class JSON_API StreamWriterBuilder : public StreamWriter::Factory { 90 | public: 91 | // Note: We use a Json::Value so that we can add data-members to this class 92 | // without a major version bump. 93 | /** Configuration of this builder. 94 | * Available settings (case-sensitive): 95 | * - "commentStyle": "None" or "All" 96 | * - "indentation": "". 97 | * - Setting this to an empty string also omits newline characters. 98 | * - "enableYAMLCompatibility": false or true 99 | * - slightly change the whitespace around colons 100 | * - "dropNullPlaceholders": false or true 101 | * - Drop the "null" string from the writer's output for nullValues. 102 | * Strictly speaking, this is not valid JSON. But when the output is being 103 | * fed to a browser's JavaScript, it makes for smaller output and the 104 | * browser can handle the output just fine. 105 | * - "useSpecialFloats": false or true 106 | * - If true, outputs non-finite floating point values in the following way: 107 | * NaN values as "NaN", positive infinity as "Infinity", and negative 108 | * infinity as "-Infinity". 109 | * - "precision": int 110 | * - Number of precision digits for formatting of real values. 111 | * - "precisionType": "significant"(default) or "decimal" 112 | * - Type of precision for formatting of real values. 113 | 114 | * You can examine 'settings_` yourself 115 | * to see the defaults. You can also write and read them just like any 116 | * JSON Value. 117 | * \sa setDefaults() 118 | */ 119 | Json::Value settings_; 120 | 121 | StreamWriterBuilder(); 122 | ~StreamWriterBuilder() override; 123 | 124 | /** 125 | * \throw std::exception if something goes wrong (e.g. invalid settings) 126 | */ 127 | StreamWriter* newStreamWriter() const override; 128 | 129 | /** \return true if 'settings' are legal and consistent; 130 | * otherwise, indicate bad settings via 'invalid'. 131 | */ 132 | bool validate(Json::Value* invalid) const; 133 | /** A simple way to update a specific setting. 134 | */ 135 | Value& operator[](const String& key); 136 | 137 | /** Called by ctor, but you can use this to reset settings_. 138 | * \pre 'settings' != NULL (but Json::null is fine) 139 | * \remark Defaults: 140 | * \snippet src/lib_json/json_writer.cpp StreamWriterBuilderDefaults 141 | */ 142 | static void setDefaults(Json::Value* settings); 143 | }; 144 | 145 | /** \brief Abstract class for writers. 146 | * \deprecated Use StreamWriter. (And really, this is an implementation detail.) 147 | */ 148 | class JSONCPP_DEPRECATED("Use StreamWriter instead") JSON_API Writer { 149 | public: 150 | virtual ~Writer(); 151 | 152 | virtual String write(const Value& root) = 0; 153 | }; 154 | 155 | /** \brief Outputs a Value in JSON format 156 | *without formatting (not human friendly). 157 | * 158 | * The JSON document is written in a single line. It is not intended for 'human' 159 | *consumption, 160 | * but may be useful to support feature such as RPC where bandwidth is limited. 161 | * \sa Reader, Value 162 | * \deprecated Use StreamWriterBuilder. 163 | */ 164 | #if defined(_MSC_VER) 165 | #pragma warning(push) 166 | #pragma warning(disable : 4996) // Deriving from deprecated class 167 | #endif 168 | class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API FastWriter 169 | : public Writer { 170 | public: 171 | FastWriter(); 172 | ~FastWriter() override = default; 173 | 174 | void enableYAMLCompatibility(); 175 | 176 | /** \brief Drop the "null" string from the writer's output for nullValues. 177 | * Strictly speaking, this is not valid JSON. But when the output is being 178 | * fed to a browser's JavaScript, it makes for smaller output and the 179 | * browser can handle the output just fine. 180 | */ 181 | void dropNullPlaceholders(); 182 | 183 | void omitEndingLineFeed(); 184 | 185 | public: // overridden from Writer 186 | String write(const Value& root) override; 187 | 188 | private: 189 | void writeValue(const Value& value); 190 | 191 | String document_; 192 | bool yamlCompatibilityEnabled_{false}; 193 | bool dropNullPlaceholders_{false}; 194 | bool omitEndingLineFeed_{false}; 195 | }; 196 | #if defined(_MSC_VER) 197 | #pragma warning(pop) 198 | #endif 199 | 200 | /** \brief Writes a Value in JSON format in a 201 | *human friendly way. 202 | * 203 | * The rules for line break and indent are as follow: 204 | * - Object value: 205 | * - if empty then print {} without indent and line break 206 | * - if not empty the print '{', line break & indent, print one value per 207 | *line 208 | * and then unindent and line break and print '}'. 209 | * - Array value: 210 | * - if empty then print [] without indent and line break 211 | * - if the array contains no object value, empty array or some other value 212 | *types, 213 | * and all the values fit on one lines, then print the array on a single 214 | *line. 215 | * - otherwise, it the values do not fit on one line, or the array contains 216 | * object or non empty array, then print one value per line. 217 | * 218 | * If the Value have comments then they are outputed according to their 219 | *#CommentPlacement. 220 | * 221 | * \sa Reader, Value, Value::setComment() 222 | * \deprecated Use StreamWriterBuilder. 223 | */ 224 | #if defined(_MSC_VER) 225 | #pragma warning(push) 226 | #pragma warning(disable : 4996) // Deriving from deprecated class 227 | #endif 228 | class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API 229 | StyledWriter : public Writer { 230 | public: 231 | StyledWriter(); 232 | ~StyledWriter() override = default; 233 | 234 | public: // overridden from Writer 235 | /** \brief Serialize a Value in JSON format. 236 | * \param root Value to serialize. 237 | * \return String containing the JSON document that represents the root value. 238 | */ 239 | String write(const Value& root) override; 240 | 241 | private: 242 | void writeValue(const Value& value); 243 | void writeArrayValue(const Value& value); 244 | bool isMultilineArray(const Value& value); 245 | void pushValue(const String& value); 246 | void writeIndent(); 247 | void writeWithIndent(const String& value); 248 | void indent(); 249 | void unindent(); 250 | void writeCommentBeforeValue(const Value& root); 251 | void writeCommentAfterValueOnSameLine(const Value& root); 252 | static bool hasCommentForValue(const Value& value); 253 | static String normalizeEOL(const String& text); 254 | 255 | using ChildValues = std::vector; 256 | 257 | ChildValues childValues_; 258 | String document_; 259 | String indentString_; 260 | unsigned int rightMargin_{74}; 261 | unsigned int indentSize_{3}; 262 | bool addChildValues_{false}; 263 | }; 264 | #if defined(_MSC_VER) 265 | #pragma warning(pop) 266 | #endif 267 | 268 | /** \brief Writes a Value in JSON format in a 269 | human friendly way, 270 | to a stream rather than to a string. 271 | * 272 | * The rules for line break and indent are as follow: 273 | * - Object value: 274 | * - if empty then print {} without indent and line break 275 | * - if not empty the print '{', line break & indent, print one value per 276 | line 277 | * and then unindent and line break and print '}'. 278 | * - Array value: 279 | * - if empty then print [] without indent and line break 280 | * - if the array contains no object value, empty array or some other value 281 | types, 282 | * and all the values fit on one lines, then print the array on a single 283 | line. 284 | * - otherwise, it the values do not fit on one line, or the array contains 285 | * object or non empty array, then print one value per line. 286 | * 287 | * If the Value have comments then they are outputed according to their 288 | #CommentPlacement. 289 | * 290 | * \sa Reader, Value, Value::setComment() 291 | * \deprecated Use StreamWriterBuilder. 292 | */ 293 | #if defined(_MSC_VER) 294 | #pragma warning(push) 295 | #pragma warning(disable : 4996) // Deriving from deprecated class 296 | #endif 297 | class JSONCPP_DEPRECATED("Use StreamWriterBuilder instead") JSON_API 298 | StyledStreamWriter { 299 | public: 300 | /** 301 | * \param indentation Each level will be indented by this amount extra. 302 | */ 303 | StyledStreamWriter(String indentation = "\t"); 304 | ~StyledStreamWriter() = default; 305 | 306 | public: 307 | /** \brief Serialize a Value in JSON format. 308 | * \param out Stream to write to. (Can be ostringstream, e.g.) 309 | * \param root Value to serialize. 310 | * \note There is no point in deriving from Writer, since write() should not 311 | * return a value. 312 | */ 313 | void write(OStream& out, const Value& root); 314 | 315 | private: 316 | void writeValue(const Value& value); 317 | void writeArrayValue(const Value& value); 318 | bool isMultilineArray(const Value& value); 319 | void pushValue(const String& value); 320 | void writeIndent(); 321 | void writeWithIndent(const String& value); 322 | void indent(); 323 | void unindent(); 324 | void writeCommentBeforeValue(const Value& root); 325 | void writeCommentAfterValueOnSameLine(const Value& root); 326 | static bool hasCommentForValue(const Value& value); 327 | static String normalizeEOL(const String& text); 328 | 329 | using ChildValues = std::vector; 330 | 331 | ChildValues childValues_; 332 | OStream* document_; 333 | String indentString_; 334 | unsigned int rightMargin_{74}; 335 | String indentation_; 336 | bool addChildValues_ : 1; 337 | bool indented_ : 1; 338 | }; 339 | #if defined(_MSC_VER) 340 | #pragma warning(pop) 341 | #endif 342 | 343 | #if defined(JSON_HAS_INT64) 344 | String JSON_API valueToString(Int value); 345 | String JSON_API valueToString(UInt value); 346 | #endif // if defined(JSON_HAS_INT64) 347 | String JSON_API valueToString(LargestInt value); 348 | String JSON_API valueToString(LargestUInt value); 349 | String JSON_API valueToString( 350 | double value, unsigned int precision = Value::defaultRealPrecision, 351 | PrecisionType precisionType = PrecisionType::significantDigits); 352 | String JSON_API valueToString(bool value); 353 | String JSON_API valueToQuotedString(const char* value); 354 | 355 | /// \brief Output using the StyledStreamWriter. 356 | /// \see Json::operator>>() 357 | JSON_API OStream& operator<<(OStream&, const Value& root); 358 | 359 | } // namespace Json 360 | 361 | #pragma pack(pop) 362 | 363 | #if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 364 | #pragma warning(pop) 365 | #endif // if defined(JSONCPP_DISABLE_DLL_INTERFACE_WARNING) 366 | 367 | #endif // JSON_WRITER_H_INCLUDED 368 | -------------------------------------------------------------------------------- /BDSNetRunner/json/lib/jsoncpp.lib: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/json/lib/jsoncpp.lib -------------------------------------------------------------------------------- /BDSNetRunner/mod.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/mod.cpp -------------------------------------------------------------------------------- /BDSNetRunner/mod.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/mod.h -------------------------------------------------------------------------------- /BDSNetRunner/pch.cpp: -------------------------------------------------------------------------------- 1 | // pch.cpp: 与预编译标头对应的源文件 2 | 3 | #include "pch.h" 4 | 5 | // 当使用预编译的头时,需要使用此源文件,编译才能成功。 6 | -------------------------------------------------------------------------------- /BDSNetRunner/pch.h: -------------------------------------------------------------------------------- 1 | // pch.h: 这是预编译标头文件。 2 | // 下方列出的文件仅编译一次,提高了将来生成的生成性能。 3 | // 这还将影响 IntelliSense 性能,包括代码完成和许多代码浏览功能。 4 | // 但是,如果此处列出的文件中的任何一个在生成之间有更新,它们全部都将被重新编译。 5 | // 请勿在此处添加要频繁更新的文件,这将使得性能优势无效。 6 | 7 | #ifndef PCH_H 8 | #define PCH_H 9 | 10 | // 添加要在此处预编译的标头 11 | #include "framework.h" 12 | 13 | #endif //PCH_H 14 | -------------------------------------------------------------------------------- /BDSNetRunner/scoreboard/scoreboard.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/scoreboard/scoreboard.cpp -------------------------------------------------------------------------------- /BDSNetRunner/scoreboard/scoreboard.hpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/scoreboard/scoreboard.hpp -------------------------------------------------------------------------------- /BDSNetRunner/tick/tick.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/tick/tick.cpp -------------------------------------------------------------------------------- /BDSNetRunner/tick/tick.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/zhkj-liuxiaohua/BDSNetRunner/cba0ad49f2a9169e9747eda34c9dce692de6fb8d/BDSNetRunner/tick/tick.h -------------------------------------------------------------------------------- /CSRDemo/BDS/Component.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Runtime.InteropServices; 4 | 5 | namespace CSR 6 | { 7 | public enum ActorDamageCause : int 8 | { 9 | Override = 0x0, 10 | Contact = 0x1, 11 | EntityAttack = 0x2, 12 | Projectile = 0x3, 13 | Suffocation = 0x4, 14 | Fall = 0x5, 15 | Fire = 0x6, 16 | FireTick = 0x7, 17 | Lava = 0x8, 18 | Drowning = 0x9, 19 | BlockExplosion = 0x0A, 20 | EntityExplosion = 0x0B, 21 | Void = 0x0C, 22 | Suicide = 0x0D, 23 | Magic = 0x0E, 24 | Wither = 0x0F, 25 | Starve = 0x10, 26 | Anvil = 0x11, 27 | Thorns = 0x12, 28 | FallingBlock = 0x13, 29 | Piston = 0x14, 30 | FlyIntoWall = 0x15, 31 | Magma = 0x16, 32 | Fireworks = 0x17, 33 | Lightning = 0x18, 34 | Charging = 0x19, 35 | Temperature = 0x1A, 36 | All = 0x1F, 37 | None = -0x01 38 | } 39 | 40 | /// 41 | /// 实体类 42 | /// 43 | public class CsActor 44 | { 45 | const string ENTITY_GET_ARMOR_CONTAINER = "entity.get_armor_container"; 46 | const string ENTITY_GET_ATTACK = "entity.get_attack"; 47 | const string ENTITY_SET_ATTACK = "entity.set_attack"; 48 | const string ENTITY_GET_COLLISION_BOX = "entity.get_collision_box"; 49 | const string ENTITY_SET_COLLISION_BOX = "entity.set_collision_box"; 50 | const string ENTITY_GET_HAND_CONTAINER = "entity.get_hand_container"; 51 | const string ENTITY_GET_HEALTH = "entity.get_health"; 52 | const string ENTITY_SET_HEALTH = "entity.set_health"; 53 | const string ENTITY_GET_INVENTORY_CONTAINER = "entity.get_inventory_container"; 54 | const string ENTITY_GET_NAME = "entity.get_name"; 55 | const string ENTITY_SET_NAME = "entity.set_name"; 56 | const string ENTITY_GET_POSITION = "entity.get_position"; 57 | const string ENTITY_SET_POSITION = "entity.set_position"; 58 | const string ENTITY_GET_ROTATION = "entity.get_rotation"; 59 | const string ENTITY_SET_ROTATION = "entity.set_rotation"; 60 | const string ENTITY_GET_DIMENSIONID = "entity.get_dimensionid"; 61 | const string ENTITY_GET_TYPEID = "entity.get_typeid"; 62 | const string ENTITY_GET_UNIQUEID = "entity.get_uniqueid"; 63 | const string ENTITY_REMOVE = "entity.remove"; 64 | const string ENTITY_HURT = "entity.hurt"; 65 | #region 非社区内容 66 | const string ENTITY_GET_ABILITIES = "entity.get_abilities"; 67 | const string ENTITY_SET_ABILITIES = "entity.set_abilities"; 68 | const string ENTITY_GET_ATTRIBUTES = "entity.get_attributes"; 69 | const string ENTITY_SET_ATTRIBUTES = "entity.set_attributes"; 70 | const string ENTITY_GET_MAXATTRIBUTES = "entity.get_maxattributes"; 71 | const string ENTITY_SET_MAXATTRIBUTES = "entity.set_maxattributes"; 72 | const string ENTITY_GET_EFFECTS = "entity.get_effects"; 73 | const string ENTITY_SET_EFFECTS = "entity.set_effects"; 74 | #endregion 75 | const string LEVEL_GETFROM_UNIQUEID = "level.getfrom_uniqueid"; 76 | const string LEVEL_GETSFROM_AABB = "level.getsfrom_aabb"; 77 | 78 | protected delegate Std_String AGET(IntPtr p); 79 | protected delegate int AGETDIMENSIONID(IntPtr p); 80 | protected delegate bool ASET(IntPtr p, string s); 81 | protected delegate bool ASETNAME(IntPtr p, string n, bool a); 82 | protected delegate ulong AGETUNIQUEID(IntPtr p); 83 | protected delegate bool AREMOVE(IntPtr p); 84 | protected delegate bool AHURT(IntPtr p, IntPtr sp, ActorDamageCause cause, int count, bool knock, bool ignite); 85 | protected delegate IntPtr AGETFROMUNIQUEID(ulong i); 86 | protected delegate IntPtr AGETSFROMAABB(int did, float x1, float y1, float z1, float x2, float y2, float z2); 87 | static protected AGET egetArmorContainer; 88 | static protected AGET egetAttack; 89 | static protected ASET esetAttack; 90 | static protected AGET egetCollisionBox; 91 | static protected ASET esetCollisionBox; 92 | static protected AGET egetHandContainer; 93 | static protected AGET egetHealth; 94 | static protected ASET esetHealth; 95 | static protected AGET egetInventoryContainer; 96 | static protected AGET egetName; 97 | static protected ASETNAME esetName; 98 | static protected AGET egetPosition; 99 | static protected ASET esetPosition; 100 | static protected AGET egetRotation; 101 | static protected ASET esetRotation; 102 | static protected AGETDIMENSIONID egetDimensionId; 103 | static protected AGETDIMENSIONID egetTypeId; 104 | static protected AGETUNIQUEID egetUniqueId; 105 | static protected AREMOVE eremove; 106 | static protected AHURT ehurt; 107 | #region 非社区内容 108 | static protected AGET egetAbilities; 109 | static protected ASET esetAbilities; 110 | static protected AGET egetAttributes; 111 | static protected ASET esetAttributes; 112 | static protected AGET egetMaxAttributes; 113 | static protected ASET esetMaxAttributes; 114 | static protected AGET egetEffects; 115 | static protected ASET esetEffects; 116 | #endregion 117 | static protected AGETFROMUNIQUEID egetFromUniqueId; 118 | static protected AGETSFROMAABB egetsFromAABB; 119 | static bool entityApiInited = false; 120 | 121 | static protected bool initEntityAPI(MCCSAPI api) 122 | { 123 | if (!entityApiInited) 124 | { 125 | if (api != null) 126 | { 127 | egetArmorContainer = api.ConvertComponentFunc(ENTITY_GET_ARMOR_CONTAINER); 128 | egetAttack = api.ConvertComponentFunc(ENTITY_GET_ATTACK); 129 | esetAttack = api.ConvertComponentFunc(ENTITY_SET_ATTACK); 130 | egetCollisionBox = api.ConvertComponentFunc(ENTITY_GET_COLLISION_BOX); 131 | esetCollisionBox = api.ConvertComponentFunc(ENTITY_SET_COLLISION_BOX); 132 | egetHandContainer = api.ConvertComponentFunc(ENTITY_GET_HAND_CONTAINER); 133 | egetHealth = api.ConvertComponentFunc(ENTITY_GET_HEALTH); 134 | esetHealth = api.ConvertComponentFunc(ENTITY_SET_HEALTH); 135 | egetInventoryContainer = api.ConvertComponentFunc(ENTITY_GET_INVENTORY_CONTAINER); 136 | egetName = api.ConvertComponentFunc(ENTITY_GET_NAME); 137 | esetName = api.ConvertComponentFunc(ENTITY_SET_NAME); 138 | egetPosition = api.ConvertComponentFunc(ENTITY_GET_POSITION); 139 | esetPosition = api.ConvertComponentFunc(ENTITY_SET_POSITION); 140 | egetRotation = api.ConvertComponentFunc(ENTITY_GET_ROTATION); 141 | esetRotation = api.ConvertComponentFunc(ENTITY_SET_ROTATION); 142 | egetDimensionId = api.ConvertComponentFunc(ENTITY_GET_DIMENSIONID); 143 | egetTypeId = api.ConvertComponentFunc(ENTITY_GET_TYPEID); 144 | egetUniqueId = api.ConvertComponentFunc(ENTITY_GET_UNIQUEID); 145 | eremove = api.ConvertComponentFunc(ENTITY_REMOVE); 146 | ehurt = api.ConvertComponentFunc(ENTITY_HURT); 147 | if (api.COMMERCIAL) 148 | { // 非社区内容 149 | egetAbilities = api.ConvertComponentFunc(ENTITY_GET_ABILITIES); 150 | esetAbilities = api.ConvertComponentFunc(ENTITY_SET_ABILITIES); 151 | egetAttributes = api.ConvertComponentFunc(ENTITY_GET_ATTRIBUTES); 152 | esetAttributes = api.ConvertComponentFunc(ENTITY_SET_ATTRIBUTES); 153 | egetMaxAttributes = api.ConvertComponentFunc(ENTITY_GET_MAXATTRIBUTES); 154 | esetMaxAttributes = api.ConvertComponentFunc(ENTITY_SET_MAXATTRIBUTES); 155 | egetEffects = api.ConvertComponentFunc(ENTITY_GET_EFFECTS); 156 | esetEffects = api.ConvertComponentFunc(ENTITY_SET_EFFECTS); 157 | } 158 | egetFromUniqueId = api.ConvertComponentFunc(LEVEL_GETFROM_UNIQUEID); 159 | egetsFromAABB = api.ConvertComponentFunc(LEVEL_GETSFROM_AABB); 160 | entityApiInited = true; 161 | } else 162 | { 163 | return false; 164 | } 165 | } 166 | return true; 167 | } 168 | 169 | static protected MCCSAPI mapi; 170 | protected IntPtr ptr; 171 | 172 | public CsActor(MCCSAPI api, IntPtr e) 173 | { 174 | if (mapi == null) 175 | mapi = api; 176 | ptr = e; 177 | initEntityAPI(api); 178 | } 179 | 180 | /// 181 | /// 装备栏 182 | /// 183 | public string ArmorContainer { get 184 | { 185 | if (ptr != null && ptr != IntPtr.Zero) 186 | { 187 | Std_String s = egetArmorContainer(ptr); 188 | return StrTool.c_str(s); 189 | } 190 | return null; 191 | } } 192 | /// 193 | /// 攻击力 194 | /// 195 | public string Attack { get 196 | { 197 | if (ptr != null && ptr != IntPtr.Zero) 198 | { 199 | Std_String s = egetAttack(ptr); 200 | return StrTool.c_str(s); 201 | } 202 | return null; 203 | } set { 204 | if (ptr != null && ptr != IntPtr.Zero) 205 | { 206 | esetAttack(ptr, value); 207 | } 208 | } 209 | } 210 | /// 211 | /// 碰撞箱 212 | /// 213 | public string CollisionBox { get 214 | { 215 | if (ptr != null && ptr != IntPtr.Zero) 216 | { 217 | Std_String s = egetCollisionBox(ptr); 218 | return StrTool.c_str(s); 219 | } 220 | return null; 221 | } set 222 | { 223 | if (ptr != null && ptr != IntPtr.Zero) 224 | { 225 | esetCollisionBox(ptr, value); 226 | } 227 | } 228 | } 229 | /// 230 | /// 主副手栏 231 | /// 232 | public string HandContainer 233 | { 234 | get 235 | { 236 | if (ptr != null && ptr != IntPtr.Zero) 237 | { 238 | Std_String s = egetHandContainer(ptr); 239 | return StrTool.c_str(s); 240 | } 241 | return null; 242 | } 243 | } 244 | /// 245 | /// 生命值 246 | /// 247 | public string Health { get 248 | { 249 | if (ptr != null && ptr != IntPtr.Zero) 250 | { 251 | Std_String s = egetHealth(ptr); 252 | return StrTool.c_str(s); 253 | } 254 | return null; 255 | } 256 | set 257 | { 258 | if (ptr != null && ptr != IntPtr.Zero) 259 | { 260 | esetHealth(ptr, value); 261 | } 262 | } 263 | } 264 | /// 265 | /// 背包列表 266 | /// 267 | public string InventoryContainer 268 | { 269 | get 270 | { 271 | if (ptr != null && ptr != IntPtr.Zero) 272 | { 273 | Std_String s = egetInventoryContainer(ptr); 274 | return StrTool.c_str(s); 275 | } 276 | return null; 277 | } 278 | } 279 | /// 280 | /// 获取名字 281 | /// 282 | /// 283 | public string getName() 284 | { 285 | if (ptr != null && ptr != IntPtr.Zero) 286 | { 287 | Std_String s = egetName(ptr); 288 | return StrTool.c_str(s); 289 | } 290 | return null; 291 | } 292 | /// 293 | /// 设置名字及显示属性 294 | /// 295 | /// 名字 296 | /// 是否常显示 297 | /// 298 | public bool setName(string nname, bool alwaysShow) 299 | { 300 | if (ptr != null && ptr != IntPtr.Zero) 301 | { 302 | return esetName(ptr, nname, alwaysShow); 303 | } 304 | return false; 305 | } 306 | /// 307 | /// 实体所在坐标 308 | /// 309 | public string Position 310 | { 311 | get 312 | { 313 | if (ptr != null && ptr != IntPtr.Zero) 314 | { 315 | Std_String s = egetPosition(ptr); 316 | return StrTool.c_str(s); 317 | } 318 | return null; 319 | } 320 | set 321 | { 322 | if (ptr != null && ptr != IntPtr.Zero) 323 | { 324 | esetPosition(ptr, value); 325 | } 326 | } 327 | } 328 | /// 329 | /// 实体转角属性 330 | /// 331 | public string Rotation 332 | { 333 | get 334 | { 335 | if (ptr != null && ptr != IntPtr.Zero) 336 | { 337 | Std_String s = egetRotation(ptr); 338 | return StrTool.c_str(s); 339 | } 340 | return null; 341 | } 342 | set 343 | { 344 | if (ptr != null && ptr != IntPtr.Zero) 345 | { 346 | esetRotation(ptr, value); 347 | } 348 | } 349 | } 350 | /// 351 | /// 维度ID 352 | /// 353 | public int DimensionId { get 354 | { 355 | if (ptr != null && ptr != IntPtr.Zero) 356 | { 357 | return egetDimensionId(ptr); 358 | } 359 | return -1; 360 | } } 361 | /// 362 | /// 实体类型ID 363 | /// 364 | public int TypeId 365 | { 366 | get 367 | { 368 | if (ptr != null && ptr != IntPtr.Zero) 369 | { 370 | return egetTypeId(ptr); 371 | } 372 | return 1; 373 | } 374 | } 375 | /// 376 | /// 查询ID 377 | /// 378 | public ulong UniqueId { get 379 | { 380 | if (ptr != null && ptr != IntPtr.Zero) 381 | { 382 | return egetUniqueId(ptr); 383 | } 384 | return 0; 385 | } } 386 | /// 387 | /// 从地图中移除该实体 388 | /// 389 | /// 是否移除成功 390 | public bool remove() 391 | { 392 | if (ptr != null && ptr != IntPtr.Zero) 393 | { 394 | bool ret = eremove(ptr); 395 | if (ret) 396 | { 397 | ptr = IntPtr.Zero; 398 | return ret; 399 | } 400 | } 401 | return false; 402 | } 403 | /// 404 | /// 模拟产生一个由源实体发出的伤害 405 | /// 406 | /// 源实体 407 | /// 伤害类型 408 | /// 具体伤害数值 409 | /// 是否产生击退 410 | /// 是否产生火焰附加 411 | /// 是否伤害成功 412 | public bool hurt(IntPtr sourceActor, ActorDamageCause cause, int count, bool knock, bool ignite) 413 | { 414 | if (ptr != null && ptr != IntPtr.Zero) 415 | { 416 | return ehurt != null && ehurt(ptr, sourceActor, cause, count, knock, ignite); 417 | } 418 | return false; 419 | } 420 | 421 | #region 非社区内容 422 | /// 423 | /// 实体能力值列表 424 | /// 425 | public string Abilities 426 | { 427 | get 428 | { 429 | if (ptr != null && ptr != IntPtr.Zero) 430 | { 431 | if (egetAbilities != null) 432 | { 433 | Std_String str = egetAbilities(ptr); 434 | return StrTool.c_str(str); 435 | } 436 | } 437 | return ""; 438 | } 439 | set 440 | { 441 | if (ptr != null && ptr != IntPtr.Zero) 442 | { 443 | if (esetAbilities != null) 444 | esetAbilities(ptr, value); 445 | } 446 | } 447 | } 448 | /// 449 | /// 实体属性列表 450 | /// 451 | public string Attributes 452 | { 453 | get 454 | { 455 | if (ptr != null && ptr != IntPtr.Zero) 456 | { 457 | if (egetAttributes != null) 458 | { 459 | Std_String str = egetAttributes(ptr); 460 | return StrTool.c_str(str); 461 | } 462 | } 463 | return ""; 464 | } 465 | set 466 | { 467 | if (ptr != null && ptr != IntPtr.Zero) 468 | { 469 | if (esetAttributes != null) 470 | esetAttributes(ptr, value); 471 | } 472 | } 473 | } 474 | /// 475 | /// 实体属性最大值列表 476 | /// 477 | public string MaxAttributes 478 | { 479 | get 480 | { 481 | if (ptr != null && ptr != IntPtr.Zero) 482 | { 483 | if (egetMaxAttributes != null) 484 | { 485 | Std_String str = egetMaxAttributes(ptr); 486 | return StrTool.c_str(str); 487 | } 488 | } 489 | return ""; 490 | } 491 | set 492 | { 493 | if (ptr != null && ptr != IntPtr.Zero) 494 | { 495 | if (esetMaxAttributes != null) 496 | esetMaxAttributes(ptr, value); 497 | } 498 | } 499 | } 500 | /// 501 | /// 实体所有效果状态列表 502 | /// 503 | public string Effects 504 | { 505 | get 506 | { 507 | if (ptr != null && ptr != IntPtr.Zero) 508 | { 509 | if (egetEffects != null) 510 | { 511 | Std_String str = egetEffects(ptr); 512 | return StrTool.c_str(str); 513 | } 514 | } 515 | return ""; 516 | } 517 | set 518 | { 519 | if (ptr != null && ptr != IntPtr.Zero) 520 | { 521 | if (esetEffects != null) 522 | esetEffects(ptr, value); 523 | } 524 | } 525 | } 526 | #endregion 527 | 528 | /// 529 | /// 从查询ID处反查一个实体(或玩家) 530 | /// 531 | /// 532 | /// 533 | public static CsActor getFromUniqueId(MCCSAPI api, ulong id) 534 | { 535 | if (egetFromUniqueId == null) 536 | initEntityAPI(api); 537 | IntPtr p = egetFromUniqueId(id); 538 | if (p != null && p != IntPtr.Zero) 539 | { 540 | if (egetTypeId != null && egetTypeId(p) == 319) 541 | return new CsPlayer(api, p); 542 | else 543 | return new CsActor(api, p); 544 | } 545 | return null; 546 | } 547 | /// 548 | /// 从指定地图位置查询实体指针列表(不含玩家) 549 | /// 550 | /// 551 | /// 维度ID 552 | /// 553 | /// 554 | /// 555 | /// 556 | /// 557 | /// 558 | /// 实体指针列表 559 | public static ArrayList getsFromAABB(MCCSAPI api, int did, float x1, float y1, float z1, float x2, float y2, float z2) { 560 | if (egetsFromAABB == null) 561 | initEntityAPI(api); 562 | IntPtr pv = egetsFromAABB(did, x1, y1, z1, x2, y2, z2); 563 | if (pv != null && pv != IntPtr.Zero) { 564 | try { 565 | return ((Std_Vector)Marshal.PtrToStructure(pv, typeof(Std_Vector))).toList(); 566 | } 567 | catch { } 568 | } 569 | return null; 570 | } 571 | } 572 | 573 | /// 574 | /// 玩家类 575 | /// 576 | public class CsPlayer : CsActor 577 | { 578 | const string PLAYER_GET_HOTBAR_CONTAINER = "player.get_hotbar_container"; 579 | const string PLAYER_GET_UUID = "player.get_uuid"; 580 | const string PLAYER_GET_IPPORT = "player.get_ipport"; 581 | const string PLAYER_ADD_LEVEL = "player.add_level"; 582 | const string PLAYER_GET_SCOREID = "player.get_scoreboardid"; 583 | const string PLAYER_CREATE_SCOREID = "player.create_scoreboardid"; 584 | const string LEVEL_GETPLFROM_AABB = "level.getplfrom_aabb"; 585 | #region 非社区内容 586 | const string PLAYER_GET_STORAGEID = "player.get_storageid"; 587 | #endregion 588 | 589 | protected delegate bool PADDLEVEL(IntPtr p, int lv); 590 | protected delegate long PGETSCOREID(IntPtr p); 591 | static AGET pgetHotbarContainer, pgetServerStorageID; 592 | static AGET pgetUuid; 593 | static AGET pgetIPPort; 594 | static PADDLEVEL paddLevel; 595 | static AGETSFROMAABB pgetplFromAABB; 596 | static PGETSCOREID pgetScoreboardId, pcreateScoreboardId; 597 | static bool playerApiInited = false; 598 | 599 | static private bool initPlayerAPI(MCCSAPI api) 600 | { 601 | if (!playerApiInited) 602 | { 603 | if (api != null) 604 | { 605 | pgetHotbarContainer = api.ConvertComponentFunc(PLAYER_GET_HOTBAR_CONTAINER); 606 | pgetUuid = api.ConvertComponentFunc(PLAYER_GET_UUID); 607 | pgetIPPort = api.ConvertComponentFunc(PLAYER_GET_IPPORT); 608 | paddLevel = api.ConvertComponentFunc(PLAYER_ADD_LEVEL); 609 | pgetScoreboardId = api.ConvertComponentFunc(PLAYER_GET_SCOREID); 610 | pcreateScoreboardId = api.ConvertComponentFunc(PLAYER_CREATE_SCOREID); 611 | pgetplFromAABB = api.ConvertComponentFunc(LEVEL_GETPLFROM_AABB); 612 | if (api.COMMERCIAL) 613 | { // 非社区内容 614 | pgetServerStorageID = api.ConvertComponentFunc(PLAYER_GET_STORAGEID); 615 | } 616 | playerApiInited = true; 617 | } 618 | else 619 | { 620 | return false; 621 | } 622 | } 623 | return true; 624 | } 625 | 626 | public CsPlayer(MCCSAPI api, IntPtr p) : base(api, p) 627 | { 628 | initPlayerAPI(api); 629 | } 630 | /// 631 | /// 获取玩家热键栏 632 | /// 633 | public string HotbarContainer { get 634 | { 635 | if (ptr != null && ptr != IntPtr.Zero) 636 | { 637 | Std_String s = pgetHotbarContainer(ptr); 638 | return StrTool.c_str(s); 639 | } 640 | return null; 641 | } } 642 | /// 643 | /// 获取玩家uuid 644 | /// 645 | public string Uuid { get 646 | { 647 | if (ptr != null && ptr != IntPtr.Zero) 648 | { 649 | Std_String s = pgetUuid(ptr); 650 | return StrTool.c_str(s); 651 | } 652 | return null; 653 | } } 654 | /// 655 | /// 获取玩家IP和端口 656 | /// 657 | public string IpPort { get 658 | { 659 | if (ptr != null && ptr != IntPtr.Zero) 660 | { 661 | Std_String s = pgetIPPort(ptr); 662 | return StrTool.c_str(s); 663 | } 664 | return null; 665 | } } 666 | /// 667 | /// 增加玩家等级 668 | /// 669 | /// 670 | public void addLevel(int lv) 671 | { 672 | if (ptr != null && ptr != IntPtr.Zero) 673 | { 674 | paddLevel(ptr, lv); 675 | } 676 | } 677 | /// 678 | /// 获取玩家对应计分板ID数值 679 | /// 680 | /// 计分板ID值 681 | public long getScoreboardId() 682 | { 683 | return (ptr != null && ptr != IntPtr.Zero) ? 684 | pgetScoreboardId(ptr) : -1; 685 | } 686 | /// 687 | /// 创建玩家对应计分板ID并获取其值 688 | /// 689 | /// 计分板ID值 690 | public long createScoreboardId() 691 | { 692 | return (ptr != null && ptr != IntPtr.Zero) ? 693 | pcreateScoreboardId(ptr) : -1; 694 | } 695 | #region 非社区内容 696 | public string StorageID 697 | { 698 | get 699 | { 700 | return (ptr != null && ptr != IntPtr.Zero) ? 701 | StrTool.c_str(pgetServerStorageID(ptr)) : string.Empty; 702 | } 703 | } 704 | #endregion 705 | /// 706 | /// 从指定地图位置查询玩家指针列表 707 | /// 708 | /// 709 | /// 维度ID 710 | /// 711 | /// 712 | /// 713 | /// 714 | /// 715 | /// 716 | /// 玩家指针列表 717 | public static ArrayList getplFromAABB(MCCSAPI api, int did, float x1, float y1, float z1, float x2, float y2, float z2) 718 | { 719 | if (pgetplFromAABB == null) 720 | initEntityAPI(api); 721 | IntPtr pv = pgetplFromAABB(did, x1, y1, z1, x2, y2, z2); 722 | if (pv != null && pv != IntPtr.Zero) 723 | { 724 | try 725 | { 726 | return ((Std_Vector)Marshal.PtrToStructure(pv, typeof(Std_Vector))).toList(); 727 | } 728 | catch { } 729 | } 730 | return null; 731 | } 732 | } 733 | } 734 | -------------------------------------------------------------------------------- /CSRDemo/BDS/Plugin.cs: -------------------------------------------------------------------------------- 1 | /* 2 | * 由SharpDevelop创建。 3 | * 用户: BDSNetRunner 4 | * 日期: 2020/7/18 5 | * 时间: 12:32 6 | * 7 | * 要改变这种模板请点击 工具|选项|代码编写|编辑标准头文件 8 | */ 9 | using System; 10 | 11 | namespace CSR 12 | { 13 | partial class Plugin 14 | { 15 | private static MCCSAPI mapi = null; 16 | /// 17 | /// 静态api对象 18 | /// 19 | public static MCCSAPI api { get { return mapi; } } 20 | #region 插件统一调用接口,请勿随意更改 21 | public static int onServerStart(string pathandversion) { 22 | string path = null, version = null; 23 | bool commercial = false; 24 | string [] pav = pathandversion.Split(','); 25 | if (pav.Length > 1) { 26 | path = pav[0]; 27 | version = pav[1]; 28 | commercial = (pav[pav.Length - 1] == "1"); 29 | mapi = new MCCSAPI(path, version, commercial); 30 | if (mapi != null) { 31 | onStart(mapi); 32 | GC.KeepAlive(mapi); 33 | return 0; 34 | } 35 | } 36 | Console.WriteLine("Load failed."); 37 | return -1; 38 | } 39 | #endregion 40 | 41 | ~Plugin() 42 | { 43 | //Console.WriteLine("[CSR Plugin] Ref released."); 44 | } 45 | 46 | #region 必要接口 onStart ,由用户实现 47 | // public static void onStart(MCCSAPI api) 48 | #endregion 49 | } 50 | } -------------------------------------------------------------------------------- /CSRDemo/C#插件开发指南.txt: -------------------------------------------------------------------------------- 1 | 本插件开发采用启动器加载framework并调用指定入口方法启动。基本运作机制同JSRunner。 2 | 3 | 1. 创建.net framework类库工程; 4 | 2. 复制模板工程中的BDS文件夹至工程目录; 5 | 3. 在自己的主类里实现 CSR.Plugin.onStart 方法; 6 | 4. 修改工程生成的dll文件后缀名为.csr.dll,放置插件到BDS服务端下的CSR文件夹下即可被插件平台加载运行。 7 | 8 | 自由发挥创意吧! 9 | 10 | 构建注意:建议设置目标框架版本 4 以上,生成目标平台强制为 x64(AMD/Intel 64位处理器)。 -------------------------------------------------------------------------------- /CSRDemo/CSRDemo.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {95E4503B-BF15-499B-B5B2-FC0F3E425A3E} 8 | Library 9 | Properties 10 | CSRDemo 11 | CSRDemo.csr 12 | v4.0 13 | 512 14 | true 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | DEBUG;TRACE 22 | prompt 23 | 4 24 | 25 | 26 | pdbonly 27 | true 28 | bin\Release\ 29 | TRACE 30 | prompt 31 | 4 32 | x64 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | -------------------------------------------------------------------------------- /CSRDemo/Hook.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Runtime.InteropServices; 4 | using System.Threading; 5 | using System.Collections.Generic; 6 | using CSR; 7 | 8 | 9 | namespace CSRDemo 10 | { 11 | /// 12 | /// 此类为hook调用示范类,步骤如下:
13 | /// 1. 定义目标函数原型的托管;
14 | /// 2. 创建函数原型存储指针;
15 | /// 3. 构造新方法,用以替代目标函数;
16 | /// 4. 调用hook,将位于指定RVA位置的目标函数替换为新方法调用。
17 | /// 其它方法可仿照此类进行构造,不再赘述。 18 | ///
19 | public static class THook { 20 | public static Dictionary RVAs = new Dictionary(); 21 | 22 | private static MCCSAPI mcapi = null; 23 | 24 | delegate ulong CMD_REG_Func(ulong a1, ulong a2, ulong a3, byte level, byte f1, byte f2); 25 | private static IntPtr _CS_REGISTERCOMMAND_org = IntPtr.Zero; 26 | /// 27 | /// 新方法,修改注册的命令标识,所有指令全部增加一个无需作弊可用的flag 28 | /// 29 | /// CommandRegistry句柄 30 | /// 指令原型 31 | /// 指令描述 32 | /// 需求op等级 33 | /// 指令属性flag1 34 | /// 指令属性flag2 35 | /// 36 | private static readonly CMD_REG_Func cs_reghookptr = (ulong a1, ulong a2, ulong a3, byte level, byte f1, byte f2) =>{ 37 | f1 |= (byte) MCCSAPI.CommandCheatFlag.NotCheat; 38 | var org = Marshal.GetDelegateForFunctionPointer(_CS_REGISTERCOMMAND_org, typeof(CMD_REG_Func)) as CMD_REG_Func; 39 | return org(a1, a2, a3, level, f1, f2); 40 | }; 41 | 42 | delegate ulong ONCREATEPLAYER_Func(ulong a1, IntPtr a2); 43 | private static IntPtr _CS_ONCREATEPLAYER_org = IntPtr.Zero; 44 | /// 45 | /// 新方法,监听第一个玩家进入游戏,并设置玩家的OP等级 46 | /// 47 | /// ServerScoreboard句柄 48 | /// player指针 49 | /// 50 | private static readonly ONCREATEPLAYER_Func cs_crthookptr = (ulong a1, IntPtr playerptr) =>{ 51 | Console.WriteLine("[c# hook] A player is join."); 52 | if (mcapi != null && string.Compare(mcapi.VERSION, "1.16.40.2") >= 0) { 53 | CsPlayer vp = new CsPlayer(mcapi, playerptr); // player指针或可参与构造组件对象 54 | if (vp != null) 55 | Console.WriteLine("[c# hook] playername={0}", vp.getName()); 56 | } 57 | Symcall.setPermission(mcapi, playerptr, 4); // 若参数为4,则op模式可使用kick、选择器 58 | Thread t = new Thread(releasehook); // 延时卸载钩子,也可于当前线程末尾时机进行卸载,也可不卸载 59 | t.Start(); 60 | ONCREATEPLAYER_Func org = Marshal.GetDelegateForFunctionPointer(_CS_ONCREATEPLAYER_org, typeof(ONCREATEPLAYER_Func)) as ONCREATEPLAYER_Func; 61 | return org(a1, playerptr); 62 | }; 63 | 64 | // 初始化hook 65 | public static void init(MCCSAPI api) { 66 | mcapi = api; 67 | // 改写原始代码数据 68 | if (api.VERSION == "1.16.100.4") 69 | { 70 | byte[] jmp_expplaycheck = { 0xeb, 0x07, 0xF6, 0x00, 0x04, 0xeb, 0x00, 0xeb, 0x00 }; // IDA jmp short + 7 71 | if (api.writeHardMemory(0x0AC36F9, jmp_expplaycheck, 9)) 72 | Console.WriteLine("[C# hack] JS 引擎实验性验证已跳过。"); 73 | else 74 | Console.WriteLine("[C# hack] Some hardcode err excption."); 75 | } 76 | // 初始化RVA,或可远程获取 77 | ArrayList al = new ArrayList(new int[]{0x00B9D4C0, 0x00429850, 0x004ECFD0}); 78 | RVAs["1.16.1.2"] = al; 79 | ArrayList a2 = new ArrayList(new int[] {0x00B9D100, 0x00429820, 0x004ECFA0}); 80 | RVAs["1.16.10.2"] = a2; 81 | ArrayList a3 = new ArrayList(new int[] { 0x00BA3560, 0x0042D250, 0x004F0920 }); 82 | RVAs["1.16.20.3"] = a3; 83 | ArrayList a4 = new ArrayList(new int[] { 0x00BA1200, 0x0042D260, 0x004F0930 }); 84 | RVAs["1.16.40.2"] = a4; 85 | try 86 | { 87 | ArrayList rval = null; 88 | if (RVAs.TryGetValue(api.VERSION, out rval)) { 89 | if (rval != null && rval.Count > 0) { 90 | IntPtr tmpCrtorg = IntPtr.Zero; 91 | api.cshook((int)rval[0], // IDA ServerScoreboard::onPlayerJoined 92 | Marshal.GetFunctionPointerForDelegate(cs_crthookptr), out tmpCrtorg); 93 | _CS_ONCREATEPLAYER_org = tmpCrtorg; 94 | 95 | tmpCrtorg = IntPtr.Zero; 96 | api.cshook((int)rval[1], // IDA CommandRegistry::registerCommand 97 | Marshal.GetFunctionPointerForDelegate(cs_reghookptr), out tmpCrtorg); 98 | _CS_REGISTERCOMMAND_org = tmpCrtorg; 99 | } 100 | } 101 | } catch (Exception e) { 102 | Console.WriteLine(e.StackTrace); 103 | } 104 | } 105 | 106 | // 休眠1s后卸载钩子 107 | private static void releasehook() { 108 | Thread.Sleep(1000); 109 | if (mcapi != null) { 110 | bool unhooked = mcapi.csunhook(Marshal.GetFunctionPointerForDelegate(cs_crthookptr), 111 | ref _CS_ONCREATEPLAYER_org); 112 | if (unhooked) { 113 | Console.WriteLine("[C# unhook] release hook join listen."); 114 | } 115 | } 116 | } 117 | } 118 | 119 | /// 120 | /// 此类为symcall示范类,步骤如下:
121 | /// 1. 创建函数原型;
122 | /// 2. 获取目标RVA位置处的函数指针;
123 | /// 3. 函数调用 124 | ///
125 | public static class Symcall { 126 | 127 | delegate void SETPERMISSION_FUNC(IntPtr p, byte per); 128 | /// 129 | /// SYMCALL方式设置玩家OP等级 130 | /// 131 | /// 132 | /// ServerPlayer指针 133 | /// 等级 134 | public static void setPermission(MCCSAPI api, IntPtr player, byte per) { 135 | Console.WriteLine("[CS] setPlayer OP level to {0}", per); 136 | IntPtr org = api.dlsym((int)THook.RVAs[api.VERSION][2]); // IDA ServerPlayer::setPermissions 137 | SETPERMISSION_FUNC func = (SETPERMISSION_FUNC)Marshal.GetDelegateForFunctionPointer(org, typeof(SETPERMISSION_FUNC)); 138 | func(player, per); 139 | } 140 | } 141 | } 142 | -------------------------------------------------------------------------------- /CSRDemo/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections; 3 | using System.Collections.Generic; 4 | using System.Text; 5 | using CSR; 6 | using System.Web.Script.Serialization; 7 | using System.Threading; 8 | using System.IO; 9 | 10 | namespace CSRDemo 11 | { 12 | class Program { 13 | private static MCCSAPI mcapi = null; 14 | 15 | // 测试用的临时表单ID 16 | private static uint tformid; 17 | 18 | public static void init(MCCSAPI api) { 19 | mcapi = api; 20 | Console.OutputEncoding = Encoding.UTF8; 21 | // 后台指令监听 22 | api.addBeforeActListener(EventKey.onServerCmd, x => { 23 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 24 | var se = BaseEvent.getFrom(x) as ServerCmdEvent; 25 | if (se != null) { 26 | Console.WriteLine("后台指令={0}", se.cmd); 27 | } 28 | return true; 29 | }); 30 | // 后台指令输出监听 31 | api.addBeforeActListener(EventKey.onServerCmdOutput, x => { 32 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 33 | var se = BaseEvent.getFrom(x) as ServerCmdOutputEvent; 34 | if (se != null) { 35 | Console.WriteLine("后台指令输出={0}", se.output); 36 | } 37 | return true; 38 | }); 39 | // 表单选择监听 40 | api.addAfterActListener(EventKey.onFormSelect, x => { 41 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 42 | var fe = BaseEvent.getFrom(x) as FormSelectEvent; 43 | if (fe == null) return true; 44 | if (fe.formid != tformid) 45 | return true; 46 | if (fe.selected != "null"){ 47 | Console.WriteLine("玩家 {0} 选择了表单 id={1} ,selected={2}", fe.playername, fe.formid, fe.selected); 48 | CsPlayer pl = new CsPlayer(api, fe.playerPtr); 49 | if (fe.selected == "0"){ 50 | ulong bkid = pl.UniqueId; 51 | // 根据流水号反查,可能是实体,也可能是玩家 52 | var d = CsActor.getFromUniqueId(api, bkid) as CsPlayer; 53 | if (d != null){ 54 | Console.WriteLine("UniqueId反查成功。"); 55 | pl = d; 56 | } 57 | // 常规组件测试 58 | Console.WriteLine("玩家攻击力组件:{0},玩家碰撞箱组件:{1},玩家生命值组件:{2},玩家位置组件:{3},玩家转角组件:{4}" + 59 | ",玩家所处维度:{5},玩家实体类型:{6},玩家查询流水号:{7},玩家UUID:{8},玩家名字:{9},玩家计分板ID:{10}", 60 | pl.Attack, pl.CollisionBox, pl.Health, pl.Position, pl.Rotation, pl.DimensionId, pl.TypeId, pl.UniqueId, pl.Uuid, pl.getName(), 61 | pl.getScoreboardId()/* , pl.createScoreboardId() */); 62 | } 63 | else if (fe.selected == "1"){ 64 | // 物品栏测试 65 | Console.WriteLine("实体装备栏:{0},实体主副手栏:{1},实体背包栏:{2},实体热键栏:{3}", 66 | pl.ArmorContainer, pl.HandContainer, pl.InventoryContainer, pl.HotbarContainer); 67 | } 68 | else if (fe.selected == "2"){ 69 | // 组件设置测试 70 | JavaScriptSerializer ser = new JavaScriptSerializer(); 71 | var atta = ser.Deserialize>(pl.Attack); 72 | atta["range_min"] = Convert.ToSingle(atta["range_min"]) + 4; 73 | atta["range_max"] = Convert.ToSingle(atta["range_max"]) + 4; 74 | pl.Attack = ser.Serialize(atta); 75 | Console.WriteLine("玩家攻击力将+4"); 76 | var acb = ser.Deserialize>(pl.CollisionBox); 77 | acb["width"] = Convert.ToSingle(acb["width"]) + 1; 78 | acb["height"] = Convert.ToSingle(acb["height"]) + 1; 79 | //pl.CollisionBox = ser.Serialize(acb); 80 | //Console.WriteLine("玩家碰撞箱宽和高的值将+1格"); 81 | var ahe = ser.Deserialize>(pl.Health); 82 | ahe["max"] = Convert.ToSingle(ahe["max"]) + 10; 83 | ahe["value"] = Convert.ToSingle(ahe["value"]) + 10; 84 | pl.Health = ser.Serialize(ahe); 85 | Console.WriteLine("玩家当前和最大生命值将+10点"); 86 | var prex = "[前缀]"; 87 | var pname = pl.getName(); 88 | bool alwaysshow = false; 89 | if (pname.IndexOf(prex) == 0) { 90 | pname = pname.Substring(prex.Length); 91 | alwaysshow = true; 92 | } 93 | else { 94 | pname = prex + pname; 95 | alwaysshow = false; 96 | } 97 | pl.setName(pname, alwaysshow); 98 | Console.WriteLine("玩家名字将添加/删除前缀,去掉/恢复常显"); 99 | var apos = ser.Deserialize>(pl.Position); 100 | apos["x"] = Convert.ToSingle(apos["x"]) + 16; 101 | apos["y"] = Convert.ToSingle(apos["y"]) + 10; 102 | apos["z"] = Convert.ToSingle(apos["z"]) + 16; 103 | //pl.Position = ser.Serialize(apos); 104 | //Console.WriteLine("玩家将位移至当前位置的(+16,+10,+16)上。"); 105 | var arot = ser.Deserialize>(pl.Rotation); 106 | arot["x"] = Convert.ToSingle(arot["x"]) + 16; 107 | arot["y"] = Convert.ToSingle(arot["y"]) + 16; 108 | pl.Rotation = ser.Serialize(arot); 109 | Console.WriteLine("玩家俯角+16,转角+16"); 110 | } 111 | else if (fe.selected == "3") 112 | { 113 | var el = CsActor.getsFromAABB(api, fe.dimensionid, fe.XYZ.x - 16, fe.XYZ.y - 16, fe.XYZ.z - 16, 114 | fe.XYZ.x + 16, fe.XYZ.y + 16, fe.XYZ.z + 16); 115 | if (el != null && el.Count > 0) 116 | { 117 | Console.WriteLine("查询并移除玩家附近16格内所有实体:"); 118 | foreach (IntPtr eptr in el) 119 | { 120 | var cse = new CsActor(api, eptr); 121 | Console.WriteLine("TypeId={0},UniqueId={1},name={2}", cse.TypeId, cse.UniqueId, cse.getName()); 122 | cse.remove(); 123 | } 124 | } 125 | } else if (fe.selected == "4") 126 | { 127 | var el = CsActor.getsFromAABB(api, fe.dimensionid, fe.XYZ.x - 16, fe.XYZ.y - 16, fe.XYZ.z - 16, 128 | fe.XYZ.x + 16, fe.XYZ.y + 16, fe.XYZ.z + 16); 129 | var plst = CsPlayer.getplFromAABB(api, fe.dimensionid, fe.XYZ.x - 16, fe.XYZ.y - 16, fe.XYZ.z - 16, 130 | fe.XYZ.x + 16, fe.XYZ.y + 16, fe.XYZ.z + 16); 131 | el = el == null ? new ArrayList() : el; 132 | plst = plst == null ? new ArrayList() : plst; 133 | el.AddRange(plst); 134 | if (el.Count > 0) 135 | { 136 | Console.WriteLine("查询并模拟攻击玩家附近16格内所有实体和玩家:"); 137 | foreach (IntPtr eptr in el) 138 | { 139 | var cse = new CsActor(api, eptr); 140 | Console.WriteLine("TypeId={0},UniqueId={1},name={2}", cse.TypeId, cse.UniqueId, cse.getName()); 141 | // 测试实体模拟受攻击伤害,伤害值为10 142 | cse.hurt(fe.playerPtr/*IntPtr.Zero*/, ActorDamageCause.EntityAttack, 10, false, false); 143 | } 144 | } 145 | } else if (fe.selected == "5") 146 | { 147 | pl.addLevel(3); 148 | } 149 | } 150 | else{ 151 | Console.WriteLine("玩家 {0} 取消了表单 id={1}", fe.playername, fe.formid); 152 | } 153 | return false; 154 | }); 155 | // 使用物品监听 156 | api.addAfterActListener(EventKey.onUseItem, x => { 157 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 158 | var ue = BaseEvent.getFrom(x) as UseItemEvent; 159 | if (ue != null && ue.RESULT) { 160 | Console.WriteLine("玩家 {0} 对 {1} 的 ({2}, {3}, {4}) 处的 {5} 方块" + 161 | "操作了 {6} 物品,类型{7}。", ue.playername, ue.dimension, ue.position.x, ue.position.y, ue.position.z, ue.blockname, ue.itemname, api.getItemRawname(ue.itemid)); 162 | } 163 | return true; 164 | }); 165 | // 放置方块监听 166 | api.addAfterActListener(EventKey.onPlacedBlock, x => { 167 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 168 | var ue = BaseEvent.getFrom(x) as PlacedBlockEvent; 169 | if (ue != null && ue.RESULT) { 170 | Console.WriteLine("玩家 {0} 在 {1} 的 ({2}, {3}, {4})" + 171 | " 处放置了 {5} 方块。", ue.playername, ue.dimension, ue.position.x, ue.position.y, ue.position.z, ue.blockname); 172 | } 173 | return true; 174 | }); 175 | // 破坏方块监听 176 | api.addBeforeActListener(EventKey.onDestroyBlock, x => { 177 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 178 | var ue = BaseEvent.getFrom(x) as DestroyBlockEvent; 179 | if (ue != null) { 180 | Console.WriteLine("玩家 {0} 试图在 {1} 的 ({2}, {3}, {4})" + 181 | " 处破坏 {5} 方块。", ue.playername, ue.dimension, ue.position.x, ue.position.y, ue.position.z, ue.blockname); 182 | } 183 | return true; 184 | }); 185 | // 开箱监听 186 | api.addBeforeActListener(EventKey.onStartOpenChest, x => { 187 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 188 | var ue = BaseEvent.getFrom(x) as StartOpenChestEvent; 189 | if (ue != null) { 190 | Console.WriteLine("玩家 {0} 试图在 {1} 的 ({2}, {3}, {4})" + 191 | " 处打开 {5} 箱子。", ue.playername, ue.dimension, ue.position.x, ue.position.y, ue.position.z, ue.blockname); 192 | } 193 | return true; 194 | }); 195 | // 开桶监听 196 | api.addBeforeActListener(EventKey.onStartOpenBarrel, x => { 197 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 198 | var ue = BaseEvent.getFrom(x) as StartOpenBarrelEvent; 199 | if (ue != null) { 200 | Console.WriteLine("玩家 {0} 试图在 {1} 的 ({2}, {3}, {4})" + 201 | " 处打开 {5} 木桶。", ue.playername, ue.dimension, ue.position.x, ue.position.y, ue.position.z, ue.blockname); 202 | } 203 | return true; 204 | }); 205 | // 关箱监听 206 | api.addAfterActListener(EventKey.onStopOpenChest, x => { 207 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 208 | var ue = BaseEvent.getFrom(x) as StopOpenChestEvent; 209 | if (ue != null) { 210 | Console.WriteLine("玩家 {0} 在 {1} 的 ({2}, {3}, {4})" + 211 | " 处关闭 {5} 箱子。", ue.playername, ue.dimension, ue.position.x, ue.position.y, ue.position.z, ue.blockname); 212 | } 213 | return true; 214 | }); 215 | // 关桶监听 216 | api.addAfterActListener(EventKey.onStopOpenBarrel, x => { 217 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 218 | var ue = BaseEvent.getFrom(x) as StopOpenBarrelEvent; 219 | if (ue != null) { 220 | Console.WriteLine("玩家 {0} 在 {1} 的 ({2}, {3}, {4})" + 221 | " 处关闭 {5} 木桶。", ue.playername, ue.dimension, ue.position.x, ue.position.y, ue.position.z, ue.blockname); 222 | } 223 | return true; 224 | }); 225 | // 放入取出监听 226 | api.addAfterActListener(EventKey.onSetSlot, x => { 227 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 228 | var e = BaseEvent.getFrom(x) as SetSlotEvent; 229 | if (e != null) { 230 | if (e.itemcount > 0) 231 | Console.WriteLine("玩家 {0} 在 {1} 槽放入了 {2} 个 {3} 物品。", 232 | e.playername, e.slot, e.itemcount, e.itemname); 233 | else 234 | Console.WriteLine("玩家 {0} 在 {1} 槽取出了物品。", 235 | e.playername, e.slot); 236 | } 237 | return true; 238 | }); 239 | // 切换维度监听 240 | api.addAfterActListener(EventKey.onChangeDimension, x => { 241 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 242 | var e = BaseEvent.getFrom(x) as ChangeDimensionEvent; 243 | if (e != null && e.RESULT) { 244 | Console.WriteLine("玩家 {0} {1} 切换维度至 {2} 的 ({3},{4},{5}) 处。", 245 | e.playername, e.isstand?"":"悬空地", e.dimension, e.XYZ.x, e.XYZ.y, e.XYZ.z); 246 | } 247 | return true; 248 | }); 249 | // 生物死亡监听 250 | api.addAfterActListener(EventKey.onMobDie, x => { 251 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 252 | var e = BaseEvent.getFrom(x) as MobDieEvent; 253 | if (e != null && !string.IsNullOrEmpty(e.mobname)) { 254 | Console.WriteLine(" {0} 在 {1} ({2:F2},{3:F2},{4:F2}) 处被 {5} 杀死了。", 255 | e.mobname, e.dimension, e.XYZ.x, e.XYZ.y, e.XYZ.z, e.srcname); 256 | } 257 | return true; 258 | }); 259 | // 玩家重生监听 260 | api.addAfterActListener(EventKey.onRespawn, x => { 261 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 262 | var e = BaseEvent.getFrom(x) as RespawnEvent; 263 | if (e != null && e.RESULT) { 264 | Console.WriteLine("玩家 {0} 已于 {1} 的 ({2:F2},{3:F2},{4:F2}) 处重生。", 265 | e.playername, e.dimension, e.XYZ.x, e.XYZ.y, e.XYZ.z); 266 | } 267 | return true; 268 | }); 269 | // 聊天监听 270 | api.addAfterActListener(EventKey.onChat, x => { 271 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 272 | var e = BaseEvent.getFrom(x) as ChatEvent; 273 | if (e != null) { 274 | Console.WriteLine(" {0} {1} 说:{2}", e.playername, 275 | !string.IsNullOrEmpty(e.target) ? "悄悄地对 " + e.target : "", e.msg); 276 | } 277 | return true; 278 | }); 279 | // 输入文本监听 280 | api.addBeforeActListener(EventKey.onInputText, x => { 281 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 282 | var e = BaseEvent.getFrom(x) as InputTextEvent; 283 | if (e != null) { 284 | Console.WriteLine(" <{0}> {1}", e.playername, e.msg); 285 | } 286 | return true; 287 | }); 288 | // 输入指令监听 289 | api.addBeforeActListener(EventKey.onInputCommand, x => { 290 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 291 | var e = BaseEvent.getFrom(x) as InputCommandEvent; 292 | if (e != null) { 293 | Console.WriteLine(" <{0}> {1}", e.playername, e.cmd); 294 | } 295 | return true; 296 | }); 297 | 298 | // 世界范围爆炸监听,拦截 299 | api.addBeforeActListener(EventKey.onLevelExplode, x => { 300 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 301 | var e = BaseEvent.getFrom(x) as LevelExplodeEvent; 302 | if (e != null) { 303 | Console.WriteLine("位于 {0} ({1},{2},{3}) 的 {4} 试图发生强度 {5} 的爆炸。", 304 | e.dimension, e.position.x, e.position.y, e.position.z, 305 | string.IsNullOrEmpty(e.entity) ? e.blockname : e.entity, e.explodepower); 306 | } 307 | return false; 308 | }); 309 | // 玩家切换装备监听 310 | api.addAfterActListener(EventKey.onEquippedArmor, x => 311 | { 312 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 313 | var e = BaseEvent.getFrom(x) as EquippedArmorEvent; 314 | if (e != null) 315 | { 316 | Console.WriteLine("玩家 {0} 已于 {1} 的 ({2:F2},{3:F2},{4:F2}) 处切换 {5} 第 {6} 格的装备为 {7} 。", 317 | e.playername, e.dimension, e.XYZ.x, e.XYZ.y, e.XYZ.z, 318 | e.slottype == 0?"身体装备的":"主副手的", e.slot, e.itemname); 319 | } 320 | return true; 321 | }); 322 | // 玩家升级监听 323 | api.addAfterActListener(EventKey.onLevelUp, x => 324 | { 325 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 326 | var e = BaseEvent.getFrom(x) as LevelUpEvent; 327 | if (e != null) 328 | { 329 | Console.WriteLine("玩家 {0} 已于 {1} 的 ({2:F2},{3:F2},{4:F2}) 处等级提升了 {5} 级。", 330 | e.playername, e.dimension, e.XYZ.x, e.XYZ.y, e.XYZ.z, 331 | e.lv); 332 | } 333 | return true; 334 | }); 335 | // 活塞推方块监听 336 | api.addBeforeActListener(EventKey.onPistonPush, x => 337 | { 338 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 339 | var e = BaseEvent.getFrom(x) as PistonPushEvent; 340 | if (e != null) 341 | { 342 | Console.WriteLine("活塞 {0} 于 {1} 的({2}, {3}, {4})处试图向 {5} 号方向推拽({6}, {7}, {8})处的 {9} 方块。", 343 | e.blockname, e.dimension, e.position.x, e.position.y, e.position.z, 344 | e.direction, e.targetposition.x, e.targetposition.y, e.position.z, e.targetblockname); 345 | return true; 346 | } 347 | return true; 348 | }); 349 | // 箱子合并监听 350 | api.addAfterActListener(EventKey.onChestPair, x => 351 | { 352 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 353 | var e = BaseEvent.getFrom(x) as ChestPairEvent; 354 | if (e != null) 355 | { 356 | Console.WriteLine("箱子 {0} 于 {1} 的({2}, {3}, {4})处试图合并向({5}, {6}, {7})处的 {8} 箱子。", 357 | e.blockname, e.dimension, e.position.x, e.position.y, e.position.z, e.targetposition.x, e.targetposition.y, 358 | e.position.z, e.targetblockname); 359 | return true; 360 | } 361 | return true; 362 | }); 363 | /* 364 | api.addBeforeActListener(EventKey.onMobSpawnCheck, x => 365 | { 366 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 367 | var e = BaseEvent.getFrom(x) as MobSpawnCheckEvent; 368 | if (e != null) 369 | { 370 | Console.WriteLine("生物 {0} 于 {1} 的({2}, {3}, {4})处试图检查生成规则。", 371 | e.mobtype, e.dimension, e.XYZ.x, e.XYZ.y, e.XYZ.z); 372 | return true; 373 | } 374 | return true; 375 | }); 376 | // 玩家移动监听 377 | api.addAfterActListener(EventKey.onMove, x => { 378 | var e = BaseEvent.getFrom(x) as MoveEvent; 379 | if (e != null) { 380 | Console.WriteLine("玩家 {0} {1} 移动至 {2} ({3},{4},{5}) 处。", 381 | e.playername, (e.isstand) ? "":"悬空地", e.dimension, 382 | e.XYZ.x, e.XYZ.y, e.XYZ.z); 383 | } 384 | return false; 385 | }); 386 | */ 387 | // 玩家加入游戏监听 388 | api.addAfterActListener(EventKey.onLoadName, x => { 389 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 390 | var ue = BaseEvent.getFrom(x) as LoadNameEvent; 391 | if (ue != null) { 392 | CsPlayer p = new CsPlayer(api, ue.playerPtr); 393 | Console.WriteLine("玩家 {0} 加入了游戏,xuid={1}, IP={2}", ue.playername, ue.xuid, p.IpPort); 394 | } 395 | return true; 396 | }); 397 | // 玩家离开游戏监听 398 | api.addAfterActListener(EventKey.onPlayerLeft, x => { 399 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 400 | var ue = BaseEvent.getFrom(x) as PlayerLeftEvent; 401 | if (ue != null) { 402 | Console.WriteLine("玩家 {0} 离开了游戏,xuid={1}", ue.playername, ue.xuid); 403 | } 404 | return true; 405 | }); 406 | 407 | // 攻击监听 408 | // API 方式注册监听器 409 | api.addAfterActListener(EventKey.onAttack, x => { 410 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 411 | AttackEvent ae = BaseEvent.getFrom(x) as AttackEvent; 412 | if (ae != null) { 413 | string str = "玩家 " + ae.playername + " 在 (" + ae.XYZ.x.ToString("F2") + "," + 414 | ae.XYZ.y.ToString("F2") + "," + ae.XYZ.z.ToString("F2") + ") 处攻击了 " + ae.actortype + ",类型=" + 415 | ae.dmcase + "。"; 416 | Console.WriteLine(str); 417 | // 社区api测试 418 | api.setServerMotd(ae.playername + "发动了攻击", true); 419 | //Console.WriteLine("list={0}", api.getOnLinePlayers()) 420 | CsPlayer p = new CsPlayer(api, ae.playerPtr); 421 | var uuid = p.Uuid; 422 | if (uuid != null) 423 | { 424 | tformid = api.sendSimpleForm((string)uuid, 425 | "测试选项", 426 | "test choose:", 427 | "[\"基本组件\",\"物品栏组件\",\"组件设置\", \"范围检测并清理\",\"范围检测并攻击\"," + 428 | "\"玩家等级+3\" ]"); 429 | Console.WriteLine("创建需自行保管的表单,id={0}", tformid); 430 | // 非社区内容测试 431 | if (api.COMMERCIAL) 432 | { 433 | CsActor ac = new CsActor(api, ae.attackedentityPtr); 434 | Console.WriteLine("目标实体的能力值:" + ac.Abilities + "\n目标实体的属性列表:" + ac.Attributes 435 | + "\n目标实体的最大属性列表:" + ac.MaxAttributes + "\n目标实体的所有状态效果列表:" + ac.Effects); 436 | } 437 | } 438 | } else { 439 | Console.WriteLine("Event convent fail."); 440 | } 441 | return true; 442 | }); 443 | 444 | //玩家捡物品事件 - 可拦截 445 | api.addBeforeActListener(EventKey.onPickUpItem, x => 446 | { 447 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 448 | PickUpItemEvent ae = BaseEvent.getFrom(x) as PickUpItemEvent; 449 | if (ae != null) 450 | { 451 | Console.WriteLine("玩家 {0} 在 {1} 的 ({2}) 捡起了 {3} 物品。", ae.playername, ae.dimension, ae.XYZ.x.ToString("F2") + "," + 452 | ae.XYZ.y.ToString("F2") + "," + ae.XYZ.z.ToString("F2"), ae.itemname); 453 | } 454 | return true; 455 | }); 456 | 457 | //玩家丢物品事件 - 可拦截 458 | api.addBeforeActListener(EventKey.onDropItem, x => 459 | { 460 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 461 | DropItemEvent ae = BaseEvent.getFrom(x) as DropItemEvent; 462 | if (ae != null) 463 | { 464 | Console.WriteLine("玩家 {0} 在 {1} 的 ({2}) 丢下了 {3} 物品。", ae.playername, ae.dimension, ae.XYZ.x.ToString("F2") + "," + 465 | ae.XYZ.y.ToString("F2") + "," + ae.XYZ.z.ToString("F2"), ae.itemname); 466 | } 467 | return true; 468 | }); 469 | // 计分板数值改变事件 470 | api.addAfterActListener(EventKey.onScoreChanged, x => 471 | { 472 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 473 | ScoreChangedEvent ae = BaseEvent.getFrom(x) as ScoreChangedEvent; 474 | if (ae != null) 475 | { 476 | Console.WriteLine("计分板 {0} (显示名称:{1},id:{2})分数改变为 {3}", 477 | ae.objectivename, ae.displayname, ae.scoreboardid, ae.score); 478 | } 479 | return true; 480 | }); 481 | // 官方脚本引擎初始化监听 482 | api.addAfterActListener(EventKey.onScriptEngineInit, x => 483 | { 484 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 485 | ScriptEngineInitEvent ae = BaseEvent.getFrom(x) as ScriptEngineInitEvent; 486 | if (ae != null && ae.RESULT) 487 | { 488 | Console.WriteLine("脚本引擎已初始化成功,addr={0}", 489 | ae.jseptr); 490 | // 延时1s载入外置行为包脚本;延时3s发送一个自定义事件;延时1s载入一段临时脚本 491 | new Thread(() => 492 | { 493 | Thread.Sleep(1000); 494 | try 495 | { // 测试临时行为包脚本注意事项:runScript情况下不会经过 initialize 调用,需主动设置初始化 496 | string js = File.ReadAllText("test.js"); 497 | api.JSErunScript(js, (r) => { 498 | if (r) 499 | Console.WriteLine("外置测试行为包脚本载入成功。"); 500 | }); 501 | } catch { } 502 | Thread.Sleep(3000); 503 | string jdata = new JavaScriptSerializer().Serialize(new { text = "这是一个自定义测试消息", num = 2021 }); 504 | api.JSEfireCustomEvent("mytest:testevent", jdata, (r) => { 505 | if (r) 506 | Console.WriteLine("自定义事件广播发送成功。"); 507 | }); 508 | Thread.Sleep(1000); 509 | api.JSErunScript("var d = 100;\n console.log('这是一个临时测试脚本')", (r)=>{ 510 | if (r) 511 | Console.WriteLine("测试临时脚本执行成功。"); 512 | }); 513 | }).Start(); 514 | } 515 | return true; 516 | }); 517 | // 官方脚本引擎接收日志输出信息监听,拦截 518 | api.addBeforeActListener(EventKey.onScriptEngineLog, x => 519 | { 520 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 521 | ScriptEngineLogEvent ae = BaseEvent.getFrom(x) as ScriptEngineLogEvent; 522 | if (ae != null) 523 | { 524 | Console.WriteLine("[来自脚本的LOG输出] {0}", 525 | ae.log); 526 | } 527 | return false; 528 | }); 529 | // 官方脚本引擎执行指令,或可拦截 530 | api.addBeforeActListener(EventKey.onScriptEngineCmd, x => 531 | { 532 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 533 | ScriptEngineCmdEvent ae = BaseEvent.getFrom(x) as ScriptEngineCmdEvent; 534 | if (ae != null) 535 | { 536 | Console.WriteLine("[脚本引擎试图执行指令] {0}", 537 | ae.cmd); 538 | } 539 | return true; 540 | }); 541 | api.addAfterActListener(EventKey.onScoreboardInit, x => 542 | { 543 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 544 | var e = BaseEvent.getFrom(x) as ScoreboardInitEvent; 545 | if (e != null) 546 | { 547 | Console.WriteLine("系统计分板已初始化成功,addr={0}", 548 | e.scptr); 549 | } 550 | return true; 551 | }); 552 | #region 非社区部分内容 553 | if (api.COMMERCIAL) 554 | { 555 | // 生物伤害监听 556 | api.addBeforeActListener(EventKey.onMobHurt, x => { 557 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 558 | var e = BaseEvent.getFrom(x) as MobHurtEvent; 559 | if (e != null && !string.IsNullOrEmpty(e.mobname)) 560 | { 561 | Console.WriteLine(" {0} 在 {1} ({2:F2},{3:F2},{4:F2}) 即将受到来自 {5} 的 {6} 点伤害,类型 {7}", 562 | e.mobname, e.dimension, e.XYZ.x, e.XYZ.y, e.XYZ.z, e.srcname, e.dmcount, e.dmtype); 563 | } 564 | return true; 565 | }); 566 | // 命令块执行指令监听,拦截 567 | api.addBeforeActListener(EventKey.onBlockCmd, x => { 568 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 569 | var e = BaseEvent.getFrom(x) as BlockCmdEvent; 570 | if (e != null) 571 | { 572 | Console.WriteLine("位于 {0} ({1},{2},{3}) 的 {4} 试图执行指令 {5}", 573 | e.dimension, e.position.x, e.position.y, e.position.z, e.name, e.cmd); 574 | } 575 | return false; 576 | }); 577 | // NPC执行指令监听,拦截 578 | api.addBeforeActListener(EventKey.onNpcCmd, x => { 579 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 580 | var e = BaseEvent.getFrom(x) as NpcCmdEvent; 581 | if (e != null) 582 | { 583 | Console.WriteLine("位于 {0} ({1},{2},{3}) 的 {4} 试图执行第 {5} 条指令,指令集\n{6}", 584 | e.dimension, e.position.x, e.position.y, e.position.z, e.npcname, e.actionid, e.actions); 585 | } 586 | return false; 587 | }); 588 | // 更新命令方块监听 589 | api.addBeforeActListener(EventKey.onCommandBlockUpdate, x => { 590 | Console.WriteLine("[CS] type = {0}, mode = {1}, result= {2}", x.type, x.mode, x.result); 591 | var e = BaseEvent.getFrom(x) as CommandBlockUpdateEvent; 592 | if (e != null) 593 | { 594 | Console.WriteLine(" {0} 试图修改位于 {1} ({2},{3},{4}) 的 {5} 的命令为 {6}", 595 | e.playername, e.dimension, e.position.x, e.position.y, e.position.z, 596 | e.isblock ? "命令块" : "命令矿车", e.cmd); 597 | } 598 | return true; 599 | }); 600 | } 601 | #endregion 602 | 603 | 604 | // Json 解析部分 使用JavaScriptSerializer序列化Dictionary或array即可 605 | 606 | //JavaScriptSerializer ser = new JavaScriptSerializer(); 607 | //var data = ser.Deserialize>("{\"x\":9}"); 608 | //var ary = ser.Deserialize("[\"x\",\"y\"]"); 609 | //Console.WriteLine(data["x"]); 610 | //foreach(string v in ary) { 611 | // Console.WriteLine(v); 612 | //} 613 | //data["y"] = 8; 614 | //string dstr = ser.Serialize(data); 615 | //Console.WriteLine(dstr); 616 | 617 | // 高级玩法,硬编码方式注册hook 618 | THook.init(api); 619 | } 620 | } 621 | } 622 | 623 | namespace CSR 624 | { 625 | partial class Plugin 626 | { 627 | /// 628 | /// 通用调用接口,需用户自行实现 629 | /// 630 | /// MC相关调用方法 631 | public static void onStart(MCCSAPI api) { 632 | // TODO 此接口为必要实现 633 | CSRDemo.Program.init(api); 634 | Console.WriteLine("[Demo] CSR测试插件已装载。"); 635 | } 636 | } 637 | } -------------------------------------------------------------------------------- /CSRDemo/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // 有关程序集的一般信息由以下 6 | // 控制。更改这些特性值可修改 7 | // 与程序集关联的信息。 8 | [assembly: AssemblyTitle("CSRDemo")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("CSRDemo")] 13 | [assembly: AssemblyCopyright("Copyright © 2020")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // 将 ComVisible 设置为 false 会使此程序集中的类型 18 | //对 COM 组件不可见。如果需要从 COM 访问此程序集中的类型 19 | //请将此类型的 ComVisible 特性设置为 true。 20 | [assembly: ComVisible(false)] 21 | 22 | // 如果此项目向 COM 公开,则下列 GUID 用于类型库的 ID 23 | [assembly: Guid("95e4503b-bf15-499b-b5b2-fc0f3e425a3e")] 24 | 25 | // 程序集的版本信息由下列四个值组成: 26 | // 27 | // 主版本 28 | // 次版本 29 | // 生成号 30 | // 修订号 31 | // 32 | //可以指定所有这些值,也可以使用“生成号”和“修订号”的默认值 33 | //通过使用 "*",如下所示: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("1.0.0.0")] 36 | [assembly: AssemblyFileVersion("1.0.0.0")] 37 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU LESSER GENERAL PUBLIC LICENSE 2 | Version 2.1, February 1999 3 | 4 | Copyright (C) 1991, 1999 Free Software Foundation, Inc. 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | [This is the first released version of the Lesser GPL. It also counts 10 | as the successor of the GNU Library Public License, version 2, hence 11 | the version number 2.1.] 12 | 13 | Preamble 14 | 15 | The licenses for most software are designed to take away your 16 | freedom to share and change it. By contrast, the GNU General Public 17 | Licenses are intended to guarantee your freedom to share and change 18 | free software--to make sure the software is free for all its users. 19 | 20 | This license, the Lesser General Public License, applies to some 21 | specially designated software packages--typically libraries--of the 22 | Free Software Foundation and other authors who decide to use it. You 23 | can use it too, but we suggest you first think carefully about whether 24 | this license or the ordinary General Public License is the better 25 | strategy to use in any particular case, based on the explanations below. 26 | 27 | When we speak of free software, we are referring to freedom of use, 28 | not price. Our General Public Licenses are designed to make sure that 29 | you have the freedom to distribute copies of free software (and charge 30 | for this service if you wish); that you receive source code or can get 31 | it if you want it; that you can change the software and use pieces of 32 | it in new free programs; and that you are informed that you can do 33 | these things. 34 | 35 | To protect your rights, we need to make restrictions that forbid 36 | distributors to deny you these rights or to ask you to surrender these 37 | rights. These restrictions translate to certain responsibilities for 38 | you if you distribute copies of the library or if you modify it. 39 | 40 | For example, if you distribute copies of the library, whether gratis 41 | or for a fee, you must give the recipients all the rights that we gave 42 | you. You must make sure that they, too, receive or can get the source 43 | code. If you link other code with the library, you must provide 44 | complete object files to the recipients, so that they can relink them 45 | with the library after making changes to the library and recompiling 46 | it. And you must show them these terms so they know their rights. 47 | 48 | We protect your rights with a two-step method: (1) we copyright the 49 | library, and (2) we offer you this license, which gives you legal 50 | permission to copy, distribute and/or modify the library. 51 | 52 | To protect each distributor, we want to make it very clear that 53 | there is no warranty for the free library. Also, if the library is 54 | modified by someone else and passed on, the recipients should know 55 | that what they have is not the original version, so that the original 56 | author's reputation will not be affected by problems that might be 57 | introduced by others. 58 | 59 | Finally, software patents pose a constant threat to the existence of 60 | any free program. We wish to make sure that a company cannot 61 | effectively restrict the users of a free program by obtaining a 62 | restrictive license from a patent holder. Therefore, we insist that 63 | any patent license obtained for a version of the library must be 64 | consistent with the full freedom of use specified in this license. 65 | 66 | Most GNU software, including some libraries, is covered by the 67 | ordinary GNU General Public License. This license, the GNU Lesser 68 | General Public License, applies to certain designated libraries, and 69 | is quite different from the ordinary General Public License. We use 70 | this license for certain libraries in order to permit linking those 71 | libraries into non-free programs. 72 | 73 | When a program is linked with a library, whether statically or using 74 | a shared library, the combination of the two is legally speaking a 75 | combined work, a derivative of the original library. The ordinary 76 | General Public License therefore permits such linking only if the 77 | entire combination fits its criteria of freedom. The Lesser General 78 | Public License permits more lax criteria for linking other code with 79 | the library. 80 | 81 | We call this license the "Lesser" General Public License because it 82 | does Less to protect the user's freedom than the ordinary General 83 | Public License. It also provides other free software developers Less 84 | of an advantage over competing non-free programs. These disadvantages 85 | are the reason we use the ordinary General Public License for many 86 | libraries. However, the Lesser license provides advantages in certain 87 | special circumstances. 88 | 89 | For example, on rare occasions, there may be a special need to 90 | encourage the widest possible use of a certain library, so that it becomes 91 | a de-facto standard. To achieve this, non-free programs must be 92 | allowed to use the library. A more frequent case is that a free 93 | library does the same job as widely used non-free libraries. In this 94 | case, there is little to gain by limiting the free library to free 95 | software only, so we use the Lesser General Public License. 96 | 97 | In other cases, permission to use a particular library in non-free 98 | programs enables a greater number of people to use a large body of 99 | free software. For example, permission to use the GNU C Library in 100 | non-free programs enables many more people to use the whole GNU 101 | operating system, as well as its variant, the GNU/Linux operating 102 | system. 103 | 104 | Although the Lesser General Public License is Less protective of the 105 | users' freedom, it does ensure that the user of a program that is 106 | linked with the Library has the freedom and the wherewithal to run 107 | that program using a modified version of the Library. 108 | 109 | The precise terms and conditions for copying, distribution and 110 | modification follow. Pay close attention to the difference between a 111 | "work based on the library" and a "work that uses the library". The 112 | former contains code derived from the library, whereas the latter must 113 | be combined with the library in order to run. 114 | 115 | GNU LESSER GENERAL PUBLIC LICENSE 116 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 117 | 118 | 0. This License Agreement applies to any software library or other 119 | program which contains a notice placed by the copyright holder or 120 | other authorized party saying it may be distributed under the terms of 121 | this Lesser General Public License (also called "this License"). 122 | Each licensee is addressed as "you". 123 | 124 | A "library" means a collection of software functions and/or data 125 | prepared so as to be conveniently linked with application programs 126 | (which use some of those functions and data) to form executables. 127 | 128 | The "Library", below, refers to any such software library or work 129 | which has been distributed under these terms. A "work based on the 130 | Library" means either the Library or any derivative work under 131 | copyright law: that is to say, a work containing the Library or a 132 | portion of it, either verbatim or with modifications and/or translated 133 | straightforwardly into another language. (Hereinafter, translation is 134 | included without limitation in the term "modification".) 135 | 136 | "Source code" for a work means the preferred form of the work for 137 | making modifications to it. For a library, complete source code means 138 | all the source code for all modules it contains, plus any associated 139 | interface definition files, plus the scripts used to control compilation 140 | and installation of the library. 141 | 142 | Activities other than copying, distribution and modification are not 143 | covered by this License; they are outside its scope. The act of 144 | running a program using the Library is not restricted, and output from 145 | such a program is covered only if its contents constitute a work based 146 | on the Library (independent of the use of the Library in a tool for 147 | writing it). Whether that is true depends on what the Library does 148 | and what the program that uses the Library does. 149 | 150 | 1. You may copy and distribute verbatim copies of the Library's 151 | complete source code as you receive it, in any medium, provided that 152 | you conspicuously and appropriately publish on each copy an 153 | appropriate copyright notice and disclaimer of warranty; keep intact 154 | all the notices that refer to this License and to the absence of any 155 | warranty; and distribute a copy of this License along with the 156 | Library. 157 | 158 | You may charge a fee for the physical act of transferring a copy, 159 | and you may at your option offer warranty protection in exchange for a 160 | fee. 161 | 162 | 2. You may modify your copy or copies of the Library or any portion 163 | of it, thus forming a work based on the Library, and copy and 164 | distribute such modifications or work under the terms of Section 1 165 | above, provided that you also meet all of these conditions: 166 | 167 | a) The modified work must itself be a software library. 168 | 169 | b) You must cause the files modified to carry prominent notices 170 | stating that you changed the files and the date of any change. 171 | 172 | c) You must cause the whole of the work to be licensed at no 173 | charge to all third parties under the terms of this License. 174 | 175 | d) If a facility in the modified Library refers to a function or a 176 | table of data to be supplied by an application program that uses 177 | the facility, other than as an argument passed when the facility 178 | is invoked, then you must make a good faith effort to ensure that, 179 | in the event an application does not supply such function or 180 | table, the facility still operates, and performs whatever part of 181 | its purpose remains meaningful. 182 | 183 | (For example, a function in a library to compute square roots has 184 | a purpose that is entirely well-defined independent of the 185 | application. Therefore, Subsection 2d requires that any 186 | application-supplied function or table used by this function must 187 | be optional: if the application does not supply it, the square 188 | root function must still compute square roots.) 189 | 190 | These requirements apply to the modified work as a whole. If 191 | identifiable sections of that work are not derived from the Library, 192 | and can be reasonably considered independent and separate works in 193 | themselves, then this License, and its terms, do not apply to those 194 | sections when you distribute them as separate works. But when you 195 | distribute the same sections as part of a whole which is a work based 196 | on the Library, the distribution of the whole must be on the terms of 197 | this License, whose permissions for other licensees extend to the 198 | entire whole, and thus to each and every part regardless of who wrote 199 | it. 200 | 201 | Thus, it is not the intent of this section to claim rights or contest 202 | your rights to work written entirely by you; rather, the intent is to 203 | exercise the right to control the distribution of derivative or 204 | collective works based on the Library. 205 | 206 | In addition, mere aggregation of another work not based on the Library 207 | with the Library (or with a work based on the Library) on a volume of 208 | a storage or distribution medium does not bring the other work under 209 | the scope of this License. 210 | 211 | 3. You may opt to apply the terms of the ordinary GNU General Public 212 | License instead of this License to a given copy of the Library. To do 213 | this, you must alter all the notices that refer to this License, so 214 | that they refer to the ordinary GNU General Public License, version 2, 215 | instead of to this License. (If a newer version than version 2 of the 216 | ordinary GNU General Public License has appeared, then you can specify 217 | that version instead if you wish.) Do not make any other change in 218 | these notices. 219 | 220 | Once this change is made in a given copy, it is irreversible for 221 | that copy, so the ordinary GNU General Public License applies to all 222 | subsequent copies and derivative works made from that copy. 223 | 224 | This option is useful when you wish to copy part of the code of 225 | the Library into a program that is not a library. 226 | 227 | 4. You may copy and distribute the Library (or a portion or 228 | derivative of it, under Section 2) in object code or executable form 229 | under the terms of Sections 1 and 2 above provided that you accompany 230 | it with the complete corresponding machine-readable source code, which 231 | must be distributed under the terms of Sections 1 and 2 above on a 232 | medium customarily used for software interchange. 233 | 234 | If distribution of object code is made by offering access to copy 235 | from a designated place, then offering equivalent access to copy the 236 | source code from the same place satisfies the requirement to 237 | distribute the source code, even though third parties are not 238 | compelled to copy the source along with the object code. 239 | 240 | 5. A program that contains no derivative of any portion of the 241 | Library, but is designed to work with the Library by being compiled or 242 | linked with it, is called a "work that uses the Library". Such a 243 | work, in isolation, is not a derivative work of the Library, and 244 | therefore falls outside the scope of this License. 245 | 246 | However, linking a "work that uses the Library" with the Library 247 | creates an executable that is a derivative of the Library (because it 248 | contains portions of the Library), rather than a "work that uses the 249 | library". The executable is therefore covered by this License. 250 | Section 6 states terms for distribution of such executables. 251 | 252 | When a "work that uses the Library" uses material from a header file 253 | that is part of the Library, the object code for the work may be a 254 | derivative work of the Library even though the source code is not. 255 | Whether this is true is especially significant if the work can be 256 | linked without the Library, or if the work is itself a library. The 257 | threshold for this to be true is not precisely defined by law. 258 | 259 | If such an object file uses only numerical parameters, data 260 | structure layouts and accessors, and small macros and small inline 261 | functions (ten lines or less in length), then the use of the object 262 | file is unrestricted, regardless of whether it is legally a derivative 263 | work. (Executables containing this object code plus portions of the 264 | Library will still fall under Section 6.) 265 | 266 | Otherwise, if the work is a derivative of the Library, you may 267 | distribute the object code for the work under the terms of Section 6. 268 | Any executables containing that work also fall under Section 6, 269 | whether or not they are linked directly with the Library itself. 270 | 271 | 6. As an exception to the Sections above, you may also combine or 272 | link a "work that uses the Library" with the Library to produce a 273 | work containing portions of the Library, and distribute that work 274 | under terms of your choice, provided that the terms permit 275 | modification of the work for the customer's own use and reverse 276 | engineering for debugging such modifications. 277 | 278 | You must give prominent notice with each copy of the work that the 279 | Library is used in it and that the Library and its use are covered by 280 | this License. You must supply a copy of this License. If the work 281 | during execution displays copyright notices, you must include the 282 | copyright notice for the Library among them, as well as a reference 283 | directing the user to the copy of this License. Also, you must do one 284 | of these things: 285 | 286 | a) Accompany the work with the complete corresponding 287 | machine-readable source code for the Library including whatever 288 | changes were used in the work (which must be distributed under 289 | Sections 1 and 2 above); and, if the work is an executable linked 290 | with the Library, with the complete machine-readable "work that 291 | uses the Library", as object code and/or source code, so that the 292 | user can modify the Library and then relink to produce a modified 293 | executable containing the modified Library. (It is understood 294 | that the user who changes the contents of definitions files in the 295 | Library will not necessarily be able to recompile the application 296 | to use the modified definitions.) 297 | 298 | b) Use a suitable shared library mechanism for linking with the 299 | Library. A suitable mechanism is one that (1) uses at run time a 300 | copy of the library already present on the user's computer system, 301 | rather than copying library functions into the executable, and (2) 302 | will operate properly with a modified version of the library, if 303 | the user installs one, as long as the modified version is 304 | interface-compatible with the version that the work was made with. 305 | 306 | c) Accompany the work with a written offer, valid for at 307 | least three years, to give the same user the materials 308 | specified in Subsection 6a, above, for a charge no more 309 | than the cost of performing this distribution. 310 | 311 | d) If distribution of the work is made by offering access to copy 312 | from a designated place, offer equivalent access to copy the above 313 | specified materials from the same place. 314 | 315 | e) Verify that the user has already received a copy of these 316 | materials or that you have already sent this user a copy. 317 | 318 | For an executable, the required form of the "work that uses the 319 | Library" must include any data and utility programs needed for 320 | reproducing the executable from it. However, as a special exception, 321 | the materials to be distributed need not include anything that is 322 | normally distributed (in either source or binary form) with the major 323 | components (compiler, kernel, and so on) of the operating system on 324 | which the executable runs, unless that component itself accompanies 325 | the executable. 326 | 327 | It may happen that this requirement contradicts the license 328 | restrictions of other proprietary libraries that do not normally 329 | accompany the operating system. Such a contradiction means you cannot 330 | use both them and the Library together in an executable that you 331 | distribute. 332 | 333 | 7. You may place library facilities that are a work based on the 334 | Library side-by-side in a single library together with other library 335 | facilities not covered by this License, and distribute such a combined 336 | library, provided that the separate distribution of the work based on 337 | the Library and of the other library facilities is otherwise 338 | permitted, and provided that you do these two things: 339 | 340 | a) Accompany the combined library with a copy of the same work 341 | based on the Library, uncombined with any other library 342 | facilities. This must be distributed under the terms of the 343 | Sections above. 344 | 345 | b) Give prominent notice with the combined library of the fact 346 | that part of it is a work based on the Library, and explaining 347 | where to find the accompanying uncombined form of the same work. 348 | 349 | 8. You may not copy, modify, sublicense, link with, or distribute 350 | the Library except as expressly provided under this License. Any 351 | attempt otherwise to copy, modify, sublicense, link with, or 352 | distribute the Library is void, and will automatically terminate your 353 | rights under this License. However, parties who have received copies, 354 | or rights, from you under this License will not have their licenses 355 | terminated so long as such parties remain in full compliance. 356 | 357 | 9. You are not required to accept this License, since you have not 358 | signed it. However, nothing else grants you permission to modify or 359 | distribute the Library or its derivative works. These actions are 360 | prohibited by law if you do not accept this License. Therefore, by 361 | modifying or distributing the Library (or any work based on the 362 | Library), you indicate your acceptance of this License to do so, and 363 | all its terms and conditions for copying, distributing or modifying 364 | the Library or works based on it. 365 | 366 | 10. Each time you redistribute the Library (or any work based on the 367 | Library), the recipient automatically receives a license from the 368 | original licensor to copy, distribute, link with or modify the Library 369 | subject to these terms and conditions. You may not impose any further 370 | restrictions on the recipients' exercise of the rights granted herein. 371 | You are not responsible for enforcing compliance by third parties with 372 | this License. 373 | 374 | 11. If, as a consequence of a court judgment or allegation of patent 375 | infringement or for any other reason (not limited to patent issues), 376 | conditions are imposed on you (whether by court order, agreement or 377 | otherwise) that contradict the conditions of this License, they do not 378 | excuse you from the conditions of this License. If you cannot 379 | distribute so as to satisfy simultaneously your obligations under this 380 | License and any other pertinent obligations, then as a consequence you 381 | may not distribute the Library at all. For example, if a patent 382 | license would not permit royalty-free redistribution of the Library by 383 | all those who receive copies directly or indirectly through you, then 384 | the only way you could satisfy both it and this License would be to 385 | refrain entirely from distribution of the Library. 386 | 387 | If any portion of this section is held invalid or unenforceable under any 388 | particular circumstance, the balance of the section is intended to apply, 389 | and the section as a whole is intended to apply in other circumstances. 390 | 391 | It is not the purpose of this section to induce you to infringe any 392 | patents or other property right claims or to contest validity of any 393 | such claims; this section has the sole purpose of protecting the 394 | integrity of the free software distribution system which is 395 | implemented by public license practices. Many people have made 396 | generous contributions to the wide range of software distributed 397 | through that system in reliance on consistent application of that 398 | system; it is up to the author/donor to decide if he or she is willing 399 | to distribute software through any other system and a licensee cannot 400 | impose that choice. 401 | 402 | This section is intended to make thoroughly clear what is believed to 403 | be a consequence of the rest of this License. 404 | 405 | 12. If the distribution and/or use of the Library is restricted in 406 | certain countries either by patents or by copyrighted interfaces, the 407 | original copyright holder who places the Library under this License may add 408 | an explicit geographical distribution limitation excluding those countries, 409 | so that distribution is permitted only in or among countries not thus 410 | excluded. In such case, this License incorporates the limitation as if 411 | written in the body of this License. 412 | 413 | 13. The Free Software Foundation may publish revised and/or new 414 | versions of the Lesser General Public License from time to time. 415 | Such new versions will be similar in spirit to the present version, 416 | but may differ in detail to address new problems or concerns. 417 | 418 | Each version is given a distinguishing version number. If the Library 419 | specifies a version number of this License which applies to it and 420 | "any later version", you have the option of following the terms and 421 | conditions either of that version or of any later version published by 422 | the Free Software Foundation. If the Library does not specify a 423 | license version number, you may choose any version ever published by 424 | the Free Software Foundation. 425 | 426 | 14. If you wish to incorporate parts of the Library into other free 427 | programs whose distribution conditions are incompatible with these, 428 | write to the author to ask for permission. For software which is 429 | copyrighted by the Free Software Foundation, write to the Free 430 | Software Foundation; we sometimes make exceptions for this. Our 431 | decision will be guided by the two goals of preserving the free status 432 | of all derivatives of our free software and of promoting the sharing 433 | and reuse of software generally. 434 | 435 | NO WARRANTY 436 | 437 | 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO 438 | WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. 439 | EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR 440 | OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY 441 | KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE 442 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 443 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE 444 | LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME 445 | THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 446 | 447 | 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN 448 | WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY 449 | AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU 450 | FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR 451 | CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE 452 | LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING 453 | RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A 454 | FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF 455 | SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH 456 | DAMAGES. 457 | 458 | END OF TERMS AND CONDITIONS 459 | 460 | How to Apply These Terms to Your New Libraries 461 | 462 | If you develop a new library, and you want it to be of the greatest 463 | possible use to the public, we recommend making it free software that 464 | everyone can redistribute and change. You can do so by permitting 465 | redistribution under these terms (or, alternatively, under the terms of the 466 | ordinary General Public License). 467 | 468 | To apply these terms, attach the following notices to the library. It is 469 | safest to attach them to the start of each source file to most effectively 470 | convey the exclusion of warranty; and each file should have at least the 471 | "copyright" line and a pointer to where the full notice is found. 472 | 473 | 474 | Copyright (C) 475 | 476 | This library is free software; you can redistribute it and/or 477 | modify it under the terms of the GNU Lesser General Public 478 | License as published by the Free Software Foundation; either 479 | version 2.1 of the License, or (at your option) any later version. 480 | 481 | This library is distributed in the hope that it will be useful, 482 | but WITHOUT ANY WARRANTY; without even the implied warranty of 483 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 484 | Lesser General Public License for more details. 485 | 486 | You should have received a copy of the GNU Lesser General Public 487 | License along with this library; if not, write to the Free Software 488 | Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 489 | USA 490 | 491 | Also add information on how to contact you by electronic and paper mail. 492 | 493 | You should also get your employer (if you work as a programmer) or your 494 | school, if any, to sign a "copyright disclaimer" for the library, if 495 | necessary. Here is a sample; alter the names: 496 | 497 | Yoyodyne, Inc., hereby disclaims all copyright interest in the 498 | library `Frob' (a library for tweaking knobs) written by James Random 499 | Hacker. 500 | 501 | , 1 April 1990 502 | Ty Coon, President of Vice 503 | 504 | That's all there is to it! 505 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # BDSNetRunner 2 | 3 | #### 介绍 4 | 提供Win版MC服务端下.Net插件运行平台(源自player技术支持) 5 | 6 | #### 软件架构 7 | 采用JSONCPP开源框架 8 | 9 | #### 使用方式 10 | 放置CSR插件库目录至BDS所在目录下加载即可。 11 | 12 | 如何编译: 13 | 解压工程目录中 MCBDS插件开发助手.zip ,使用工具导出MC服务端对应的pdb文件 RVAs.hpp 替换原工程文件即可。 14 | 15 | #### Commercial License 16 | LGPL --------------------------------------------------------------------------------