first commit
This commit is contained in:
commit
c2a4375ffd
|
@ -0,0 +1,261 @@
|
||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.userosscache
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
|
*.userprefs
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
[Dd]ebug/
|
||||||
|
[Dd]ebugPublic/
|
||||||
|
[Rr]elease/
|
||||||
|
[Rr]eleases/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Ll]og/
|
||||||
|
|
||||||
|
# Visual Studio 2015 cache/options directory
|
||||||
|
.vs/
|
||||||
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
#wwwroot/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
# NUNIT
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
|
||||||
|
# Build Results of an ATL Project
|
||||||
|
[Dd]ebugPS/
|
||||||
|
[Rr]eleasePS/
|
||||||
|
dlldata.c
|
||||||
|
|
||||||
|
# DNX
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*_i.h
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*.log
|
||||||
|
*.vspscc
|
||||||
|
*.vssscc
|
||||||
|
.builds
|
||||||
|
*.pidb
|
||||||
|
*.svclog
|
||||||
|
*.scc
|
||||||
|
|
||||||
|
# Chutzpah Test files
|
||||||
|
_Chutzpah*
|
||||||
|
|
||||||
|
# Visual C++ cache files
|
||||||
|
ipch/
|
||||||
|
*.aps
|
||||||
|
*.ncb
|
||||||
|
*.opendb
|
||||||
|
*.opensdf
|
||||||
|
*.sdf
|
||||||
|
*.cachefile
|
||||||
|
*.VC.db
|
||||||
|
*.VC.VC.opendb
|
||||||
|
|
||||||
|
# Visual Studio profiler
|
||||||
|
*.psess
|
||||||
|
*.vsp
|
||||||
|
*.vspx
|
||||||
|
*.sap
|
||||||
|
|
||||||
|
# TFS 2012 Local Workspace
|
||||||
|
$tf/
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
*.DotSettings.user
|
||||||
|
|
||||||
|
# JustCode is a .NET coding add-in
|
||||||
|
.JustCode
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# NCrunch
|
||||||
|
_NCrunch_*
|
||||||
|
.*crunch*.local.xml
|
||||||
|
nCrunchTemp_*
|
||||||
|
|
||||||
|
# MightyMoose
|
||||||
|
*.mm.*
|
||||||
|
AutoTest.Net/
|
||||||
|
|
||||||
|
# Web workbench (sass)
|
||||||
|
.sass-cache/
|
||||||
|
|
||||||
|
# Installshield output folder
|
||||||
|
[Ee]xpress/
|
||||||
|
|
||||||
|
# DocProject is a documentation generator add-in
|
||||||
|
DocProject/buildhelp/
|
||||||
|
DocProject/Help/*.HxT
|
||||||
|
DocProject/Help/*.HxC
|
||||||
|
DocProject/Help/*.hhc
|
||||||
|
DocProject/Help/*.hhk
|
||||||
|
DocProject/Help/*.hhp
|
||||||
|
DocProject/Help/Html2
|
||||||
|
DocProject/Help/html
|
||||||
|
|
||||||
|
# Click-Once directory
|
||||||
|
publish/
|
||||||
|
|
||||||
|
# Publish Web Output
|
||||||
|
*.[Pp]ublish.xml
|
||||||
|
*.azurePubxml
|
||||||
|
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||||
|
# but database connection strings (with potential passwords) will be unencrypted
|
||||||
|
#*.pubxml
|
||||||
|
*.publishproj
|
||||||
|
|
||||||
|
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||||
|
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||||
|
# in these scripts will be unencrypted
|
||||||
|
PublishScripts/
|
||||||
|
|
||||||
|
# NuGet Packages
|
||||||
|
*.nupkg
|
||||||
|
# The packages folder can be ignored because of Package Restore
|
||||||
|
**/packages/*
|
||||||
|
# except build/, which is used as an MSBuild target.
|
||||||
|
!**/packages/build/
|
||||||
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
|
#!**/packages/repositories.config
|
||||||
|
# NuGet v3's project.json files produces more ignoreable files
|
||||||
|
*.nuget.props
|
||||||
|
*.nuget.targets
|
||||||
|
|
||||||
|
# Microsoft Azure Build Output
|
||||||
|
csx/
|
||||||
|
*.build.csdef
|
||||||
|
|
||||||
|
# Microsoft Azure Emulator
|
||||||
|
ecf/
|
||||||
|
rcf/
|
||||||
|
|
||||||
|
# Windows Store app package directories and files
|
||||||
|
AppPackages/
|
||||||
|
BundleArtifacts/
|
||||||
|
Package.StoreAssociation.xml
|
||||||
|
_pkginfo.txt
|
||||||
|
|
||||||
|
# Visual Studio cache files
|
||||||
|
# files ending in .cache can be ignored
|
||||||
|
*.[Cc]ache
|
||||||
|
# but keep track of directories ending in .cache
|
||||||
|
!*.[Cc]ache/
|
||||||
|
|
||||||
|
# Others
|
||||||
|
ClientBin/
|
||||||
|
~$*
|
||||||
|
*~
|
||||||
|
*.dbmdl
|
||||||
|
*.dbproj.schemaview
|
||||||
|
*.jfm
|
||||||
|
*.pfx
|
||||||
|
*.publishsettings
|
||||||
|
node_modules/
|
||||||
|
orleans.codegen.cs
|
||||||
|
|
||||||
|
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||||
|
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||||
|
#bower_components/
|
||||||
|
|
||||||
|
# RIA/Silverlight projects
|
||||||
|
Generated_Code/
|
||||||
|
|
||||||
|
# Backup & report files from converting an old project file
|
||||||
|
# to a newer Visual Studio version. Backup files are not needed,
|
||||||
|
# because we have git ;-)
|
||||||
|
_UpgradeReport_Files/
|
||||||
|
Backup*/
|
||||||
|
UpgradeLog*.XML
|
||||||
|
UpgradeLog*.htm
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
*.mdf
|
||||||
|
*.ldf
|
||||||
|
|
||||||
|
# Business Intelligence projects
|
||||||
|
*.rdl.data
|
||||||
|
*.bim.layout
|
||||||
|
*.bim_*.settings
|
||||||
|
|
||||||
|
# Microsoft Fakes
|
||||||
|
FakesAssemblies/
|
||||||
|
|
||||||
|
# GhostDoc plugin setting file
|
||||||
|
*.GhostDoc.xml
|
||||||
|
|
||||||
|
# Node.js Tools for Visual Studio
|
||||||
|
.ntvs_analysis.dat
|
||||||
|
|
||||||
|
# Visual Studio 6 build log
|
||||||
|
*.plg
|
||||||
|
|
||||||
|
# Visual Studio 6 workspace options file
|
||||||
|
*.opt
|
||||||
|
|
||||||
|
# Visual Studio LightSwitch build output
|
||||||
|
**/*.HTMLClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/GeneratedArtifacts
|
||||||
|
**/*.DesktopClient/ModelManifest.xml
|
||||||
|
**/*.Server/GeneratedArtifacts
|
||||||
|
**/*.Server/ModelManifest.xml
|
||||||
|
_Pvt_Extensions
|
||||||
|
|
||||||
|
# Paket dependency manager
|
||||||
|
.paket/paket.exe
|
||||||
|
paket-files/
|
||||||
|
|
||||||
|
# FAKE - F# Make
|
||||||
|
.fake/
|
||||||
|
|
||||||
|
# JetBrains Rider
|
||||||
|
.idea/
|
||||||
|
*.sln.iml
|
||||||
|
|
||||||
|
# CodeRush
|
||||||
|
.cr/
|
||||||
|
|
||||||
|
# Python Tools for Visual Studio (PTVS)
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
|
@ -0,0 +1,73 @@
|
||||||
|
Apache License
|
||||||
|
Version 2.0, January 2004
|
||||||
|
http://www.apache.org/licenses/
|
||||||
|
|
||||||
|
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||||
|
|
||||||
|
1. Definitions.
|
||||||
|
|
||||||
|
"License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document.
|
||||||
|
|
||||||
|
"Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License.
|
||||||
|
|
||||||
|
"Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
|
||||||
|
|
||||||
|
"You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License.
|
||||||
|
|
||||||
|
"Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files.
|
||||||
|
|
||||||
|
"Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types.
|
||||||
|
|
||||||
|
"Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below).
|
||||||
|
|
||||||
|
"Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof.
|
||||||
|
|
||||||
|
"Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution."
|
||||||
|
|
||||||
|
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work.
|
||||||
|
|
||||||
|
2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form.
|
||||||
|
|
||||||
|
3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed.
|
||||||
|
|
||||||
|
4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions:
|
||||||
|
|
||||||
|
(a) You must give any other recipients of the Work or Derivative Works a copy of this License; and
|
||||||
|
|
||||||
|
(b) You must cause any modified files to carry prominent notices stating that You changed the files; and
|
||||||
|
|
||||||
|
(c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and
|
||||||
|
|
||||||
|
(d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License.
|
||||||
|
|
||||||
|
You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License.
|
||||||
|
|
||||||
|
5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions.
|
||||||
|
|
||||||
|
6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file.
|
||||||
|
|
||||||
|
7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.
|
||||||
|
|
||||||
|
8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages.
|
||||||
|
|
||||||
|
9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability.
|
||||||
|
|
||||||
|
END OF TERMS AND CONDITIONS
|
||||||
|
|
||||||
|
APPENDIX: How to apply the Apache License to your work.
|
||||||
|
|
||||||
|
To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "[]" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives.
|
||||||
|
|
||||||
|
Copyright [yyyy] [name of copyright owner]
|
||||||
|
|
||||||
|
Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
you may not use this file except in compliance with the License.
|
||||||
|
You may obtain a copy of the License at
|
||||||
|
|
||||||
|
http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
|
||||||
|
Unless required by applicable law or agreed to in writing, software
|
||||||
|
distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
See the License for the specific language governing permissions and
|
||||||
|
limitations under the License.
|
|
@ -0,0 +1,25 @@
|
||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.10.35122.118
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MxWSim", "MxWSim\MxWSim.csproj", "{A41C9CD0-D7F1-43B2-9B11-B37BB8930D9B}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{A41C9CD0-D7F1-43B2-9B11-B37BB8930D9B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{A41C9CD0-D7F1-43B2-9B11-B37BB8930D9B}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{A41C9CD0-D7F1-43B2-9B11-B37BB8930D9B}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{A41C9CD0-D7F1-43B2-9B11-B37BB8930D9B}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {297860D8-BEFB-4677-B684-7557E5119D6C}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
|
@ -0,0 +1,22 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<configuration>
|
||||||
|
<startup>
|
||||||
|
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.8.1" />
|
||||||
|
</startup>
|
||||||
|
<runtime>
|
||||||
|
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Runtime.CompilerServices.Unsafe" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Memory" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-4.0.1.2" newVersion="4.0.1.2" />
|
||||||
|
</dependentAssembly>
|
||||||
|
<dependentAssembly>
|
||||||
|
<assemblyIdentity name="System.Diagnostics.DiagnosticSource" publicKeyToken="cc7b13ffcd2ddd51" culture="neutral" />
|
||||||
|
<bindingRedirect oldVersion="0.0.0.0-8.0.0.1" newVersion="8.0.0.1" />
|
||||||
|
</dependentAssembly>
|
||||||
|
</assemblyBinding>
|
||||||
|
</runtime>
|
||||||
|
</configuration>
|
|
@ -0,0 +1,117 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||||
|
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||||
|
<PropertyGroup>
|
||||||
|
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||||
|
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||||
|
<ProjectGuid>{A41C9CD0-D7F1-43B2-9B11-B37BB8930D9B}</ProjectGuid>
|
||||||
|
<OutputType>Exe</OutputType>
|
||||||
|
<RootNamespace>MxWSim</RootNamespace>
|
||||||
|
<AssemblyName>MxWSim</AssemblyName>
|
||||||
|
<TargetFrameworkVersion>v4.8.1</TargetFrameworkVersion>
|
||||||
|
<FileAlignment>512</FileAlignment>
|
||||||
|
<AutoGenerateBindingRedirects>true</AutoGenerateBindingRedirects>
|
||||||
|
<Deterministic>true</Deterministic>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugSymbols>true</DebugSymbols>
|
||||||
|
<DebugType>full</DebugType>
|
||||||
|
<Optimize>false</Optimize>
|
||||||
|
<OutputPath>bin\Debug\</OutputPath>
|
||||||
|
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||||
|
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||||
|
<DebugType>pdbonly</DebugType>
|
||||||
|
<Optimize>true</Optimize>
|
||||||
|
<OutputPath>bin\Release\</OutputPath>
|
||||||
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
|
<ErrorReport>prompt</ErrorReport>
|
||||||
|
<WarningLevel>4</WarningLevel>
|
||||||
|
</PropertyGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Reference Include="BouncyCastle.Cryptography, Version=2.0.0.0, Culture=neutral, PublicKeyToken=072edcf4a5328938, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\BouncyCastle.Cryptography.2.3.1\lib\net461\BouncyCastle.Cryptography.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Google.Protobuf, Version=3.26.1.0, Culture=neutral, PublicKeyToken=a7d26565bac4d604, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Google.Protobuf.3.26.1\lib\net45\Google.Protobuf.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="K4os.Compression.LZ4, Version=1.3.8.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\K4os.Compression.LZ4.1.3.8\lib\net462\K4os.Compression.LZ4.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="K4os.Compression.LZ4.Streams, Version=1.3.8.0, Culture=neutral, PublicKeyToken=2186fa9121ef231d, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\K4os.Compression.LZ4.Streams.1.3.8\lib\net462\K4os.Compression.LZ4.Streams.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="K4os.Hash.xxHash, Version=1.0.8.0, Culture=neutral, PublicKeyToken=32cd54395057cec3, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\K4os.Hash.xxHash.1.0.8\lib\net462\K4os.Hash.xxHash.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Bcl.AsyncInterfaces, Version=5.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Bcl.AsyncInterfaces.5.0.0\lib\net461\Microsoft.Bcl.AsyncInterfaces.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Microsoft.Extensions.Logging.Abstractions, Version=7.0.0.1, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Microsoft.Extensions.Logging.Abstractions.7.0.1\lib\net462\Microsoft.Extensions.Logging.Abstractions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="MySqlConnector, Version=2.0.0.0, Culture=neutral, PublicKeyToken=d33d3e53aa5f8c92, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\MySqlConnector.2.3.7\lib\net48\MySqlConnector.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="Newtonsoft.Json, Version=13.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\Newtonsoft.Json.13.0.3\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System" />
|
||||||
|
<Reference Include="System.Buffers, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Configuration" />
|
||||||
|
<Reference Include="System.Configuration.ConfigurationManager, Version=8.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Configuration.ConfigurationManager.8.0.0\lib\net462\System.Configuration.ConfigurationManager.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Core" />
|
||||||
|
<Reference Include="System.Diagnostics.DiagnosticSource, Version=8.0.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Diagnostics.DiagnosticSource.8.0.1\lib\net462\System.Diagnostics.DiagnosticSource.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.IO.Pipelines, Version=5.0.0.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.IO.Pipelines.5.0.2\lib\net461\System.IO.Pipelines.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Management" />
|
||||||
|
<Reference Include="System.Memory, Version=4.0.1.2, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Memory.4.5.5\lib\net461\System.Memory.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Numerics" />
|
||||||
|
<Reference Include="System.Numerics.Vectors, Version=4.1.4.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Numerics.Vectors.4.5.0\lib\net46\System.Numerics.Vectors.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Runtime.CompilerServices.Unsafe, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Runtime.CompilerServices.Unsafe.6.0.0\lib\net461\System.Runtime.CompilerServices.Unsafe.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Threading.Tasks.Extensions, Version=4.2.0.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\System.Threading.Tasks.Extensions.4.5.4\lib\net461\System.Threading.Tasks.Extensions.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
<Reference Include="System.Transactions" />
|
||||||
|
<Reference Include="System.Xml.Linq" />
|
||||||
|
<Reference Include="System.Data.DataSetExtensions" />
|
||||||
|
<Reference Include="Microsoft.CSharp" />
|
||||||
|
<Reference Include="System.Data" />
|
||||||
|
<Reference Include="System.Net.Http" />
|
||||||
|
<Reference Include="System.Xml" />
|
||||||
|
<Reference Include="ZstdSharp, Version=0.8.0.0, Culture=neutral, PublicKeyToken=8d151af33a4ad5cf, processorArchitecture=MSIL">
|
||||||
|
<HintPath>..\packages\ZstdSharp.Port.0.8.0\lib\net462\ZstdSharp.dll</HintPath>
|
||||||
|
</Reference>
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<Compile Include="Program.cs" />
|
||||||
|
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||||
|
<Compile Include="Utilities\DB.cs" />
|
||||||
|
<Compile Include="Utilities\Gear.cs" />
|
||||||
|
<Compile Include="Utilities\Message.cs" />
|
||||||
|
<Compile Include="Utilities\Settings.cs" />
|
||||||
|
<Compile Include="Utilities\Sim.cs" />
|
||||||
|
</ItemGroup>
|
||||||
|
<ItemGroup>
|
||||||
|
<None Include="App.config" />
|
||||||
|
<None Include="packages.config" />
|
||||||
|
</ItemGroup>
|
||||||
|
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||||
|
</Project>
|
|
@ -0,0 +1,67 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using MxWSim.Utilities;
|
||||||
|
|
||||||
|
namespace MxWSim
|
||||||
|
{
|
||||||
|
internal class Program
|
||||||
|
{
|
||||||
|
/// Internal
|
||||||
|
public static string version = "1.1.1";
|
||||||
|
/// Loop and Console Logic
|
||||||
|
public static string state = "init";
|
||||||
|
public static string last_state = "";
|
||||||
|
public static bool loop = true;
|
||||||
|
/// Job Logic
|
||||||
|
List<int> jq = new List<int>();
|
||||||
|
static void Main(string[] args)
|
||||||
|
{
|
||||||
|
while (loop)
|
||||||
|
{
|
||||||
|
switch (state)
|
||||||
|
{
|
||||||
|
case "init":
|
||||||
|
Message.CMW($"[{state}] Initializing the ecosystem.", true, 1);
|
||||||
|
state = "status";
|
||||||
|
last_state = "init";
|
||||||
|
break;
|
||||||
|
case "status":
|
||||||
|
Message.CMW($"[{state}] Changing MxWSim status to \"READY\".", true, 1);
|
||||||
|
DB.SetMxWSimStatus("READY", Settings.GetBID());
|
||||||
|
state = "idle";
|
||||||
|
last_state = "status";
|
||||||
|
break;
|
||||||
|
case "idle":
|
||||||
|
if (last_state != "idle") { Message.CMW($"[{state}] Waiting for jobs in queue...", true, 2); }
|
||||||
|
if (DB.CountAwaitingInQueueByStatus("WAITING") >= 1)
|
||||||
|
{
|
||||||
|
if (DB.EnumerateQueueByStatus("WAITING").Count >= 1)
|
||||||
|
{
|
||||||
|
foreach (var q in DB.EnumerateQueueByStatus("WAITING"))
|
||||||
|
{
|
||||||
|
Message.CMW($"[{state}] Changing MxWSim status to \"WORKING\".", true, 1);
|
||||||
|
DB.SetMxWSimStatus("WORKING", Settings.GetBID());
|
||||||
|
Message.CMW($"[{state}] Processing Queued Sim ID#{q} for User {DB.GetUserNameByUID(DB.GetUserUIDByQID(q))} (ID#{DB.GetUserUIDByQID(q)}).", true, 1);
|
||||||
|
string data = DB.GetQueueDataByQID(q);
|
||||||
|
File.WriteAllText($"tmp/{DB.GetUserUIDByQID(q)}.simc", data);
|
||||||
|
Sim.RunSim(q);
|
||||||
|
Sim.SendSim(DB.GetUserUIDByQID(q));
|
||||||
|
Gear.AddSimGear(DB.GetUserUIDByQID(q));
|
||||||
|
DB.SetQueueStatus("DONE", q);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Message.CMW($"[{state}] Waiting for 10 seconds...", true, 2);
|
||||||
|
Thread.Sleep(10000);
|
||||||
|
last_state = "idle";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,36 @@
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Runtime.CompilerServices;
|
||||||
|
using System.Runtime.InteropServices;
|
||||||
|
|
||||||
|
// General Information about an assembly is controlled through the following
|
||||||
|
// set of attributes. Change these attribute values to modify the information
|
||||||
|
// associated with an assembly.
|
||||||
|
[assembly: AssemblyTitle("MxWSim")]
|
||||||
|
[assembly: AssemblyDescription("")]
|
||||||
|
[assembly: AssemblyConfiguration("")]
|
||||||
|
[assembly: AssemblyCompany("")]
|
||||||
|
[assembly: AssemblyProduct("MxWSim")]
|
||||||
|
[assembly: AssemblyCopyright("Copyright © 2024")]
|
||||||
|
[assembly: AssemblyTrademark("")]
|
||||||
|
[assembly: AssemblyCulture("")]
|
||||||
|
|
||||||
|
// Setting ComVisible to false makes the types in this assembly not visible
|
||||||
|
// to COM components. If you need to access a type in this assembly from
|
||||||
|
// COM, set the ComVisible attribute to true on that type.
|
||||||
|
[assembly: ComVisible(false)]
|
||||||
|
|
||||||
|
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||||
|
[assembly: Guid("a41c9cd0-d7f1-43b2-9b11-b37bb8930d9b")]
|
||||||
|
|
||||||
|
// Version information for an assembly consists of the following four values:
|
||||||
|
//
|
||||||
|
// Major Version
|
||||||
|
// Minor Version
|
||||||
|
// Build Number
|
||||||
|
// Revision
|
||||||
|
//
|
||||||
|
// You can specify all the values or you can default the Build and Revision Numbers
|
||||||
|
// by using the '*' as shown below:
|
||||||
|
// [assembly: AssemblyVersion("1.0.*")]
|
||||||
|
[assembly: AssemblyVersion("1.0.0.0")]
|
||||||
|
[assembly: AssemblyFileVersion("1.0.0.0")]
|
|
@ -0,0 +1,117 @@
|
||||||
|
using MySqlConnector;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Data.SqlClient;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MxWSim.Utilities
|
||||||
|
{
|
||||||
|
internal class DB
|
||||||
|
{
|
||||||
|
public static MySqlConnection MxWDB()
|
||||||
|
{
|
||||||
|
MySqlConnection conn;
|
||||||
|
string myConnectionString;
|
||||||
|
|
||||||
|
myConnectionString = string.Format("server={0};port={1};uid={2};pwd={3};database={4};", Settings.GetDBHost(), Settings.GetDBPort(), Settings.GetDBUser(), Settings.GetDBPass(), Settings.GetDBName());
|
||||||
|
conn = new MySqlConnection();
|
||||||
|
conn.ConnectionString = myConnectionString;
|
||||||
|
return conn;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetUserNameByUID(int uid)
|
||||||
|
{
|
||||||
|
using (var con = MxWDB())
|
||||||
|
{
|
||||||
|
string cmdText = $"SELECT * FROM mxw_user WHERE uid = '{uid}'";
|
||||||
|
MySqlCommand cmd = new MySqlCommand(cmdText, con);
|
||||||
|
con.Open();
|
||||||
|
var row = cmd.ExecuteReader();
|
||||||
|
if (row.HasRows) { row.Read(); return row["account"].ToString(); } else { return ""; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int GetUserUIDByQID(int qid)
|
||||||
|
{
|
||||||
|
using (var con = MxWDB())
|
||||||
|
{
|
||||||
|
string cmdText = $"SELECT * FROM mxw_queue WHERE qid = '{qid}'";
|
||||||
|
MySqlCommand cmd = new MySqlCommand(cmdText, con);
|
||||||
|
con.Open();
|
||||||
|
var row = cmd.ExecuteReader();
|
||||||
|
if (row.HasRows) { row.Read(); return Convert.ToInt32(row["uid"]); } else { return 0; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int GetSimLatestSIDByUID(int uid)
|
||||||
|
{
|
||||||
|
using (var con = MxWDB())
|
||||||
|
{
|
||||||
|
string cmdText = $"SELECT * FROM mxw_sim WHERE uid = '{uid}' ORDER BY sid DESC";
|
||||||
|
MySqlCommand cmd = new MySqlCommand(cmdText, con);
|
||||||
|
con.Open();
|
||||||
|
var row = cmd.ExecuteReader();
|
||||||
|
if (row.HasRows) { row.Read(); return Convert.ToInt32(row["sid"]); } else { return 0; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static string GetQueueDataByQID(int qid)
|
||||||
|
{
|
||||||
|
using (var con = MxWDB())
|
||||||
|
{
|
||||||
|
string cmdText = $"SELECT * FROM mxw_queue WHERE qid = '{qid}'";
|
||||||
|
MySqlCommand cmd = new MySqlCommand(cmdText, con);
|
||||||
|
con.Open();
|
||||||
|
var row = cmd.ExecuteReader();
|
||||||
|
if (row.HasRows) { row.Read(); return row["data"].ToString(); } else { return ""; }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetQueueStatus(string status, int qid)
|
||||||
|
{
|
||||||
|
MySqlConnection con = MxWDB();
|
||||||
|
string cmdText = $"UPDATE mxw_queue SET status = '{status}' WHERE qid = '{qid}'";
|
||||||
|
MySqlCommand cmd = new MySqlCommand(cmdText, con);
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
con.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SetMxWSimStatus(string status, int bid)
|
||||||
|
{
|
||||||
|
MySqlConnection con = MxWDB();
|
||||||
|
string cmdText = $"UPDATE mxw_status SET status = '{status}' WHERE bid = '{bid}'";
|
||||||
|
MySqlCommand cmd = new MySqlCommand(cmdText, con);
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
con.Close();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static int CountAwaitingInQueueByStatus(string status)
|
||||||
|
{
|
||||||
|
MySqlConnection con = MxWDB();
|
||||||
|
string cmdText = $"SELECT COUNT(*) FROM mxw_queue WHERE status = '{status}'";
|
||||||
|
MySqlCommand cmd = new MySqlCommand(cmdText, con);
|
||||||
|
con.Open();
|
||||||
|
int count = Convert.ToInt32(cmd.ExecuteScalar());
|
||||||
|
return count;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static List<int> EnumerateQueueByStatus(string status)
|
||||||
|
{
|
||||||
|
List<int> i = new List<int>();
|
||||||
|
MySqlConnection con = MxWDB();
|
||||||
|
string cmdText = $"SELECT * FROM mxw_queue WHERE status = '{status}'";
|
||||||
|
MySqlCommand cmd = new MySqlCommand(cmdText, con);
|
||||||
|
con.Open();
|
||||||
|
MySqlDataReader DR = cmd.ExecuteReader();
|
||||||
|
while (DR.Read())
|
||||||
|
{
|
||||||
|
i.Add(DR.GetInt32(0));
|
||||||
|
}
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,69 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using static MxWSim.Utilities.Sim;
|
||||||
|
using System.IO;
|
||||||
|
using MySqlConnector;
|
||||||
|
|
||||||
|
namespace MxWSim.Utilities
|
||||||
|
{
|
||||||
|
internal class Gear
|
||||||
|
{
|
||||||
|
public static int CalculateGearIlvl(int uid)
|
||||||
|
{
|
||||||
|
int total = 14;
|
||||||
|
Root r = JsonConvert.DeserializeObject<Root>(File.ReadAllText($"tmp/{uid}.json"));
|
||||||
|
int totalgear = r.sim.players[0].gear.head.ilevel + r.sim.players[0].gear.neck.ilevel + r.sim.players[0].gear.shoulders.ilevel + r.sim.players[0].gear.chest.ilevel + r.sim.players[0].gear.waist.ilevel + r.sim.players[0].gear.legs.ilevel + r.sim.players[0].gear.feet.ilevel + r.sim.players[0].gear.wrists.ilevel + r.sim.players[0].gear.hands.ilevel + r.sim.players[0].gear.finger1.ilevel + r.sim.players[0].gear.finger2.ilevel + r.sim.players[0].gear.trinket1.ilevel + r.sim.players[0].gear.trinket2.ilevel + r.sim.players[0].gear.back.ilevel;
|
||||||
|
if (r.sim.players[0].gear.main_hand != null) { totalgear = totalgear + r.sim.players[0].gear.main_hand.ilevel; total++; }
|
||||||
|
if (r.sim.players[0].gear.off_hand != null) { totalgear = totalgear + r.sim.players[0].gear.off_hand.ilevel; total++; }
|
||||||
|
return totalgear / total;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void AddSimGear(int uid)
|
||||||
|
{
|
||||||
|
Root r = JsonConvert.DeserializeObject<Root>(File.ReadAllText($"tmp/{uid}.json"));
|
||||||
|
|
||||||
|
string mainhand = "";
|
||||||
|
string offhand = "";
|
||||||
|
if (r.sim.players[0].gear.main_hand != null)
|
||||||
|
{
|
||||||
|
mainhand = $"{r.sim.players[0].gear.main_hand.encoded_item},item_level={r.sim.players[0].gear.main_hand.ilevel}";
|
||||||
|
}
|
||||||
|
if (r.sim.players[0].gear.off_hand != null)
|
||||||
|
{
|
||||||
|
offhand = $"{r.sim.players[0].gear.off_hand.encoded_item},item_level={r.sim.players[0].gear.off_hand.ilevel}";
|
||||||
|
}
|
||||||
|
using (var con = DB.MxWDB())
|
||||||
|
{
|
||||||
|
string cmdText = $"INSERT INTO mxw_gear (sid, uid, head, neck, shoulders, chest, waist, legs, feet, wrists, hands, finger1, finger2, trinket1, trinket2, back, main_hand, off_hand) " +
|
||||||
|
$"VALUES (" +
|
||||||
|
$"'{DB.GetSimLatestSIDByUID(uid)}'," +
|
||||||
|
$"'{uid}'," +
|
||||||
|
$"'{r.sim.players[0].gear.head.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.head.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.neck.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.neck.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.shoulders.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.shoulders.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.chest.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.chest.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.waist.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.waist.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.legs.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.legs.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.feet.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.feet.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.wrists.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.wrists.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.hands.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.hands.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.finger1.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.finger1.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.finger2.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.finger2.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.trinket1.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.trinket1.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.trinket2.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.trinket2.ilevel)}'," +
|
||||||
|
$"'{r.sim.players[0].gear.back.encoded_item},item_level={Convert.ToInt32(r.sim.players[0].gear.back.ilevel)}'," +
|
||||||
|
$"'{mainhand}'," +
|
||||||
|
$"'{offhand}'" +
|
||||||
|
$")";
|
||||||
|
MySqlCommand cmd = new MySqlCommand(cmdText, con);
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
con.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,104 @@
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.IO;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace MxWSim.Utilities
|
||||||
|
{
|
||||||
|
internal class Message
|
||||||
|
{
|
||||||
|
public static bool IsMyPayOver100(int pay)
|
||||||
|
{
|
||||||
|
if (pay > 100)
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
} else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public static void CMW(string msg, bool time, int color)
|
||||||
|
{
|
||||||
|
string seconds = "";
|
||||||
|
string minutes = "";
|
||||||
|
string hours = "";
|
||||||
|
if (DateTime.Now.Second < 10)
|
||||||
|
{
|
||||||
|
seconds = String.Format("0{0}", DateTime.Now.Second);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
seconds = DateTime.Now.Second.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DateTime.Now.Minute < 10)
|
||||||
|
{
|
||||||
|
minutes = String.Format("0{0}", DateTime.Now.Minute);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
minutes = DateTime.Now.Minute.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (DateTime.Now.Hour < 10)
|
||||||
|
{
|
||||||
|
hours = String.Format("0{0}", DateTime.Now.Hour);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
hours = DateTime.Now.Hour.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
string date = String.Format("{0}:{1}:{2}", hours, minutes, seconds);
|
||||||
|
|
||||||
|
File.AppendAllText(@"logs/message.logs", String.Format("[{0}] {1}", date, msg) + Environment.NewLine);
|
||||||
|
|
||||||
|
//color switch
|
||||||
|
ConsoleColor cc = ConsoleColor.White;
|
||||||
|
switch (color)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
//nothing
|
||||||
|
break;
|
||||||
|
case 1:
|
||||||
|
cc = ConsoleColor.Cyan;
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
cc = ConsoleColor.Green;
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
cc = ConsoleColor.Red;
|
||||||
|
break;
|
||||||
|
case 4:
|
||||||
|
cc = ConsoleColor.Yellow;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (time)
|
||||||
|
{
|
||||||
|
Console.ForegroundColor = cc;
|
||||||
|
Console.WriteLine(String.Format("[{0}] {1}", date, msg));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Console.ForegroundColor = cc;
|
||||||
|
Console.WriteLine(String.Format(""));
|
||||||
|
}
|
||||||
|
|
||||||
|
Console.ForegroundColor = ConsoleColor.White;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void Splash()
|
||||||
|
{
|
||||||
|
Console.ForegroundColor = ConsoleColor.Cyan;
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.WriteLine("#### MxWDB");
|
||||||
|
Console.WriteLine(string.Format("#### VERSION: {0}", Program.version));
|
||||||
|
Console.WriteLine("#### DEV: mikx");
|
||||||
|
Console.WriteLine("");
|
||||||
|
Console.ForegroundColor = ConsoleColor.White;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,53 @@
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.IO;
|
||||||
|
|
||||||
|
namespace MxWSim.Utilities
|
||||||
|
{
|
||||||
|
internal class Settings
|
||||||
|
{
|
||||||
|
public class SETTINGS
|
||||||
|
{
|
||||||
|
public string dbname { get; set; }
|
||||||
|
public string dbhost { get; set; }
|
||||||
|
public string dbport { get; set; }
|
||||||
|
public string dbuser { get; set; }
|
||||||
|
public string dbpass { get; set; }
|
||||||
|
public string simpath { get; set; }
|
||||||
|
public int bid { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
///<summary>
|
||||||
|
///Load the Database Host from the Settings Json.
|
||||||
|
///</summary>
|
||||||
|
public static string GetDBHost() => JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json")).dbhost;
|
||||||
|
///<summary>
|
||||||
|
///Load the Database Port from the Settings Json.
|
||||||
|
///</summary>
|
||||||
|
public static string GetDBPort() => JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json")).dbport;
|
||||||
|
///<summary>
|
||||||
|
///Load the Database Name from the Settings Json.
|
||||||
|
///</summary>
|
||||||
|
public static string GetDBName() => JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json")).dbname;
|
||||||
|
///<summary>
|
||||||
|
///Load the Database User from the Settings Json.
|
||||||
|
///</summary>
|
||||||
|
public static string GetDBUser() => JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json")).dbuser;
|
||||||
|
///<summary>
|
||||||
|
///Load the Database Password from the Settings Json.
|
||||||
|
///</summary>
|
||||||
|
public static string GetDBPass() => JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json")).dbpass;
|
||||||
|
///<summary>
|
||||||
|
///Load the Simc Path from the Settings Json.
|
||||||
|
///</summary>
|
||||||
|
public static string GetSimPath() => JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json")).simpath;
|
||||||
|
///<summary>
|
||||||
|
///Load the MxG Backend ID from the Json.
|
||||||
|
///</summary>
|
||||||
|
public static int GetBID() => JsonConvert.DeserializeObject<SETTINGS>(File.ReadAllText("settings.json")).bid;
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,744 @@
|
||||||
|
using Google.Protobuf.WellKnownTypes;
|
||||||
|
using MySqlConnector;
|
||||||
|
using Newtonsoft.Json;
|
||||||
|
using System;
|
||||||
|
using System.Collections;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Diagnostics;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
using System.Xml.Linq;
|
||||||
|
using System.IO;
|
||||||
|
using System.Configuration;
|
||||||
|
|
||||||
|
namespace MxWSim.Utilities
|
||||||
|
{
|
||||||
|
internal class Sim
|
||||||
|
{
|
||||||
|
// Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);
|
||||||
|
|
||||||
|
public class ActualAmount
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Attribute
|
||||||
|
{
|
||||||
|
public double strength { get; set; }
|
||||||
|
public double agility { get; set; }
|
||||||
|
public double stamina { get; set; }
|
||||||
|
public double intellect { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class AvgActualAmount
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Back
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int crit_rating { get; set; }
|
||||||
|
public int mastery_rating { get; set; }
|
||||||
|
public int stragiint { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class BuffsConstant
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string spell_name { get; set; }
|
||||||
|
public string spell_school { get; set; }
|
||||||
|
public int spell { get; set; }
|
||||||
|
public double start_count { get; set; }
|
||||||
|
public double duration { get; set; }
|
||||||
|
public double uptime { get; set; }
|
||||||
|
public double default_value { get; set; }
|
||||||
|
public double? overflow_stacks { get; set; }
|
||||||
|
public double? overflow_total { get; set; }
|
||||||
|
public Cooldown cooldown { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Chest
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int strint { get; set; }
|
||||||
|
public int crit_rating { get; set; }
|
||||||
|
public int haste_rating { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CombatEndResource
|
||||||
|
{
|
||||||
|
public Health health { get; set; }
|
||||||
|
public HolyPower holy_power { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class CompoundDmg
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Cooldown
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public double duration { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Count
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Custom
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Dmg
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Dps
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
public double median { get; set; }
|
||||||
|
public double variance { get; set; }
|
||||||
|
public double std_dev { get; set; }
|
||||||
|
public double mean_variance { get; set; }
|
||||||
|
public double mean_std_dev { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Dpse
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ExecutedForegroundActions
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Feet
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int strint { get; set; }
|
||||||
|
public int crit_rating { get; set; }
|
||||||
|
public int versatility_rating { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class FightActualAmount
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class FightLength
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class FightTotalAmount
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Finger1
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int haste_rating { get; set; }
|
||||||
|
public int versatility_rating { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Finger2
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int crit_rating { get; set; }
|
||||||
|
public int haste_rating { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Gain
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public HolyPower holy_power { get; set; }
|
||||||
|
public Health health { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Hands
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int strint { get; set; }
|
||||||
|
public int haste_rating { get; set; }
|
||||||
|
public int mastery_rating { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Head
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int crit_rating { get; set; }
|
||||||
|
public int mastery_rating { get; set; }
|
||||||
|
public int strint { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Health
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
public double mean_std_dev { get; set; }
|
||||||
|
public List<double> data { get; set; }
|
||||||
|
public double actual { get; set; }
|
||||||
|
public double overflow { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class HealthPct
|
||||||
|
{
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double mean_std_dev { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
public List<double> data { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class HolyPower
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public double count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
public double mean_std_dev { get; set; }
|
||||||
|
public List<double> data { get; set; }
|
||||||
|
public double actual { get; set; }
|
||||||
|
public double overflow { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Item
|
||||||
|
{
|
||||||
|
public int id { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Legs
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int haste_rating { get; set; }
|
||||||
|
public int mastery_rating { get; set; }
|
||||||
|
public int strint { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class MainHand
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int strength { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int haste_rating { get; set; }
|
||||||
|
public int mastery_rating { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class OffHand
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int strength { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int haste_rating { get; set; }
|
||||||
|
public int mastery_rating { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Neck
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int haste_rating { get; set; }
|
||||||
|
public int mastery_rating { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NumDirectResults
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NumExecutes
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NumRefreshes
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NumTickResults
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class NumTicks
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
public class OverkillPct
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Overrides
|
||||||
|
{
|
||||||
|
public int arcane_intellect { get; set; }
|
||||||
|
public int battle_shout { get; set; }
|
||||||
|
public int power_word_fortitude { get; set; }
|
||||||
|
public int chaos_brand { get; set; }
|
||||||
|
public int mystic_touch { get; set; }
|
||||||
|
public int mortal_wounds { get; set; }
|
||||||
|
public int bleeding { get; set; }
|
||||||
|
public int bloodlust { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Player
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string race { get; set; }
|
||||||
|
public int level { get; set; }
|
||||||
|
public string role { get; set; }
|
||||||
|
public string specialization { get; set; }
|
||||||
|
public string talents { get; set; }
|
||||||
|
public Professions professions { get; set; }
|
||||||
|
public Gear gear { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Gear
|
||||||
|
{
|
||||||
|
public Head head { get; set; }
|
||||||
|
public Neck neck { get; set; }
|
||||||
|
public Shoulders shoulders { get; set; }
|
||||||
|
public Chest chest { get; set; }
|
||||||
|
public Waist waist { get; set; }
|
||||||
|
public Legs legs { get; set; }
|
||||||
|
public Feet feet { get; set; }
|
||||||
|
public Wrists wrists { get; set; }
|
||||||
|
public Hands hands { get; set; }
|
||||||
|
public Finger1 finger1 { get; set; }
|
||||||
|
public Finger2 finger2 { get; set; }
|
||||||
|
public Trinket1 trinket1 { get; set; }
|
||||||
|
public Trinket2 trinket2 { get; set; }
|
||||||
|
public Back back { get; set; }
|
||||||
|
public MainHand main_hand { get; set; }
|
||||||
|
public OffHand off_hand { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PortionAps
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class PortionApse
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Proc
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public double interval { get; set; }
|
||||||
|
public double count { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Professions
|
||||||
|
{
|
||||||
|
public int mining { get; set; }
|
||||||
|
public int blacksmithing { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RaidAps
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class RaidDps
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
public double median { get; set; }
|
||||||
|
public double variance { get; set; }
|
||||||
|
public double std_dev { get; set; }
|
||||||
|
public double mean_variance { get; set; }
|
||||||
|
public double mean_std_dev { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ResourceGain
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public HolyPower holy_power { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ResourceLost
|
||||||
|
{
|
||||||
|
public Health health { get; set; }
|
||||||
|
public HolyPower holy_power { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ResourceOverflowed
|
||||||
|
{
|
||||||
|
public Health health { get; set; }
|
||||||
|
public HolyPower holy_power { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Resources
|
||||||
|
{
|
||||||
|
public double health { get; set; }
|
||||||
|
public double holy_power { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ResourcesMax
|
||||||
|
{
|
||||||
|
public double health { get; set; }
|
||||||
|
public double holy_power { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ResourceTimelines
|
||||||
|
{
|
||||||
|
public Health health { get; set; }
|
||||||
|
public HealthPct health_pct { get; set; }
|
||||||
|
public HolyPower holy_power { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Rng
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Root
|
||||||
|
{
|
||||||
|
public string version { get; set; }
|
||||||
|
public string report_version { get; set; }
|
||||||
|
public int ptr_enabled { get; set; }
|
||||||
|
public int beta_enabled { get; set; }
|
||||||
|
public string build_date { get; set; }
|
||||||
|
public string build_time { get; set; }
|
||||||
|
public int timestamp { get; set; }
|
||||||
|
public string git_revision { get; set; }
|
||||||
|
public string git_branch { get; set; }
|
||||||
|
public Sims sim { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Shoulders
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int strint { get; set; }
|
||||||
|
public int mastery_rating { get; set; }
|
||||||
|
public int versatility_rating { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Sims
|
||||||
|
{
|
||||||
|
public List<Player> players { get; set; }
|
||||||
|
public Statistics statistics { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SimAura
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string spell_name { get; set; }
|
||||||
|
public string spell_school { get; set; }
|
||||||
|
public int spell { get; set; }
|
||||||
|
public double start_count { get; set; }
|
||||||
|
public double duration { get; set; }
|
||||||
|
public double uptime { get; set; }
|
||||||
|
public double default_value { get; set; }
|
||||||
|
public Cooldown cooldown { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class SimulationLength
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
public double median { get; set; }
|
||||||
|
public double variance { get; set; }
|
||||||
|
public double std_dev { get; set; }
|
||||||
|
public double mean_variance { get; set; }
|
||||||
|
public double mean_std_dev { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class StackUptime
|
||||||
|
{
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double mean_std_dev { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
public List<double> data { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Statistics
|
||||||
|
{
|
||||||
|
public double elapsed_cpu_seconds { get; set; }
|
||||||
|
public double elapsed_time_seconds { get; set; }
|
||||||
|
public double init_time_seconds { get; set; }
|
||||||
|
public double merge_time_seconds { get; set; }
|
||||||
|
public double analyze_time_seconds { get; set; }
|
||||||
|
public SimulationLength simulation_length { get; set; }
|
||||||
|
public int total_events_processed { get; set; }
|
||||||
|
public RaidDps raid_dps { get; set; }
|
||||||
|
public RaidAps raid_aps { get; set; }
|
||||||
|
public TotalDmg total_dmg { get; set; }
|
||||||
|
public TotalAbsorb total_absorb { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class StatsPets
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TargetMetric
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
public double median { get; set; }
|
||||||
|
public double variance { get; set; }
|
||||||
|
public double std_dev { get; set; }
|
||||||
|
public double mean_variance { get; set; }
|
||||||
|
public double mean_std_dev { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class ThewarwithinBETA
|
||||||
|
{
|
||||||
|
public int build_level { get; set; }
|
||||||
|
public string wow_version { get; set; }
|
||||||
|
public string hotfix_date { get; set; }
|
||||||
|
public int hotfix_build { get; set; }
|
||||||
|
public string hotfix_hash { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TimelineDmg
|
||||||
|
{
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double mean_std_dev { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
public List<double> data { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TotalAbsorb
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TotalAmount
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TotalDmg
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TotalExecuteTime
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TotalIntervals
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class TotalTickTime
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Trinket1
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stragiint { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Trinket2
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int haste_rating { get; set; }
|
||||||
|
public int stragiint { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Waist
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int strint { get; set; }
|
||||||
|
public int crit_rating { get; set; }
|
||||||
|
public int haste_rating { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class WaitingTime
|
||||||
|
{
|
||||||
|
public double sum { get; set; }
|
||||||
|
public int count { get; set; }
|
||||||
|
public double mean { get; set; }
|
||||||
|
public double min { get; set; }
|
||||||
|
public double max { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public class Wrists
|
||||||
|
{
|
||||||
|
public string name { get; set; }
|
||||||
|
public string encoded_item { get; set; }
|
||||||
|
public int ilevel { get; set; }
|
||||||
|
public int stamina { get; set; }
|
||||||
|
public int strint { get; set; }
|
||||||
|
public int haste_rating { get; set; }
|
||||||
|
public int mastery_rating { get; set; }
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public static void RunSim(int qid)
|
||||||
|
{
|
||||||
|
int uid = DB.GetUserUIDByQID(qid);
|
||||||
|
|
||||||
|
Process p = new Process();
|
||||||
|
p.StartInfo.FileName = "/bin/bash";
|
||||||
|
p.StartInfo.Arguments = $"simc.sh tmp/{uid}.simc json=tmp/\"{uid}.json\"";
|
||||||
|
p.Start();
|
||||||
|
p.WaitForExit();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void SendSim(int uid)
|
||||||
|
{
|
||||||
|
using (var con = DB.MxWDB())
|
||||||
|
{
|
||||||
|
Root r = JsonConvert.DeserializeObject<Root>(File.ReadAllText($"tmp/{uid}.json"));
|
||||||
|
string[] specs = r.sim.players[0].specialization.Split(' ');
|
||||||
|
int spelen = specs.Length;
|
||||||
|
string simclass = specs[spelen-1];
|
||||||
|
Message.CMW(Utilities.Gear.CalculateGearIlvl(uid).ToString(), true, 4);
|
||||||
|
string cmdText = $"INSERT INTO mxw_sim(uid, name, class, level, ilvl, length, dps, version) VALUES ('{uid}','{r.sim.players[0].name}','{simclass}','{r.sim.players[0].level}','{Utilities.Gear.CalculateGearIlvl(uid)}','{r.sim.statistics.simulation_length.mean}','{r.sim.statistics.raid_dps.mean}','{Program.version}|{r.version}')";
|
||||||
|
MySqlCommand cmd = new MySqlCommand(cmdText, con);
|
||||||
|
con.Open();
|
||||||
|
cmd.ExecuteNonQuery();
|
||||||
|
con.Close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,21 @@
|
||||||
|
<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<packages>
|
||||||
|
<package id="BouncyCastle.Cryptography" version="2.3.1" targetFramework="net481" />
|
||||||
|
<package id="Google.Protobuf" version="3.26.1" targetFramework="net481" />
|
||||||
|
<package id="K4os.Compression.LZ4" version="1.3.8" targetFramework="net481" />
|
||||||
|
<package id="K4os.Compression.LZ4.Streams" version="1.3.8" targetFramework="net481" />
|
||||||
|
<package id="K4os.Hash.xxHash" version="1.0.8" targetFramework="net481" />
|
||||||
|
<package id="Microsoft.Bcl.AsyncInterfaces" version="5.0.0" targetFramework="net481" />
|
||||||
|
<package id="Microsoft.Extensions.Logging.Abstractions" version="7.0.1" targetFramework="net481" />
|
||||||
|
<package id="MySqlConnector" version="2.3.7" targetFramework="net481" />
|
||||||
|
<package id="Newtonsoft.Json" version="13.0.3" targetFramework="net481" />
|
||||||
|
<package id="System.Buffers" version="4.5.1" targetFramework="net481" />
|
||||||
|
<package id="System.Configuration.ConfigurationManager" version="8.0.0" targetFramework="net481" />
|
||||||
|
<package id="System.Diagnostics.DiagnosticSource" version="8.0.1" targetFramework="net481" />
|
||||||
|
<package id="System.IO.Pipelines" version="5.0.2" targetFramework="net481" />
|
||||||
|
<package id="System.Memory" version="4.5.5" targetFramework="net481" />
|
||||||
|
<package id="System.Numerics.Vectors" version="4.5.0" targetFramework="net481" />
|
||||||
|
<package id="System.Runtime.CompilerServices.Unsafe" version="6.0.0" targetFramework="net481" />
|
||||||
|
<package id="System.Threading.Tasks.Extensions" version="4.5.4" targetFramework="net481" />
|
||||||
|
<package id="ZstdSharp.Port" version="0.8.0" targetFramework="net481" />
|
||||||
|
</packages>
|
Loading…
Reference in New Issue