Skip to content
This repository was archived by the owner on Jun 23, 2023. It is now read-only.

Commit eddb327

Browse files
committed
Revert to waypoint system using GPS. Implement block enforcement exclusion; closes #83
1 parent 5fe91b9 commit eddb327

File tree

11 files changed

+105
-78
lines changed

11 files changed

+105
-78
lines changed
0 Bytes
Binary file not shown.
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
//350
1+
//353
22
//
33
// This code was generated by a tool. Any changes made manually will be lost
44
// the next time this code is regenerated.
55
//
66

77
using System.Reflection;
88

9-
[assembly: AssemblyFileVersion("1.13.5.350")]
10-
[assembly: AssemblyVersion("1.13.5.350")]
9+
[assembly: AssemblyFileVersion("1.13.5.353")]
10+
[assembly: AssemblyVersion("1.13.5.353")]

EssentialsPlugin/ChatHandlers/Waypoints/HandleWaypointAdd.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,9 @@ public override bool HandleCommand(ulong userId, string[] words)
8585
WaypointItem item = new WaypointItem();
8686
item.SteamId = userId;
8787
item.Name = name;
88-
item.Text = name;
88+
//item.Text = name;
8989
item.Position = pos;
90-
item.WaypointType = WaypointTypes.Neutral;
90+
//item.WaypointType = WaypointTypes.Neutral;
9191
Waypoints.Instance.Add(item);
9292

9393
Communication.SendPrivateInformation(userId, string.Format("Waypoint added: '{0}' at {1}", item.Name, General.Vector3DToString(item.Position)));
@@ -128,10 +128,10 @@ public override bool HandleCommand(ulong userId, string[] words)
128128
item.Name = words[0];
129129

130130
int diff = words.Length > 5 ? 1 : 0;
131-
item.Text = words[diff];
132-
WaypointTypes type = WaypointTypes.Neutral;
133-
Enum.TryParse<WaypointTypes>(words[diff + 1], true, out type);
134-
item.WaypointType = type;
131+
item.Description = words[diff];
132+
//WaypointTypes type = WaypointTypes.Neutral;
133+
//Enum.TryParse<WaypointTypes>(words[diff + 1], true, out type);
134+
//item.WaypointType = type;
135135
item.Position = new Vector3D(double.Parse(words[diff + 2]), double.Parse(words[diff + 3]), double.Parse(words[diff + 4]));
136136
item.Group = group;
137137
Waypoints.Instance.Add(item);

EssentialsPlugin/ChatHandlers/Waypoints/HandleWaypointFactionAdd.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -103,10 +103,8 @@ public override bool HandleCommand(ulong userId, string[] words)
103103
{
104104
SteamId = (ulong) faction.FactionId,
105105
Name = name,
106-
Text = name,
107-
Position = pos,
108-
WaypointType = WaypointTypes.Neutral,
109-
Leader = faction.IsLeader( playerId )
106+
//Text = name,
107+
Position = pos
110108
};
111109
Waypoints.Instance.Add(item);
112110

@@ -142,11 +140,11 @@ public override bool HandleCommand(ulong userId, string[] words)
142140
{
143141
SteamId = (ulong) faction.FactionId,
144142
Name = words[0],
145-
Text = words[1]
143+
//Text = words[1]
146144
};
147-
WaypointTypes type;
148-
Enum.TryParse(words[2], true, out type);
149-
item.WaypointType = type;
145+
//WaypointTypes type;
146+
//Enum.TryParse(words[2], true, out type);
147+
//item.WaypointType = type;
150148
item.Position = new Vector3D(double.Parse(words[3]), double.Parse(words[4]), double.Parse(words[5]));
151149
item.Group = group;
152150
item.Leader = faction.IsLeader(playerId);

EssentialsPlugin/ChatHandlers/Waypoints/HandleWaypointList.cs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,9 @@ public override bool HandleCommand(ulong userId, string[] words)
6666
waypoints += "\r\n";
6767

6868
if(item.Group != null && item.Group != "")
69-
waypoints += string.Format("Group {3} - {0}: '{1}' : {2}", item.Name, item.Text, General.Vector3DToString(item.Position), item.Group);
69+
waypoints += string.Format("Group {3} - {0}: '{1}' : {2}", item.Name, item.Description, General.Vector3DToString(item.Position), item.Group);
7070
else
71-
waypoints += string.Format("{0}: '{1}' : {2}", item.Name, item.Text, General.Vector3DToString(item.Position));
71+
waypoints += string.Format("{0}: '{1}' : {2}", item.Name, item.Description, General.Vector3DToString(item.Position));
7272
}
7373
personalCount = items.Count;
7474

@@ -86,9 +86,9 @@ public override bool HandleCommand(ulong userId, string[] words)
8686
waypoints += "\r\n";
8787

8888
if (item.Group != null && item.Group != "")
89-
waypoints += string.Format("F: Group {3} - {0}: '{1}' : {2}", item.Name, item.Text, General.Vector3DToString(item.Position), item.Group);
89+
waypoints += string.Format("F: Group {3} - {0}: '{1}' : {2}", item.Name, item.Description, General.Vector3DToString(item.Position), item.Group);
9090
else
91-
waypoints += string.Format("F: {0}: '{1}' : {2}", item.Name, item.Text, General.Vector3DToString(item.Position));
91+
waypoints += string.Format("F: {0}: '{1}' : {2}", item.Name, item.Description, General.Vector3DToString(item.Position));
9292
}
9393

