Skip to content
This repository has been archived by the owner on Sep 16, 2023. It is now read-only.

Commit

Permalink
Merge pull request #8 from xNexus-ACS/dev
Browse files Browse the repository at this point in the history
Added more API to CursedServer and CursedRound
  • Loading branch information
Jesus-QC authored Jan 12, 2023
2 parents f2bd4bb + 780b34b commit eb26fa0
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
12 changes: 12 additions & 0 deletions CursedMod/Features/Wrappers/Round/CursedRound.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,18 @@ public static int ZombiesConverted
set => RoundSummary.ChangedIntoZombies = value;
}

public static int RoundKills
{
get => RoundSummary.Kills;
set => RoundSummary.Kills = value;
}

public static int SurvivedScps
{
get => RoundSummary.SurvivingSCPs;
set => RoundSummary.SurvivingSCPs = value;
}

public static int UpTime => RoundRestart.UptimeRounds;

public static TimeSpan RoundTime => RoundStart.RoundLength;
Expand Down
32 changes: 31 additions & 1 deletion CursedMod/Features/Wrappers/Server/CursedServer.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
using CursedMod.Features.Wrappers.Player.Dummies;
using System;
using CursedMod.Features.Wrappers.Player.Dummies;
using Mirror.LiteNetLib4Mirror;
using UnityEngine;

namespace CursedMod.Features.Wrappers.Server;

Expand Down Expand Up @@ -44,4 +46,32 @@ public static bool HeavilyModded
get => CustomNetworkManager.HeavilyModded;
set => CustomNetworkManager.HeavilyModded = value;
}

public static bool IsFriendlyFireEnabled
{
get => ServerConsole.FriendlyFire;
set => ServerConsole.FriendlyFire = value;
}

public static bool IsWhitelistEnabled
{
get => ServerConsole.WhiteListEnabled;
set => ServerConsole.WhiteListEnabled = value;
}

public static string IpAddress => ServerConsole.Ip;

public static double Ticks => Math.Round(1f / Time.smoothDeltaTime);

public static double Frames => Math.Round(1f / Time.deltaTime);

public static bool IsBeta => GameCore.Version.PublicBeta || GameCore.Version.PrivateBeta;

public static bool IsDedicated => ServerStatic.IsDedicated;

public static void RefreshServerName() => ServerConsole.singleton.RefreshServerName();

public static void RefreshServerData() => ServerConsole.singleton.RefreshServerData();

public static void SendCommand(string command, CommandSender sender = null) => GameCore.Console.singleton.TypeCommand(command, sender ?? LocalPlayer.Sender);
}

0 comments on commit eb26fa0

Please sign in to comment.