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

Commit 0ffd50c

Browse files
committed
Added timed command system, added more debug to reserved slots, waypoint work, chat tweak
1 parent bb6f5d2 commit 0ffd50c

25 files changed

+469
-269
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-
//167
1+
//211
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.167")]
10-
[assembly: AssemblyVersion("1.13.5.167")]
9+
[assembly: AssemblyFileVersion("1.13.5.211")]
10+
[assembly: AssemblyVersion("1.13.5.211")]

EssentialsPlugin/ChatHandlers/Admin/HandleAdminTest.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public override bool AllowedInConsole()
3636

3737
public override bool HandleCommand( ulong userId, string[ ] words )
3838
{
39-
Communication.SendPrivateInformation( userId, "hello" );
39+
CargoShips.SpawnPrefabWithTrajectory( );
4040

4141
return true;
4242
}

EssentialsPlugin/ChatHandlers/AdminConceal/HandleAdminReveal.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,11 @@ public override bool HandleCommand(ulong userId, string[] words)
137137
}
138138

139139
if ( !now )
140-
Log.Info( string.Format( "Command would reveal {0} grids. Type /admin reveal force to reveal them.", count ) );
140+
Communication.SendPrivateInformation( userId,
141+
$"Command would reveal {count} grids. Type /admin reveal force to reveal them." );
141142

142143
else
143-
Log.Info( string.Format( "Command revealed {0} grids.", count ) );
144+
Communication.SendPrivateInformation(userId, $"Command revealed {count} grids." );
144145
}
145146
return true;
146147
}

EssentialsPlugin/ChatHandlers/AdminSettings/HandleAdminSettings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public override bool HandleCommand(ulong userId, string[] words)
4646
//string longMessage =
4747
// "/dialog \"Help\" \"Admin Settings\" \"\"" +
4848
// "\"" + results.Replace( "\r\n", "| " ) + "\" \"close\" ";
49-
//Communication.SendClientMessage( userId, longMessage );
49+
//Communication.WaypointMessage( userId, longMessage );
5050

5151
Communication.DisplayDialog( userId, "Admin Settings", "Current Settings", results.Replace( "\r\n", "|" ), "close" );
5252
}

EssentialsPlugin/ChatHandlers/Utility/HandleUtilityGridsCompare.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ public override bool HandleCommand(ulong userId, string[] words)
5555
entityList.Add(entity.EntityId);
5656
}
5757

58-
//Communication.SendClientMessage(userId, string.Format("/conceal {0}", string.Join(",", entityList.Select(x => x.ToString()).ToArray())));
58+
//Communication.WaypointMessage(userId, string.Format("/conceal {0}", string.Join(",", entityList.Select(x => x.ToString()).ToArray())));
5959
Console.WriteLine("Here: {0}", string.Join(",", entityList.Select(x => x.ToString()).ToArray()));
6060
return true;
6161
}

EssentialsPlugin/ChatHandlers/Waypoints/HandleWaypointAdd.cs

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,12 @@ public class HandleWaypointAdd : ChatHandlerBase
1212
public override string GetHelp()
1313
{
1414
return "Creates a personal waypoint. Only you can see it. Usage: /waypoint add \"waypoint name\" \"waypoint text\" Neutral | Allied | Enemy X Y Z. Example: /waypoint add MyWayPoint MyWaypoint Neutral 1000 1000 1000";
15-
}
15+
}
16+
17+
public override string GetCommandText()
18+
{
19+
return "/waypoint add";
20+
}
1621

1722
public override Communication.ServerDialogItem GetHelpDialog( )
1823
{
@@ -24,13 +29,7 @@ public override Communication.ServerDialogItem GetHelpDialog( )
2429
return DialogItem;
2530
}
2631

27-
28-
public override string GetCommandText()
29-
{
30-
return "/waypoint add";
31-
}
32-
33-
public override string[] GetMultipleCommandText()
32+
public override string[] GetMultipleCommandText()
3433
{
3534
return new string[] { "/waypoint add", "/wp add" };
3635
}
@@ -81,7 +80,7 @@ public override bool HandleCommand(ulong userId, string[] words)
8180
Vector3D pos = playerEntity.GetPosition();
8281
string name = words[0];
8382

84-
//Communication.SendClientMessage(userId, string.Format("/waypoint add '{0}' '{0}' Neutral {1} {2} {3}", name, Math.Floor(pos.X), Math.Floor(pos.Y), Math.Floor(pos.Z)));
83+
Communication.WaypointMessage(userId, string.Format("add '{0}' '{0}' Neutral {1} {2} {3}", name, Math.Floor(pos.X), Math.Floor(pos.Y), Math.Floor(pos.Z)));
8584