9494
factionCount = items.Count;

EssentialsPlugin/Essentials.cs

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -959,7 +959,17 @@ public MTObservableCollection<SettingsBlockEnforcementItem> BlockEnforcementItem
959959
{
960960
get { return PluginSettings.Instance.BlockEnforcementItems; }
961961
}
962-
962+
963+
[Category("Block Enforcement System")]
964+
[Description( "This is a list of entityIDs that are ignored by block enforcement.")]
965+
[Browsable(true)]
966+
[ReadOnly(false)]
967+
public string[] BlockEnforcementExclusions
968+
{
969+
get { return PluginSettings.Instance.BlockEnforcementExclusions; }
970+
set { PluginSettings.Instance.BlockEnforcementExclusions = value; }
971+
}
972+
963973
[Category( "Reserved Slots" )]
964974
[Description( "This reserves slots for whitelisted players or groups." )]
965975
[Browsable( true )]

EssentialsPlugin/ProcessHandlers/ProcessBlockEnforcement.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
{
33
using System;
44
using System.Collections.Generic;
5+
using System.Linq;
56
using EssentialsPlugin.Settings;
67
using EssentialsPlugin.Utility;
78
using Sandbox.ModAPI;
@@ -66,6 +67,12 @@ private void ScanForBlockItems( )
6667
if ( !entity.InScene )
6768
continue;
6869

70+
if ( PluginSettings.Instance.ProtectedEnabled && PluginSettings.Instance.ProtectedItems.Any( x => x.Enabled && ( x.EntityId == entity.EntityId ) ) )
71+
continue;
72+
73+
if ( PluginSettings.Instance.BlockEnforcementExclusions.Contains( entity.EntityId.ToString( ) ) )
74+
continue;
75+
6976
IMyCubeGrid grid = (IMyCubeGrid)entity;
7077
//IMyGridTerminalSystem gridTerminal = MyAPIGateway.TerminalActionsHelper.GetTerminalSystemForGrid( grid );
7178

EssentialsPlugin/ProcessHandlers/ProcessWaypoints.cs

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
namespace EssentialsPlugin.ProcessHandlers
22
{
3-
using System;
4-
using System.Collections.Generic;
5-
using System.Linq;
6-
using EssentialsPlugin.Settings;
7-
using EssentialsPlugin.Utility;
8-
using Sandbox.ModAPI;
9-
using VRage.Game.ModAPI;
10-
using VRageMath;
11-
12-
public class ProcessWaypoints : ProcessHandlerBase
3+
using System;
4+
using System.Collections.Generic;
5+
using System.Linq;
6+
using EssentialsPlugin.Settings;
7+
using EssentialsPlugin.Utility;
8+
using Sandbox.ModAPI;
9+
using VRageMath;
10+
using Sandbox.Game.Multiplayer;
11+
using SEModAPIInternal.API.Common;
12+
using VRage.Game.ModAPI;
13+
14+
public class ProcessWaypoints : ProcessHandlerBase
1315
{
1416
private List<ulong> m_waypointAdd = new List<ulong>( );
1517

@@ -71,8 +73,8 @@ public override void Handle()
7173
{
7274
WaypointItem newItem = new WaypointItem();
7375
newItem.Name = item.Name;
74-
newItem.Text = item.Name;
75-
newItem.WaypointType = WaypointTypes.Neutral;
76+
//newItem.Text = item.Name;
77+
//newItem.WaypointType = WaypointTypes.Neutral;
7678
newItem.Position = new Vector3D(item.X, item.Y, item.Z);
7779
newItem.SteamId = steamId;
7880
Waypoints.Instance.Add(newItem);

EssentialsPlugin/Settings/PluginSettings.cs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ public class PluginSettings
110110

111111
private bool _blockEnforcementEnabled;
112112
private MTObservableCollection<SettingsBlockEnforcementItem> _blockEnforcementItems;
113+
private string[] _blockEnforcementExclusion = {};
113114

114115
private bool _gameModeConquestEnabled;
115116

@@ -880,6 +881,16 @@ public MTObservableCollection<SettingsBlockEnforcementItem> BlockEnforcementItem
880881
}
881882
}
882883

884+
public string[] BlockEnforcementExclusions
885+
{
886+
get { return _blockEnforcementExclusion; }
887+
set
888+
{
889+
_blockEnforcementExclusion = value;
890+
Save( );
891+
}
892+
}
893+
883894
public bool GameModeConquestEnabled
884895
{
885896
get { return _gameModeConquestEnabled; }

EssentialsPlugin/Settings/SettingsServerWaypointItem.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ public string Name
1919
set { name = value; }
2020
}
2121

22+
private string description;
23+
public string Description
24+
{
25+
get { return description; }
26+
set { description = value; }
27+
}
28+
2229
private double x;
2330
public double X
2431
{

0 commit comments

Comments
 (0)