Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
dad1a19
Now we're cooking
N1Ran Jan 27, 2019
617f8a4
Voting updated with reset for admins
N1Ran Feb 2, 2019
93e01e5
This is the percentage limiter for voting system...derp
N1Ran Feb 2, 2019
c2cd494
funsies
N1Ran Feb 3, 2019
b21be2d
?
N1Ran Feb 3, 2019
fedea70
voting module updated
N1Ran Feb 6, 2019
1591f95
voting module updated
N1Ran Feb 7, 2019
8347c1f
voting module updated.
N1Ran Feb 7, 2019
77dc054
Merge branch 'Patron' into ToPatron
N1Ran Feb 9, 2019
aeb591a
GPS Marker for grids list command
N1Ran Feb 9, 2019
b9239dc
some faction functions
N1Ran Feb 9, 2019
514ea6e
List players online
N1Ran Feb 9, 2019
1ba4878
Faction functions
N1Ran Feb 10, 2019
a33e369
New method to calculate vote
N1Ran Feb 10, 2019
6592cbe
new method to calculate votes
N1Ran Feb 10, 2019
86af0de
twe
N1Ran Feb 10, 2019
72d72e0
tweak
N1Ran Feb 10, 2019
b44e4df
Booyah
N1Ran Feb 11, 2019
0160488
Added command to list players online with admin command (useful for d…
N1Ran Feb 11, 2019
e8a59a6
Added GPS marker option to Grids list command
N1Ran Feb 11, 2019
5cb7f03
added faction list and faction remove option to faction command
N1Ran Feb 11, 2019
a528dc1
Resolving conflict before uploading
N1Ran Feb 11, 2019
7271434
Rex's faction removal merged
N1Ran Feb 11, 2019
cb3d6c7
updated with patrol Torch
N1Ran Feb 11, 2019
3c4d312
comma makes a major difference
N1Ran Feb 13, 2019
e602ea5
Resolve
N1Ran Feb 14, 2019
57f4262
Merger
N1Ran Feb 14, 2019
cecb2de
New Faction feation
N1Ran Feb 15, 2019
3115e8d
AutoCommands revamp in progress
N1Ran Feb 16, 2019
9722ca0
Yet another fix for the damned voting module
N1Ran Feb 17, 2019
3a71685
AutoCommands major tweaks and another go at fixing the damned voting …
N1Ran Feb 17, 2019
0e8019e
Let's get those new goodies loaded and decrease conflicts
N1Ran Feb 17, 2019
3a6acc4
meh
N1Ran Feb 17, 2019
7c7442b
Remove Old method and added OnStart Trigger to AutoCommands
N1Ran Feb 18, 2019
2958523
Run on Start trigger added
N1Ran Feb 18, 2019
ffc03e6
updated
N1Ran Feb 18, 2019
326820a
Here are the commit addressing the review.
N1Ran Feb 20, 2019
cf60893
Lets clear things up and look professional 🕴
N1Ran Feb 20, 2019
bb6e249
Merge branch 'Patron' into ToPatron
rexxar-tc Feb 21, 2019
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Resolve
  • Loading branch information
N1Ran committed Feb 14, 2019
commit e602ea51d8a98855ec8c101a67c6199fa0179f7d
10 changes: 8 additions & 2 deletions Essentials/Commands/AdminModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,15 @@ public void ListPlayers()
StringBuilder sb = new StringBuilder();
foreach(var player in MySession.Static.Players.GetOnlinePlayers())
{
sb.Append($"{player.DisplayName}, ");
sb.AppendLine();
sb.AppendLine($"{player.DisplayName}");
}
if (Context.Player == null)
Context.Respond(sb.ToString());
else if (Context?.Player?.SteamUserId > 0)
{
ModCommunication.SendMessageTo(new DialogMessage("List of Online Players", null, sb.ToString()), Context.Player.SteamUserId);
}
Context.Respond(sb.ToString());
}


Expand Down
5 changes: 4 additions & 1 deletion Essentials/Commands/GridModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -98,11 +98,14 @@ public void List()