8685
WaypointItem item = new WaypointItem();
8786
item.SteamId = userId;
@@ -91,7 +90,6 @@ public override bool HandleCommand(ulong userId, string[] words)
9190
item.WaypointType = WaypointTypes.Neutral;
9291
Waypoints.Instance.Add(item);
9392

94-
Communication.WaypointMessage( item );
9593
Communication.SendPrivateInformation(userId, string.Format("Waypoint added: '{0}' at {1}", item.Name, General.Vector3DToString(item.Position)));
9694
}
9795
else
@@ -119,8 +117,8 @@ public override bool HandleCommand(ulong userId, string[] words)
119117
add += " " + word;
120118
}
121119

122-
//Communication.SendClientMessage(userId, string.Format("/waypoint add {0}", add));
123-
120+
Communication.WaypointMessage(userId, string.Format("add {0}", add));
121+
124122
string group = "";
125123
if (words.Length == 7)
126124
group = words[7];
@@ -138,8 +136,7 @@ public override bool HandleCommand(ulong userId, string[] words)
138136
item.Group = group;
139137
Waypoints.Instance.Add(item);
140138

141-
Communication.WaypointMessage( item );
142-
Communication.SendPrivateInformation(userId, string.Format("Waypoint added: '{0}' at {1}", item.Name, General.Vector3DToString(item.Position)));
139+
Communication.SendPrivateInformation(userId, string.Format("Waypoint added: '{0}' at {1}", item.Name, General.Vector3DToString(item.Position)));
143140
}
144141
return true;
145142
}

EssentialsPlugin/ChatHandlers/Waypoints/HandleWaypointFactionAdd.cs

Lines changed: 24 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,12 @@ public class HandleWaypointFactionAdd : ChatHandlerBase
1414
public override string GetHelp()
1515
{
1616
return "Creates a faction waypoint. Only your faction can see it.\r\nUsage: /waypoint factionadd \"waypoint name\" \"waypoint text\" Neutral | Allied | Enemy X Y Z (group name)\r\nExampleA: /waypoint factionadd MyWayPoint MyWaypoint Neutral 1000 1000 1000\r\nExampleB: /waypoint factionadd target\r\nExampleC: /waypoint factionadd Target1 Target1 Enemy 1000 1000 1000 Targets";
17-
}
17+
}
18+
19+
public override string GetCommandText()
20+
{
21+
return "/waypoint factionadd";
22+
}
1823

1924
public override Communication.ServerDialogItem GetHelpDialog( )
2025
{
@@ -26,13 +31,7 @@ public override Communication.ServerDialogItem GetHelpDialog( )
2631
return DialogItem;
2732
}
2833

29-
30-
public override string GetCommandText()
31-
{
32-
return "/waypoint factionadd";
33-
}
34-
35-
public override string[] GetMultipleCommandText()
34+
public override string[] GetMultipleCommandText()
3635
{
3736
return new[] { "/waypoint factionadd", "/wp factionadd", "/waypoint fa", "/wp fa" };
3837
}
@@ -90,6 +89,15 @@ public override bool HandleCommand(ulong userId, string[] words)
9089

9190
Vector3D pos = playerEntity.GetPosition();
9291
string name = words[0];
92+
93+
foreach (ulong steamId in PlayerManager.Instance.ConnectedPlayers)
94+
{
95+
if (Player.CheckPlayerSameFaction(userId, steamId))
96+
{
97+
Communication.WaypointMessage(steamId, string.Format("add '{0}' '{0}' Neutral {1} {2} {3}", name, Math.Floor(pos.X), Math.Floor(pos.Y), Math.Floor(pos.Z)));
98+
}
99+
}
100+
93101
WaypointItem item = new WaypointItem
94102
{
95103
SteamId = (ulong) faction.FactionId,
@@ -101,16 +109,6 @@ public override bool HandleCommand(ulong userId, string[] words)
101109
};
102110
Waypoints.Instance.Add(item);
103111

104-
foreach (ulong steamId in PlayerManager.Instance.ConnectedPlayers)
105-
{
106-
if (Player.CheckPlayerSameFaction(userId, steamId))
107-
{
108-
//Communication.SendClientMessage(steamId, string.Format("/waypoint add '{0}' '{0}' Neutral {1} {2} {3}", name, Math.Floor(pos.X), Math.Floor(pos.Y), Math.Floor(pos.Z)));
109-
Communication.WaypointMessage( item );
110-
}
111-
}
112-
113-
114112
Communication.SendFactionClientMessage(userId, string.Format("/message Server {2} has added the waypoint: '{0}' at {1} by '{2}'", item.Name, General.Vector3DToString(item.Position), playerName));
115113
}
116114
else
@@ -127,6 +125,14 @@ public override bool HandleCommand(ulong userId, string[] words)
127125

