Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Assembly to 0.14.1.0.28744 #143

Merged
merged 1 commit into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file modified References/Assembly-CSharp.dll
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using EFT;
using HarmonyLib;
using System.Reflection;
using UnityEngine;

Expand All @@ -17,13 +18,13 @@ static InsuranceScreenPatch()

protected override MethodBase GetTargetMethod()
{
var desiredType = typeof(MainMenuController);
var desiredMethod = desiredType.GetMethod("method_69", BindingFlags.NonPublic | BindingFlags.Instance);
//var desiredType = typeof(MainMenuController);
//var desiredMethod = desiredType.GetMethod("method_69", BindingFlags.NonPublic | BindingFlags.Instance);

Logger.LogDebug($"{GetType().Name} Type: {desiredType?.Name}");
Logger.LogDebug($"{GetType().Name} Method: {desiredMethod?.Name}");
//Logger.LogDebug($"{GetType().Name} Type: {desiredType?.Name}");
//Logger.LogDebug($"{GetType().Name} Method: {desiredMethod?.Name}");

return desiredMethod;
return AccessTools.Method(typeof(MainMenuController), "method_72");
}

[PatchPrefix]
Expand Down
1 change: 0 additions & 1 deletion Source/Coop/Airdrops/SITAirdropsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using static GClass1657;

