update botmon from Drakiaxyz repo
This commit is contained in:
parent
acac743403
commit
be199850d1
63
Live/CWX_DebuggingTool/.gitattributes
vendored
Normal file
63
Live/CWX_DebuggingTool/.gitattributes
vendored
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
###############################################################################
|
||||||
|
# Set default behavior to automatically normalize line endings.
|
||||||
|
###############################################################################
|
||||||
|
* text=auto
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Set default behavior for command prompt diff.
|
||||||
|
#
|
||||||
|
# This is need for earlier builds of msysgit that does not have it on by
|
||||||
|
# default for csharp files.
|
||||||
|
# Note: This is only used by command line
|
||||||
|
###############################################################################
|
||||||
|
#*.cs diff=csharp
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# Set the merge driver for project and solution files
|
||||||
|
#
|
||||||
|
# Merging from the command prompt will add diff markers to the files if there
|
||||||
|
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||||
|
# the diff markers are never inserted). Diff markers may cause the following
|
||||||
|
# file extensions to fail to load in VS. An alternative would be to treat
|
||||||
|
# these files as binary and thus will always conflict and require user
|
||||||
|
# intervention with every merge. To do so, just uncomment the entries below
|
||||||
|
###############################################################################
|
||||||
|
#*.sln merge=binary
|
||||||
|
#*.csproj merge=binary
|
||||||
|
#*.vbproj merge=binary
|
||||||
|
#*.vcxproj merge=binary
|
||||||
|
#*.vcproj merge=binary
|
||||||
|
#*.dbproj merge=binary
|
||||||
|
#*.fsproj merge=binary
|
||||||
|
#*.lsproj merge=binary
|
||||||
|
#*.wixproj merge=binary
|
||||||
|
#*.modelproj merge=binary
|
||||||
|
#*.sqlproj merge=binary
|
||||||
|
#*.wwaproj merge=binary
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# behavior for image files
|
||||||
|
#
|
||||||
|
# image files are treated as binary by default.
|
||||||
|
###############################################################################
|
||||||
|
#*.jpg binary
|
||||||
|
#*.png binary
|
||||||
|
#*.gif binary
|
||||||
|
|
||||||
|
###############################################################################
|
||||||
|
# diff behavior for common document formats
|
||||||
|
#
|
||||||
|
# Convert binary document formats to text before diffing them. This feature
|
||||||
|
# is only available from the command line. Turn it on by uncommenting the
|
||||||
|
# entries below.
|
||||||
|
###############################################################################
|
||||||
|
#*.doc diff=astextplain
|
||||||
|
#*.DOC diff=astextplain
|
||||||
|
#*.docx diff=astextplain
|
||||||
|
#*.DOCX diff=astextplain
|
||||||
|
#*.dot diff=astextplain
|
||||||
|
#*.DOT diff=astextplain
|
||||||
|
#*.pdf diff=astextplain
|
||||||
|
#*.PDF diff=astextplain
|
||||||
|
#*.rtf diff=astextplain
|
||||||
|
#*.RTF diff=astextplain
|
364
Live/CWX_DebuggingTool/.gitignore
vendored
Normal file
364
Live/CWX_DebuggingTool/.gitignore
vendored
Normal file
@ -0,0 +1,364 @@
|
|||||||
|
## Ignore Visual Studio temporary files, build results, and
|
||||||
|
## files generated by popular Visual Studio add-ons.
|
||||||
|
##
|
||||||
|
## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore
|
||||||
|
|
||||||
|
# User-specific files
|
||||||
|
*.rsuser
|
||||||
|
*.suo
|
||||||
|
*.user
|
||||||
|
*.userosscache
|
||||||
|
*.sln.docstates
|
||||||
|
|
||||||
|
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||||
|
*.userprefs
|
||||||
|
|
||||||
|
# Mono auto generated files
|
||||||
|
mono_crash.*
|
||||||
|
|
||||||
|
# Build results
|
||||||
|
[Dd]ebug/
|
||||||
|
[Dd]ebugPublic/
|
||||||
|
[Rr]elease/
|
||||||
|
[Rr]eleases/
|
||||||
|
x64/
|
||||||
|
x86/
|
||||||
|
[Ww][Ii][Nn]32/
|
||||||
|
[Aa][Rr][Mm]/
|
||||||
|
[Aa][Rr][Mm]64/
|
||||||
|
bld/
|
||||||
|
[Bb]in/
|
||||||
|
[Oo]bj/
|
||||||
|
[Oo]ut/
|
||||||
|
[Ll]og/
|
||||||
|
[Ll]ogs/
|
||||||
|
[Pp]ackage/
|
||||||
|
|
||||||
|
# Visual Studio 2015/2017 cache/options directory
|
||||||
|
.vs/
|
||||||
|
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||||
|
#wwwroot/
|
||||||
|
|
||||||
|
# Visual Studio 2017 auto generated files
|
||||||
|
Generated\ Files/
|
||||||
|
|
||||||
|
# MSTest test Results
|
||||||
|
[Tt]est[Rr]esult*/
|
||||||
|
[Bb]uild[Ll]og.*
|
||||||
|
|
||||||
|
# NUnit
|
||||||
|
*.VisualState.xml
|
||||||
|
TestResult.xml
|
||||||
|
nunit-*.xml
|
||||||
|
|
||||||
|
# Build Results of an ATL Project
|
||||||
|
[Dd]ebugPS/
|
||||||
|
[Rr]eleasePS/
|
||||||
|
dlldata.c
|
||||||
|
|
||||||
|
# Benchmark Results
|
||||||
|
BenchmarkDotNet.Artifacts/
|
||||||
|
|
||||||
|
# .NET Core
|
||||||
|
project.lock.json
|
||||||
|
project.fragment.lock.json
|
||||||
|
artifacts/
|
||||||
|
|
||||||
|
# ASP.NET Scaffolding
|
||||||
|
ScaffoldingReadMe.txt
|
||||||
|
|
||||||
|
# StyleCop
|
||||||
|
StyleCopReport.xml
|
||||||
|
|
||||||
|
# Files built by Visual Studio
|
||||||
|
*_i.c
|
||||||
|
*_p.c
|
||||||
|
*_h.h
|
||||||
|
*.ilk
|
||||||
|
*.meta
|
||||||
|
*.obj
|
||||||
|
*.iobj
|
||||||
|
*.pch
|
||||||
|
*.pdb
|
||||||
|
*.ipdb
|
||||||
|
*.pgc
|
||||||
|
*.pgd
|
||||||
|
*.rsp
|
||||||
|
*.sbr
|
||||||
|
*.tlb
|
||||||
|
*.tli
|
||||||
|
*.tlh
|
||||||
|
*.tmp
|
||||||
|
*.tmp_proj
|
||||||
|
*_wpftmp.csproj
|
||||||
|
*.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
|
||||||
|
|
||||||
|
# Visual Studio Trace Files
|
||||||
|
*.e2e
|
||||||
|
|
||||||
|
# TFS 2012 Local Workspace
|
||||||
|
$tf/
|
||||||
|
|
||||||
|
# Guidance Automation Toolkit
|
||||||
|
*.gpState
|
||||||
|
|
||||||
|
# ReSharper is a .NET coding add-in
|
||||||
|
_ReSharper*/
|
||||||
|
*.[Rr]e[Ss]harper
|
||||||
|
*.DotSettings.user
|
||||||
|
|
||||||
|
# TeamCity is a build add-in
|
||||||
|
_TeamCity*
|
||||||
|
|
||||||
|
# DotCover is a Code Coverage Tool
|
||||||
|
*.dotCover
|
||||||
|
|
||||||
|
# AxoCover is a Code Coverage Tool
|
||||||
|
.axoCover/*
|
||||||
|
!.axoCover/settings.json
|
||||||
|
|
||||||
|
# Coverlet is a free, cross platform Code Coverage Tool
|
||||||
|
coverage*.json
|
||||||
|
coverage*.xml
|
||||||
|
coverage*.info
|
||||||
|
|
||||||
|
# Visual Studio code coverage results
|
||||||
|
*.coverage
|
||||||
|
*.coveragexml
|
||||||
|
|
||||||
|
# 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
|
||||||
|
# Note: 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
|
||||||
|
# NuGet Symbol Packages
|
||||||
|
*.snupkg
|
||||||
|
# The packages folder can be ignored because of Package Restore
|
||||||
|
**/[Pp]ackages/*
|
||||||
|
# except build/, which is used as an MSBuild target.
|
||||||
|
!**/[Pp]ackages/build/
|
||||||
|
# Uncomment if necessary however generally it will be regenerated when needed
|
||||||
|
#!**/[Pp]ackages/repositories.config
|
||||||
|
# NuGet v3's project.json files produces more ignorable 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
|
||||||
|
*.appx
|
||||||
|
*.appxbundle
|
||||||
|
*.appxupload
|
||||||
|
|
||||||
|
# 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
|
||||||
|
orleans.codegen.cs
|
||||||
|
|
||||||
|
# Including strong name files can present a security risk
|
||||||
|
# (https://github.com/github/gitignore/pull/2483#issue-259490424)
|
||||||
|
#*.snk
|
||||||
|
|
||||||
|
# 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
|
||||||
|
ServiceFabricBackup/
|
||||||
|
*.rptproj.bak
|
||||||
|
|
||||||
|
# SQL Server files
|
||||||
|
*.mdf
|
||||||
|
*.ldf
|
||||||
|
*.ndf
|
||||||
|
|
||||||
|
# Business Intelligence projects
|
||||||
|
*.rdl.data
|
||||||
|
*.bim.layout
|
||||||
|
*.bim_*.settings
|
||||||
|
*.rptproj.rsuser
|
||||||
|
*- [Bb]ackup.rdl
|
||||||
|
*- [Bb]ackup ([0-9]).rdl
|
||||||
|
*- [Bb]ackup ([0-9][0-9]).rdl
|
||||||
|
|
||||||
|
# Microsoft Fakes
|
||||||
|
FakesAssemblies/
|
||||||
|
|
||||||
|
# GhostDoc plugin setting file
|
||||||
|
*.GhostDoc.xml
|
||||||
|
|
||||||
|
# Node.js Tools for Visual Studio
|
||||||
|
.ntvs_analysis.dat
|
||||||
|
node_modules/
|
||||||
|
|
||||||
|
# Visual Studio 6 build log
|
||||||
|
*.plg
|
||||||
|
|
||||||
|
# Visual Studio 6 workspace options file
|
||||||
|
*.opt
|
||||||
|
|
||||||
|
# Visual Studio 6 auto-generated workspace file (contains which files were open etc.)
|
||||||
|
*.vbw
|
||||||
|
|
||||||
|
# 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/
|
||||||
|
|
||||||
|
# CodeRush personal settings
|
||||||
|
.cr/personal
|
||||||
|
|
||||||
|
# Python Tools for Visual Studio (PTVS)
|
||||||
|
__pycache__/
|
||||||
|
*.pyc
|
||||||
|
|
||||||
|
# Cake - Uncomment if you are using it
|
||||||
|
# tools/**
|
||||||
|
# !tools/packages.config
|
||||||
|
|
||||||
|
# Tabs Studio
|
||||||
|
*.tss
|
||||||
|
|
||||||
|
# Telerik's JustMock configuration file
|
||||||
|
*.jmconfig
|
||||||
|
|
||||||
|
# BizTalk build output
|
||||||
|
*.btp.cs
|
||||||
|
*.btm.cs
|
||||||
|
*.odx.cs
|
||||||
|
*.xsd.cs
|
||||||
|
|
||||||
|
# OpenCover UI analysis results
|
||||||
|
OpenCover/
|
||||||
|
|
||||||
|
# Azure Stream Analytics local run output
|
||||||
|
ASALocalRun/
|
||||||
|
|
||||||
|
# MSBuild Binary and Structured Log
|
||||||
|
*.binlog
|
||||||
|
|
||||||
|
# NVidia Nsight GPU debugger configuration file
|
||||||
|
*.nvuser
|
||||||
|
|
||||||
|
# MFractors (Xamarin productivity tool) working folder
|
||||||
|
.mfractor/
|
||||||
|
|
||||||
|
# Local History for Visual Studio
|
||||||
|
.localhistory/
|
||||||
|
|
||||||
|
# BeatPulse healthcheck temp database
|
||||||
|
healthchecksdb
|
||||||
|
|
||||||
|
# Backup folder for Package Reference Convert tool in Visual Studio 2017
|
||||||
|
MigrationBackup/
|
||||||
|
|
||||||
|
# Ionide (cross platform F# VS Code tools) working folder
|
||||||
|
.ionide/
|
||||||
|
|
||||||
|
# Fody - auto-generated XML schema
|
||||||
|
FodyWeavers.xsd
|
@ -10,10 +10,8 @@ using CWX_DebuggingTool.Models;
|
|||||||
|
|
||||||
namespace CWX_DebuggingTool
|
namespace CWX_DebuggingTool
|
||||||
{
|
{
|
||||||
public sealed class BotmonClass : MonoBehaviour, IDisposable
|
public sealed class BotmonClass : MonoBehaviour
|
||||||
{
|
{
|
||||||
private static BotmonClass _instance;
|
|
||||||
|
|
||||||
private GUIContent _guiContent;
|
private GUIContent _guiContent;
|
||||||
private GUIStyle _textStyle;
|
private GUIStyle _textStyle;
|
||||||
private Player _player;
|
private Player _player;
|
||||||
@ -29,35 +27,14 @@ namespace CWX_DebuggingTool
|
|||||||
|
|
||||||
private BotmonClass()
|
private BotmonClass()
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public int Mode { get; set; }
|
public BotMonitorMode Mode { get; set; }
|
||||||
|
|
||||||
public static BotmonClass Instance
|
|
||||||
{
|
|
||||||
get
|
|
||||||
{
|
|
||||||
if (_instance == null)
|
|
||||||
{
|
|
||||||
_instance = new BotmonClass();
|
|
||||||
}
|
|
||||||
|
|
||||||
return _instance;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public void Dispose()
|
|
||||||
{
|
|
||||||
var gameWorld = Singleton<GameWorld>.Instance;
|
|
||||||
|
|
||||||
var gameobj = gameWorld.GetComponent<BotmonClass>();
|
|
||||||
Destroy(gameobj);
|
|
||||||
_instance = null;
|
|
||||||
GC.SuppressFinalize(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
~BotmonClass()
|
~BotmonClass()
|
||||||
{
|
{
|
||||||
|
ConsoleScreen.Log("BotMonitor Disabled on game end");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Awake()
|
public void Awake()
|
||||||
@ -84,7 +61,7 @@ namespace CWX_DebuggingTool
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add existing Bots to list
|
// Add existing Bots to list
|
||||||
if (_gameWorld.RegisteredPlayers.Count > 1)
|
if (_gameWorld.AllAlivePlayersList.Count > 1)
|
||||||
{
|
{
|
||||||
foreach (var player in _gameWorld.AllAlivePlayersList)
|
foreach (var player in _gameWorld.AllAlivePlayersList)
|
||||||
{
|
{
|
||||||
@ -102,17 +79,25 @@ namespace CWX_DebuggingTool
|
|||||||
_botGame.BotsController.BotSpawner.OnBotCreated += owner =>
|
_botGame.BotsController.BotSpawner.OnBotCreated += owner =>
|
||||||
{
|
{
|
||||||
var player = owner.GetPlayer;
|
var player = owner.GetPlayer;
|
||||||
_zoneAndPlayers[player.AIData.BotOwner.BotsGroup.BotZone.NameZone].Add(player);
|
_zoneAndPlayers[owner.BotsGroup.BotZone.NameZone].Add(player);
|
||||||
_playerRoleAndDiff.Add(player.ProfileId, GetBotRoleAndDiffClass(player.Profile.Info));
|
_playerRoleAndDiff.Add(player.ProfileId, GetBotRoleAndDiffClass(player.Profile.Info));
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// Sub to event to gget and remove Bot when they despawn
|
||||||
|
_botGame.BotsController.BotSpawner.OnBotRemoved += owner =>
|
||||||
|
{
|
||||||
|
var player = owner.GetPlayer;
|
||||||
|
_zoneAndPlayers[owner.BotsGroup.BotZone.NameZone].Remove(player);
|
||||||
|
_playerRoleAndDiff.Remove(player.ProfileId);
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
public BotRoleAndDiffClass GetBotRoleAndDiffClass(InfoClass info)
|
public BotRoleAndDiffClass GetBotRoleAndDiffClass(InfoClass info)
|
||||||
{
|
{
|
||||||
var settings = info.GetType().GetField("Settings", BindingFlags.Public | BindingFlags.Instance)?.GetValue(info);
|
var settings = info.GetType().GetField("Settings", BindingFlags.Public | BindingFlags.Instance).GetValue(info);
|
||||||
|
|
||||||
var role = settings.GetType().GetField("Role", BindingFlags.Instance | BindingFlags.Public)?.GetValue(settings).ToString();
|
var role = settings.GetType().GetField("Role", BindingFlags.Instance | BindingFlags.Public).GetValue(settings).ToString();
|
||||||
var diff = settings.GetType().GetField("BotDifficulty", BindingFlags.Instance | BindingFlags.Public)?.GetValue(settings).ToString();
|
var diff = settings.GetType().GetField("BotDifficulty", BindingFlags.Instance | BindingFlags.Public).GetValue(settings).ToString();
|
||||||
|
|
||||||
return new BotRoleAndDiffClass(string.IsNullOrEmpty(role) ? "" : role, string.IsNullOrEmpty(diff) ? "" : diff);
|
return new BotRoleAndDiffClass(string.IsNullOrEmpty(role) ? "" : role, string.IsNullOrEmpty(diff) ? "" : diff);
|
||||||
}
|
}
|
||||||
@ -134,26 +119,26 @@ namespace CWX_DebuggingTool
|
|||||||
_guiContent = new GUIContent();
|
_guiContent = new GUIContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
// If Mode Greater than or equal to 1 show total
|
// If Mode Greater than or equal to Total show total
|
||||||
if (Mode >= 1)
|
if (Mode >= BotMonitorMode.Total)
|
||||||
{
|
{
|
||||||
_content = string.Empty;
|
_content = string.Empty;
|
||||||
_content += $"Total = {_gameWorld.AllAlivePlayersList.Count - 1}\n";
|
_content += $"Total = {_gameWorld.AllAlivePlayersList.Count - 1}\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
// If Mode Greater than or equal to 2 show total for each zone
|
// If Mode Greater than or equal to PerZoneTotal show total for each zone
|
||||||
if (Mode >= 2 && _zoneAndPlayers != null)
|
if (Mode >= BotMonitorMode.PerZoneTotal && _zoneAndPlayers != null)
|
||||||
{
|
{
|
||||||
foreach (var zone in _zoneAndPlayers)
|
foreach (var zone in _zoneAndPlayers)
|
||||||
{
|
{
|
||||||
if (_zoneAndPlayers[zone.Key].FindAll(x => x != null && x.HealthController != null && x.HealthController.IsAlive).Count <= 0) continue;
|
if (_zoneAndPlayers[zone.Key].FindAll(x => x.HealthController.IsAlive).Count <= 0) continue;
|
||||||
|
|
||||||
_content += $"{zone.Key} = {_zoneAndPlayers[zone.Key].FindAll(x => x != null && x.HealthController != null && x.HealthController.IsAlive).Count}\n";
|
_content += $"{zone.Key} = {_zoneAndPlayers[zone.Key].FindAll(x => x.HealthController.IsAlive).Count}\n";
|
||||||
|
|
||||||
// If Mode Greater than or equal to 3 show Bots individually also
|
// If Mode Greater than or equal to FullList show Bots individually also
|
||||||
if (Mode < 3) continue;
|
if (Mode < BotMonitorMode.FullList) continue;
|
||||||
|
|
||||||
foreach (var player in _zoneAndPlayers[zone.Key].Where(player => player != null && player.HealthController != null && player.HealthController.IsAlive))
|
foreach (var player in _zoneAndPlayers[zone.Key].Where(player => player.HealthController.IsAlive))
|
||||||
{
|
{
|
||||||
_distance = Vector3.Distance(player.Position, _player.Position);
|
_distance = Vector3.Distance(player.Position, _player.Position);
|
||||||
_content += $"> [{_distance:n2}m] [{_playerRoleAndDiff.First(x => x.Key == player.ProfileId).Value.Role}] " +
|
_content += $"> [{_distance:n2}m] [{_playerRoleAndDiff.First(x => x.Key == player.ProfileId).Value.Role}] " +
|
||||||
|
Binary file not shown.
@ -2,39 +2,45 @@
|
|||||||
|
|
||||||
<PropertyGroup>
|
<PropertyGroup>
|
||||||
<TargetFramework>net472</TargetFramework>
|
<TargetFramework>net472</TargetFramework>
|
||||||
|
<FileVersion></FileVersion>
|
||||||
|
<Version>2.2.0.0</Version>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Reference Include="Aki.Common">
|
<Reference Include="Aki.Common">
|
||||||
<HintPath>..\..\..\Shared\Aki.Common.dll</HintPath>
|
<HintPath>..\..\EscapeFromTarkov_Data\Managed\Aki.Common.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Aki.Reflection">
|
<Reference Include="Aki.Reflection">
|
||||||
<HintPath>..\..\..\Shared\Aki.Reflection.dll</HintPath>
|
<HintPath>..\..\EscapeFromTarkov_Data\Managed\Aki.Reflection.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Assembly-CSharp">
|
<Reference Include="Assembly-CSharp">
|
||||||
<HintPath>..\..\..\Shared\Assembly-CSharp.dll</HintPath>
|
<HintPath>..\..\EscapeFromTarkov_Data\Managed\Assembly-CSharp.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="BepInEx">
|
<Reference Include="BepInEx">
|
||||||
<HintPath>..\..\..\Shared\BepInEx.dll</HintPath>
|
<HintPath>..\..\BepInEx\Core\BepInEx.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="bsg.console.core">
|
<Reference Include="bsg.console.core">
|
||||||
<HintPath>..\..\..\Shared\bsg.console.core.dll</HintPath>
|
<HintPath>..\..\EscapeFromTarkov_Data\Managed\bsg.console.core.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="Comfort">
|
<Reference Include="Comfort">
|
||||||
<HintPath>..\..\..\Shared\Comfort.dll</HintPath>
|
<HintPath>..\..\EscapeFromTarkov_Data\Managed\Comfort.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine">
|
<Reference Include="UnityEngine">
|
||||||
<HintPath>..\..\..\Shared\UnityEngine.dll</HintPath>
|
<HintPath>..\..\EscapeFromTarkov_Data\Managed\UnityEngine.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.CoreModule">
|
<Reference Include="UnityEngine.CoreModule">
|
||||||
<HintPath>..\..\..\Shared\UnityEngine.CoreModule.dll</HintPath>
|
<HintPath>..\..\EscapeFromTarkov_Data\Managed\UnityEngine.CoreModule.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.IMGUIModule">
|
<Reference Include="UnityEngine.IMGUIModule">
|
||||||
<HintPath>..\..\..\Shared\UnityEngine.IMGUIModule.dll</HintPath>
|
<HintPath>..\..\EscapeFromTarkov_Data\Managed\UnityEngine.IMGUIModule.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
<Reference Include="UnityEngine.TextRenderingModule">
|
<Reference Include="UnityEngine.TextRenderingModule">
|
||||||
<HintPath>..\..\..\Shared\UnityEngine.TextRenderingModule.dll</HintPath>
|
<HintPath>..\..\EscapeFromTarkov_Data\Managed\UnityEngine.TextRenderingModule.dll</HintPath>
|
||||||
</Reference>
|
</Reference>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
<Target Name="PostBuild" AfterTargets="PostBuildEvent">
|
||||||
|
<Exec Command="copy "$(TargetPath)" "$(ProjectDir)\..\..\BepInEx\plugins\$(TargetFileName)"" />
|
||||||
|
</Target>
|
||||||
|
|
||||||
</Project>
|
</Project>
|
||||||
|
25
Live/CWX_DebuggingTool/CWX_DebuggingTool.sln
Normal file
25
Live/CWX_DebuggingTool/CWX_DebuggingTool.sln
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
|
||||||
|
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||||
|
# Visual Studio Version 17
|
||||||
|
VisualStudioVersion = 17.6.33801.468
|
||||||
|
MinimumVisualStudioVersion = 10.0.40219.1
|
||||||
|
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "CWX_DebuggingTool", "CWX_DebuggingTool.csproj", "{FC152A95-1628-4DE9-A92E-38B368C188D0}"
|
||||||
|
EndProject
|
||||||
|
Global
|
||||||
|
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||||
|
Debug|Any CPU = Debug|Any CPU
|
||||||
|
Release|Any CPU = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||||
|
{FC152A95-1628-4DE9-A92E-38B368C188D0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||||
|
{FC152A95-1628-4DE9-A92E-38B368C188D0}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||||
|
{FC152A95-1628-4DE9-A92E-38B368C188D0}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||||
|
{FC152A95-1628-4DE9-A92E-38B368C188D0}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(SolutionProperties) = preSolution
|
||||||
|
HideSolutionNode = FALSE
|
||||||
|
EndGlobalSection
|
||||||
|
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||||
|
SolutionGuid = {37A296E5-8559-4E04-8B2B-02B32F793C6E}
|
||||||
|
EndGlobalSection
|
||||||
|
EndGlobal
|
@ -1,64 +1,82 @@
|
|||||||
using BepInEx;
|
using Aki.Reflection.Patching;
|
||||||
|
using BepInEx;
|
||||||
|
using BepInEx.Configuration;
|
||||||
using Comfort.Common;
|
using Comfort.Common;
|
||||||
|
using CWX_DebuggingTool.Helpers;
|
||||||
|
using CWX_DebuggingTool.Models;
|
||||||
using EFT;
|
using EFT;
|
||||||
using EFT.Console.Core;
|
using EFT.Console.Core;
|
||||||
using EFT.UI;
|
using EFT.UI;
|
||||||
|
using System.Reflection;
|
||||||
|
|
||||||
namespace CWX_DebuggingTool
|
namespace CWX_DebuggingTool
|
||||||
{
|
{
|
||||||
[BepInPlugin("com.cwx.debuggingtool", "cwx-debuggingtool", "1.1.0")]
|
[BepInPlugin("com.cwx.debuggingtool-dxyz", "cwx-debuggingtool-dxyz", "2.2.1")]
|
||||||
public class DebuggingTool : BaseUnityPlugin
|
public class DebuggingTool : BaseUnityPlugin
|
||||||
{
|
{
|
||||||
|
public static ConfigEntry<BotMonitorMode> DefaultMode;
|
||||||
|
|
||||||
private void Awake()
|
private void Awake()
|
||||||
{
|
{
|
||||||
|
DefaultMode = Config.Bind(
|
||||||
|
"Main Settings",
|
||||||
|
"DefaultMode",
|
||||||
|
BotMonitorMode.None,
|
||||||
|
"Default Mode on Startup");
|
||||||
|
|
||||||
ConsoleScreen.Processor.RegisterCommandGroup<DebuggingTool>();
|
ConsoleScreen.Processor.RegisterCommandGroup<DebuggingTool>();
|
||||||
|
new MatchStartPatch().Enable();
|
||||||
}
|
}
|
||||||
|
|
||||||
[ConsoleCommand("BotMonitor")]
|
[ConsoleCommand("BotMonitor")]
|
||||||
public static void BotMonitorConsoleCommand([ConsoleArgument("", "Options: 0 = off, 1 = Total bots, 2 = 1+Total bots per Zone, 3 = 2+Each bot")] int value )
|
public static void BotMonitorConsoleCommand([ConsoleArgument("", "Options: 0 = off, 1 = Total bots, 2 = 1+Total bots per Zone, 3 = 2+Each bot")] BotMonitorMode mode )
|
||||||
{
|
{
|
||||||
switch (value)
|
if (mode == BotMonitorMode.None)
|
||||||
{
|
{
|
||||||
case 0:
|
DisableBotMonitor();
|
||||||
DisableBotMonitor();
|
ConsoleScreen.Log("BotMonitor disabled");
|
||||||
ConsoleScreen.Log("BotMonitor disabled");
|
}
|
||||||
break;
|
else if (!mode.IsValid())
|
||||||
case 1:
|
{
|
||||||
EnableBotMonitor(1);
|
ConsoleScreen.LogError("Wrong Option used, please use 0, 1, 2 or 3");
|
||||||
ConsoleScreen.Log("BotMonitor enabled with only Total");
|
}
|
||||||
break;
|
else
|
||||||
case 2:
|
{
|
||||||
EnableBotMonitor(2);
|
ConsoleScreen.Log($"BotMonitor enabled with {mode.Description()}");
|
||||||
ConsoleScreen.Log("BotMonitor enabled with Total and per zone Total");
|
EnableBotMonitor(mode);
|
||||||
break;
|
|
||||||
case 3:
|
|
||||||
EnableBotMonitor(3);
|
|
||||||
ConsoleScreen.Log("BotMonitor enabled with Total, per zone Total and each bot");
|
|
||||||
break;
|
|
||||||
default:
|
|
||||||
// fail to load, or wrong option used
|
|
||||||
ConsoleScreen.LogError("Wrong Option used, please use 0, 1, 2 or 3");
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void DisableBotMonitor()
|
public static void DisableBotMonitor()
|
||||||
{
|
|
||||||
BotmonClass.Instance.Dispose();
|
|
||||||
}
|
|
||||||
|
|
||||||
private static void EnableBotMonitor(int option)
|
|
||||||
{
|
{
|
||||||
var gameWorld = Singleton<GameWorld>.Instance;
|
var gameWorld = Singleton<GameWorld>.Instance;
|
||||||
|
var btmInstance = gameWorld.GetComponent<BotmonClass>();
|
||||||
|
if (btmInstance != null)
|
||||||
|
{
|
||||||
|
Destroy(btmInstance);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var checkExists = gameWorld.gameObject.GetComponentInChildren<BotmonClass>();
|
public static void EnableBotMonitor(BotMonitorMode mode)
|
||||||
|
{
|
||||||
|
var gameWorld = Singleton<GameWorld>.Instance;
|
||||||
|
var btmInstance = gameWorld.GetOrAddComponent<BotmonClass>();
|
||||||
|
btmInstance.Mode = mode;
|
||||||
|
}
|
||||||
|
|
||||||
if (checkExists != null)
|
// Add the component every time a match starts if enabled
|
||||||
Destroy(checkExists);
|
internal class MatchStartPatch : ModulePatch
|
||||||
|
{
|
||||||
|
protected override MethodBase GetTargetMethod() => typeof(GameWorld).GetMethod(nameof(GameWorld.OnGameStarted));
|
||||||
|
|
||||||
var btmInstance = gameWorld.gameObject.AddComponent<BotmonClass>();
|
[PatchPrefix]
|
||||||
|
public static void PatchPrefix()
|
||||||
btmInstance.Mode = option;
|
{
|
||||||
|
if (DefaultMode.Value != BotMonitorMode.None)
|
||||||
|
{
|
||||||
|
EnableBotMonitor(DefaultMode.Value);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
30
Live/CWX_DebuggingTool/Helpers/EnumExtension.cs
Normal file
30
Live/CWX_DebuggingTool/Helpers/EnumExtension.cs
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CWX_DebuggingTool.Helpers
|
||||||
|
{
|
||||||
|
internal static class EnumExtension
|
||||||
|
{
|
||||||
|
public static string Description<T>(this T src) where T : Enum
|
||||||
|
{
|
||||||
|
FieldInfo fi = src.GetType().GetField(src.ToString());
|
||||||
|
DescriptionAttribute[] attributes = fi.GetCustomAttributes<DescriptionAttribute>(false) as DescriptionAttribute[];
|
||||||
|
if (attributes != null && attributes.Length > 0)
|
||||||
|
{
|
||||||
|
return attributes[0].Description;
|
||||||
|
}
|
||||||
|
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool IsValid<T>(this T src) where T : Enum
|
||||||
|
{
|
||||||
|
return Enum.GetValues(typeof(T)).Cast<T>().Contains(src);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
21
Live/CWX_DebuggingTool/Models/BotMonitorMode.cs
Normal file
21
Live/CWX_DebuggingTool/Models/BotMonitorMode.cs
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.ComponentModel;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using System.Threading.Tasks;
|
||||||
|
|
||||||
|
namespace CWX_DebuggingTool.Models
|
||||||
|
{
|
||||||
|
public enum BotMonitorMode
|
||||||
|
{
|
||||||
|
[Description("Disabled")]
|
||||||
|
None = 0,
|
||||||
|
[Description("Only Total")]
|
||||||
|
Total = 1,
|
||||||
|
[Description("Total and Per Zone Total")]
|
||||||
|
PerZoneTotal = 2,
|
||||||
|
[Description("Total, Per Zone Total, and Bot List")]
|
||||||
|
FullList = 3
|
||||||
|
}
|
||||||
|
}
|
@ -1,5 +1,5 @@
|
|||||||
# DebuggingTool
|
# DebuggingTool
|
||||||
## CWX-DEBUGGINGTOOL for EFT - SPT-AKI
|
## CWX-DEBUGGINGTOOL for EFT - SPT-AKI
|
||||||
### CURRENT AKI VERSION: 3.5.1
|
### CURRENT AKI VERSION: 3.5.7
|
||||||
### GAMEVERSION: 22032
|
### GAMEVERSION: 23399
|
||||||
### USING BEPINEX
|
### USING BEPINEX
|
||||||
|
Loading…
x
Reference in New Issue
Block a user