if (grid.BigOwners.Contains(id))
{
var gridGPS = MyAPIGateway.Session?.GPS.Create(grid.DisplayName, ($"{grid.DisplayName} - {grid.GridSizeEnum} - {grid.BlocksCount} blocks"), grid.PositionComp.GetPosition(), true);

sb.AppendLine($"{grid.DisplayName} - {grid.GridSizeEnum} - {grid.BlocksCount} blocks - Position {(EssentialsPlugin.Instance.Config.UtilityShowPosition ? grid.PositionComp.GetPosition().ToString() : "Unknown")}");
if (EssentialsPlugin.Instance.Config.MarkerShowPosition)
{
var gridGPS = MyAPIGateway.Session?.GPS.Create(grid.DisplayName, ($"{grid.DisplayName} - {grid.GridSizeEnum} - {grid.BlocksCount} blocks"), grid.PositionComp.GetPosition(), true);

MyAPIGateway.Session?.GPS.AddGps(Context.Player.IdentityId, gridGPS);
}
}
}

Expand Down
58 changes: 37 additions & 21 deletions Essentials/Commands/WorldModule.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@
using Sandbox.ModAPI;
using SpaceEngineers.Game.GUI;
using Torch.Commands;
using Torch.Mod;
using Torch.Mod.Messages;
using Torch.Commands.Permissions;
using Torch.Managers;
using Torch.Utils;
Expand Down Expand Up @@ -96,17 +98,6 @@ public void CleanFactions(int memberCount = 1)
Context.Respond($"Removed {count} factions with fewer than {memberCount} members.");
}

[Command("faction list", "lists all factions in the game")]
[Permission(MyPromoteLevel.Admin)]
public void ListFactions()
{
StringBuilder sb = new StringBuilder();
foreach(var faction in MySession.Static.Factions.ToList())
{
sb.Append($"{faction.Value.Tag}({faction.Value.Members.Count}) ");
}
Context.Respond(sb.ToString());
}

[Command("faction remove", "removes faction by tag name")]
[Permission(MyPromoteLevel.Admin)]
Expand Down Expand Up @@ -135,29 +126,54 @@ public void RemoveFaction(string tag)
}
}

[Command("faction members", "lists members of given faction")]
[Command("faction info", "lists members of given faction")]
[Permission(MyPromoteLevel.Admin)]
public void FactionMembers(string tag)
public void FactionInfo()
{
if (tag == null)

StringBuilder sb = new StringBuilder();
double memberCount;

foreach (var factionID in MySession.Static.Factions)
{
Context.Respond("list a faction tag you would like to get members of");
return;
var faction = factionID.Value;
memberCount = faction.Members.Count();
sb.AppendLine();
sb.AppendLine($"{faction.Tag} - {memberCount} players in this faction");
foreach (var player in faction.Members)
{
var playerID = MySession.Static.Players.TryGetIdentity(player.Value.PlayerId);
sb.AppendLine($"{playerID.DisplayName}");
}
}
if (MySession.Static.Factions.FactionTagExists(tag))

//Just don't see the need for this anymore. Leaving for now in case it comes handy in the future
/*
else if (MySession.Static.Factions.FactionTagExists(tag))
{
StringBuilder sb = new StringBuilder();
var faction = MySession.Static.Factions.TryGetFactionByTag(tag);
memberCount = faction.Members.Count();

sb.AppendLine($"{faction.Tag} - {memberCount} players in this faction");
foreach (var player in faction.Members)
{
var playerID = MySession.Static.Players.TryGetIdentity(player.Value.PlayerId);
sb.Append($"{playerID.DisplayName} ");
sb.AppendLine($"{playerID.DisplayName}");
}
Context.Respond(sb.ToString());

}
else
Context.Respond($"{tag} is not a faction on this server");

*/

if (Context.Player == null)
Context.Respond(sb.ToString());
else if (Context?.Player?.SteamUserId > 0)
{
ModCommunication.SendMessageTo(new DialogMessage("Faction Info", null, sb.ToString()), Context.Player.SteamUserId);
}


}

private static void RemoveEmptyFactions()
Expand Down