namespace Aki.Custom.Airdrops
{
Expand Down
9 changes: 5 additions & 4 deletions Source/Coop/Components/ActionPacketHandlerComponent.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using StayInTarkov.Coop.Matchmaker;
using StayInTarkov.Coop.NetworkPacket;
using StayInTarkov.Coop.Players;
using StayInTarkov.Coop.SITGameModes;
using StayInTarkov.Coop.World;
using StayInTarkov.Core.Player;
using System;
Expand Down Expand Up @@ -37,7 +38,7 @@ public class ActionPacketHandlerComponent : MonoBehaviour

private List<string> RemovedFromAIPlayers = new();

private CoopGame CoopGame { get; } = (CoopGame)Singleton<AbstractGame>.Instance;
private CoopSITGame CoopGame { get; } = (CoopSITGame)Singleton<AbstractGame>.Instance;

private CoopGameComponent CoopGameComponent { get; set; }

Expand Down Expand Up @@ -414,7 +415,7 @@ void ReplicateRaidTimer(Dictionary<string, object> packet)
var sessionTime = new TimeSpan(long.Parse(packet["sessionTime"].ToString()));
Logger.LogInfo($"RaidTimer: Remaining session time {sessionTime.TraderFormat()}");

if (coopGameComponent.LocalGameInstance is CoopGame coopGame)
if (coopGameComponent.LocalGameInstance is CoopSITGame coopGame)
{
var gameTimer = coopGame.GameTimer;
if (gameTimer.StartDateTime.HasValue && gameTimer.SessionTime.HasValue)
Expand Down Expand Up @@ -455,7 +456,7 @@ void ReplicateTimeAndWeather(Dictionary<string, object> packet)
Logger.LogDebug(packet.ToJson());

var gameDateTime = new DateTime(long.Parse(packet["GameDateTime"].ToString()));
if (coopGameComponent.LocalGameInstance is CoopGame coopGame && coopGame.GameDateTime != null)
if (coopGameComponent.LocalGameInstance is CoopSITGame coopGame && coopGame.GameDateTime != null)
coopGame.GameDateTime.Reset(gameDateTime);

var weatherController = EFT.Weather.WeatherController.Instance;
Expand Down Expand Up @@ -552,7 +553,7 @@ void ReplicateArmoredTrainTime(Dictionary<string, object> packet)
{
DateTime utcTime = new(long.Parse(packet["utcTime"].ToString()));

if (coopGameComponent.LocalGameInstance is CoopGame coopGame)
if (coopGameComponent.LocalGameInstance is CoopSITGame coopGame)
{
Timer1 gameTimer = coopGame.GameTimer;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
using StayInTarkov.Coop.NetworkPacket;
using StayInTarkov.Coop.Player;
using StayInTarkov.Coop.Players;
using StayInTarkov.Coop.SITGameModes;
using StayInTarkov.Coop.Web;
using StayInTarkov.Core.Player;
using StayInTarkov.EssentialPatches;
Expand Down Expand Up @@ -78,7 +79,7 @@
{
get
{
if (LocalGameInstance is CoopGame coopGame)
if (LocalGameInstance is CoopSITGame coopGame)
{
if (SITMatchmaking.IsClient || coopGame.Bots.Count == 0)
return Players
Expand Down Expand Up @@ -320,7 +321,7 @@
if (Singleton<GameWorld>.Instance.RegisteredPlayers.Any())
{
// Send My Player to Aki, so that other clients know about me
CoopGame.SendPlayerDataToServer((LocalPlayer)Singleton<GameWorld>.Instance.RegisteredPlayers.First(x => x.IsYourPlayer));
CoopSITGame.SendPlayerDataToServer((LocalPlayer)Singleton<GameWorld>.Instance.RegisteredPlayers.First(x => x.IsYourPlayer));
}
}

Expand Down Expand Up @@ -1326,8 +1327,8 @@

public BaseLocalGame<GamePlayerOwner> LocalGameInstance { get; internal set; }

int GuiX = 10;

Check warning on line 1330 in Source/Coop/Components/CoopGameComponents/CoopGameComponent.cs

View workflow job for this annotation

GitHub Actions / Build-SIT (Debug)

The field 'CoopGameComponent.GuiX' is assigned but its value is never used
int GuiWidth = 400;

Check warning on line 1331 in Source/Coop/Components/CoopGameComponents/CoopGameComponent.cs

View workflow job for this annotation

GitHub Actions / Build-SIT (Debug)

The field 'CoopGameComponent.GuiWidth' is assigned but its value is never used

//public const int PING_LIMIT_HIGH = 125;
//public const int PING_LIMIT_MID = 100;
Expand All @@ -1339,9 +1340,9 @@
public bool ServerHasStopped { get; set; }
private bool ServerHasStoppedActioned { get; set; }

GUIStyle middleLabelStyle;

Check warning on line 1343 in Source/Coop/Components/CoopGameComponents/CoopGameComponent.cs

View workflow job for this annotation

GitHub Actions / Build-SIT (Debug)

Field 'CoopGameComponent.middleLabelStyle' is never assigned to, and will always have its default value null
GUIStyle middleLargeLabelStyle;

Check warning on line 1344 in Source/Coop/Components/CoopGameComponents/CoopGameComponent.cs

View workflow job for this annotation

GitHub Actions / Build-SIT (Debug)

The field 'CoopGameComponent.middleLargeLabelStyle' is never used
GUIStyle normalLabelStyle;

Check warning on line 1345 in Source/Coop/Components/CoopGameComponents/CoopGameComponent.cs

View workflow job for this annotation

GitHub Actions / Build-SIT (Debug)

The field 'CoopGameComponent.normalLabelStyle' is never used

//void OnGUI()
//{
Expand Down Expand Up @@ -1473,7 +1474,7 @@
return rect;
}

private Rect DrawSITStats(Rect rect, int numberOfPlayersDead, CoopGame coopGame)
private Rect DrawSITStats(Rect rect, int numberOfPlayersDead, CoopSITGame coopGame)
{
if (!PluginConfigSettings.Instance.CoopSettings.SETTING_ShowSITStatistics)
return rect;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
using StayInTarkov.Configuration;
using StayInTarkov.Coop.Matchmaker;
using StayInTarkov.Coop.Players;
using StayInTarkov.Coop.SITGameModes;
using StayInTarkov.Networking;
using StayInTarkov.UI;
using System;
Expand Down Expand Up @@ -100,7 +101,7 @@ void OnGUI()
if (LocalGameInstance == null)
return;

var coopGame = LocalGameInstance as CoopGame;
var coopGame = LocalGameInstance as CoopSITGame;
if (coopGame == null)
return;

Expand Down Expand Up @@ -167,7 +168,7 @@ private Rect DrawPing(Rect rect)
return rect;
}

private Rect DrawSITStats(Rect rect, int numberOfPlayersDead, CoopGame coopGame)
private Rect DrawSITStats(Rect rect, int numberOfPlayersDead, CoopSITGame coopGame)
{
if (!PluginConfigSettings.Instance.CoopSettings.SETTING_ShowSITStatistics)
return rect;
Expand Down
6 changes: 0 additions & 6 deletions Source/Coop/CoopPlayerStatisticsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,6 @@ private void OnSpecialPlaceVisited(string arg1, int arg2)
}

OverallAccountStats overallCounters = base.Profile_0.EftStats.OverallCounters;

if (GClass1350_0 == null)
{
Logger.LogError($"${nameof(GClass1350_0)} is Null");
return;
}
}

public override void ExperienceGained(float experience)
Expand Down
3 changes: 2 additions & 1 deletion Source/Coop/FreeCamera/FreeCameraController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using HarmonyLib;
using StayInTarkov.Configuration;
using StayInTarkov.Coop.Components.CoopGameComponents;
using StayInTarkov.Coop.SITGameModes;
using System;
using UnityEngine;
using UnityStandardAssets.ImageEffects;
Expand Down Expand Up @@ -80,7 +81,7 @@ public void Update()
if (!CoopGameComponent.TryGetCoopGameComponent(out var coopGC))
return;

var coopGame = coopGC.LocalGameInstance as CoopGame;
var coopGame = coopGC.LocalGameInstance as CoopSITGame;
if (coopGame == null)
return;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,9 @@
using BepInEx.Logging;
/**
* This file is written and licensed by Paulov (https://github.com/paulov-t) for Stay in Tarkov (https://github.com/stayintarkov)
* You are not allowed to reproduce this file in any other project
*/

using BepInEx.Logging;
using Comfort.Common;
using EFT;
using EFT.InputSystem;
Expand All @@ -8,9 +13,9 @@
using System;
using System.Collections.Generic;

namespace StayInTarkov.Coop
namespace StayInTarkov.Coop.SITGameModes
{
public abstract class ASITGame : BaseLocalGame<GamePlayerOwner>, IBotGame
public abstract class AbstractSITGame : BaseLocalGame<GamePlayerOwner>, IBotGame
{
public new bool InRaid { get { return true; } }

Expand Down Expand Up @@ -73,7 +78,7 @@ InputTree inputTree
, float fixedDeltaTime
, EUpdateQueue updateQueue
, ISession backEndSession
, TimeSpan sessionTime) where T : ASITGame
, TimeSpan sessionTime) where T : AbstractSITGame
{

var r =
Expand Down
Loading
Loading