-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Completely reworked the Tick system, cuz why not make it overdone? Al…
…so added a new AutoArray collection which should in theory be faster than anything else.
- Loading branch information
Showing
58 changed files
with
1,445 additions
and
926 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
32 changes: 32 additions & 0 deletions
32
LabExtended/API/CustomCommands/Tick/Status/TickStatusCommand.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
using LabExtended.Commands; | ||
using LabExtended.Commands.Arguments; | ||
using LabExtended.Commands.Interfaces; | ||
|
||
using LabExtended.Core.Ticking; | ||
|
||
namespace LabExtended.API.CustomCommands.Tick.Status | ||
{ | ||
public class TickStatusCommand : CustomCommand | ||
{ | ||
public override string Command => "status"; | ||
public override string Description => "Shows the status of tick distribution."; | ||
|
||
public override void OnCommand(ExPlayer sender, ICommandContext ctx, ArgumentCollection args) | ||
{ | ||
base.OnCommand(sender, ctx, args); | ||
|
||
if (TickDistribution.AllDistributors.Count() < 1) | ||
{ | ||
ctx.RespondOk("There aren't any tick distributors."); | ||
return; | ||
} | ||
|
||
var str = $"Tick Distributors ({TickDistribution.AllDistributors.Count()}):\n"; | ||
|
||
foreach (var distributor in TickDistribution.AllDistributors) | ||
str += $"[{distributor.GetType().Name}]: {distributor.HandleCount} handle(s), {distributor.TickRate} TPS\n"; | ||
|
||
ctx.RespondOk(str); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
using CommandSystem; | ||
|
||
using LabExtended.API.CustomCommands.Tick.Status; | ||
using LabExtended.Commands; | ||
|
||
namespace LabExtended.API.CustomCommands.Tick | ||
{ | ||
[CommandHandler(typeof(RemoteAdminCommandHandler))] | ||
[CommandHandler(typeof(GameConsoleCommandHandler))] | ||
public class TickCommand : VanillaParentCommandBase | ||
{ | ||
public override string Command => "tick"; | ||
public override string Description => "Commands for tick distribution management."; | ||
|
||
public override void LoadGeneratedCommands() | ||
{ | ||
base.LoadGeneratedCommands(); | ||
|
||
RegisterCommand(new TickStatusCommand()); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.