128126
string add = string.Join(" ", words.Select(s => s.ToLowerInvariant()));
129127

128+
foreach (ulong steamId in PlayerManager.Instance.ConnectedPlayers)
129+
{
130+
if (Player.CheckPlayerSameFaction(userId, steamId))
131+
{
132+
Communication.WaypointMessage(steamId, string.Format("add {0}", add));
133+
}
134+
}
135+
130136
string group = "";
131137
if (words.Length == 7)
132138
group = words[7];
@@ -145,15 +151,6 @@ public override bool HandleCommand(ulong userId, string[] words)
145151
item.Leader = faction.IsLeader(playerId);
146152
Waypoints.Instance.Add(item);
147153

148-
foreach (ulong steamId in PlayerManager.Instance.ConnectedPlayers)
149-
{
150-
if (Player.CheckPlayerSameFaction(userId, steamId))
151-
{
152-
//Communication.SendClientMessage(steamId, string.Format("/waypoint add {0}", add));
153-
Communication.WaypointMessage( item );
154-
}
155-
}
156-
157154
Communication.SendFactionClientMessage(userId, string.Format("/message Server {2} has added the waypoint: '{0}' at {1} by '{2}'", item.Name, General.Vector3DToString(item.Position), playerName));
158155
}
159156
return true;

EssentialsPlugin/ChatHandlers/Waypoints/HandleWaypointFactionRemove.cs

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ public class HandleWaypointFactionRemove : ChatHandlerBase
1111
public override string GetHelp()
1212
{
1313
return "Removes a faction waypoint. If a leader created the waypoint, only a leader can remove it. Usage: /waypoint factionremove \"name\"";
14-
}
14+
}
15+
16+
public override string GetCommandText()
17+
{
18+
return "/waypoint factionremove";
19+
}
1520

1621
public override Communication.ServerDialogItem GetHelpDialog( )
1722
{
@@ -23,13 +28,7 @@ public override Communication.ServerDialogItem GetHelpDialog( )
2328
return DialogItem;
2429
}
2530

26-
27-
public override string GetCommandText()
28-
{
29-
return "/waypoint factionremove";
30-
}
31-
32-
public override string[] GetMultipleCommandText()
31+
public override string[] GetMultipleCommandText()
3332
{
3433
return new string[] { "/waypoint factionremove", "/wp factionremove", "/waypoint fr", "/wp fr" };
3534
}
@@ -82,16 +81,14 @@ public override bool HandleCommand(ulong userId, string[] words)
8281
Communication.SendPrivateInformation(userId, string.Format("You must be a faction leader to remove the waypoint: {0}", words[0]));
8382
return true;
8483
}
85-
84+
8685
Waypoints.Instance.Remove((ulong)faction.FactionId, words[0]);
8786
foreach (ulong steamId in PlayerManager.Instance.ConnectedPlayers)
8887
{
8988
if (Player.CheckPlayerSameFaction(userId, steamId))
9089
{
91-
//Communication.SendClientMessage(steamId, string.Format("/waypoint remove '{0}'", words[0]));
92-
item.Remove = true;
93-
Communication.WaypointMessage( item );
94-
}
90+
Communication.WaypointMessage(steamId, string.Format("remove '{0}'", words[0]));
91+
}
9592
}
9693

9794
Communication.SendFactionClientMessage(userId, string.Format("/message Server {0} has removed the waypoint: '{1}'", playerName, words[0]));

EssentialsPlugin/ChatHandlers/Waypoints/HandleWaypointGroupAdd.cs

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,12 @@ public class HandleWaypointGroupAdd : ChatHandlerBase
1111
public override string GetHelp()
1212
{
1313
return "Adds a waypoint to a waypoint group. Waypoint groups can be toggled on and off together with the toggle command. Usage: /waypoint groupadd [group name] [existing waypoint name]. Example: /waypoint groupadd Targets Target1";
14-
}
14+
}
15+
16+
public override string GetCommandText()
17+
{
18+
return "/waypoint groupadd";
19+
}
1520

1621
public override Communication.ServerDialogItem GetHelpDialog( )
1722
{
@@ -23,13 +28,7 @@ public override Communication.ServerDialogItem GetHelpDialog( )
2328
return DialogItem;
2429
}
2530

26-
27-
public override string GetCommandText()
28-
{
29-
return "/waypoint groupadd";
30-
}
31-
32-
public override string[] GetMultipleCommandText()
31+
public override string[] GetMultipleCommandText()
3332
{
3433
return new string[] { "/waypoint groupadd", "/wp groupadd", "/waypoint ga", "/wp ga" };
3534
}

0 commit comments

Comments
 (0)