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

Commit

Permalink
Added timed command system, added more debug to reserved slots, waypo…
Browse files Browse the repository at this point in the history
…int work, chat tweak
  • Loading branch information
rexxar-tc committed Feb 18, 2016
1 parent bb6f5d2 commit 0ffd50c
Show file tree
Hide file tree
Showing 25 changed files with 469 additions and 269 deletions.
Binary file modified .vs/EssentialsPlugin/EssentialsPlugin.scgdat
Binary file not shown.
6 changes: 3 additions & 3 deletions EssentialsPlugin/AssemblyFileVersion.cs
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
//167
//211
//
// This code was generated by a tool. Any changes made manually will be lost
// the next time this code is regenerated.
//

using System.Reflection;

[assembly: AssemblyFileVersion("1.13.5.167")]
[assembly: AssemblyVersion("1.13.5.167")]
[assembly: AssemblyFileVersion("1.13.5.211")]
[assembly: AssemblyVersion("1.13.5.211")]
2 changes: 1 addition & 1 deletion EssentialsPlugin/ChatHandlers/Admin/HandleAdminTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public override bool AllowedInConsole()

public override bool HandleCommand( ulong userId, string[ ] words )
{
Communication.SendPrivateInformation( userId, "hello" );
CargoShips.SpawnPrefabWithTrajectory( );

return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,10 +137,11 @@ public override bool HandleCommand(ulong userId, string[] words)
}

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

else
Log.Info( string.Format( "Command revealed {0} grids.", count ) );
Communication.SendPrivateInformation(userId, $"Command revealed {count} grids." );
}
return true;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public override bool HandleCommand(ulong userId, string[] words)
//string longMessage =
// "/dialog \"Help\" \"Admin Settings\" \"\"" +
// "\"" + results.Replace( "\r\n", "| " ) + "\" \"close\" ";
//Communication.SendClientMessage( userId, longMessage );
//Communication.WaypointMessage( userId, longMessage );

Communication.DisplayDialog( userId, "Admin Settings", "Current Settings", results.Replace( "\r\n", "|" ), "close" );
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ public override bool HandleCommand(ulong userId, string[] words)
entityList.Add(entity.EntityId);
}

//Communication.SendClientMessage(userId, string.Format("/conceal {0}", string.Join(",", entityList.Select(x => x.ToString()).ToArray())));
//Communication.WaypointMessage(userId, string.Format("/conceal {0}", string.Join(",", entityList.Select(x => x.ToString()).ToArray())));
Console.WriteLine("Here: {0}", string.Join(",", entityList.Select(x => x.ToString()).ToArray()));
return true;
}
Expand Down
25 changes: 11 additions & 14 deletions EssentialsPlugin/ChatHandlers/Waypoints/HandleWaypointAdd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ public class HandleWaypointAdd : ChatHandlerBase
public override string GetHelp()
{
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";
}
}

public override string GetCommandText()
{
return "/waypoint add";
}

public override Communication.ServerDialogItem GetHelpDialog( )
{
Expand All @@ -24,13 +29,7 @@ public override Communication.ServerDialogItem GetHelpDialog( )
return DialogItem;
}


public override string GetCommandText()
{
return "/waypoint add";
}

public override string[] GetMultipleCommandText()
public override string[] GetMultipleCommandText()
{
return new string[] { "/waypoint add", "/wp add" };
}
Expand Down Expand Up @@ -81,7 +80,7 @@ public override bool HandleCommand(ulong userId, string[] words)
Vector3D pos = playerEntity.GetPosition();
string name = words[0];

//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)));
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)));

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

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

//Communication.SendClientMessage(userId, string.Format("/waypoint add {0}", add));

Communication.WaypointMessage(userId, string.Format("add {0}", add));
string group = "";
if (words.Length == 7)
group = words[7];
Expand All @@ -138,8 +136,7 @@ public override bool HandleCommand(ulong userId, string[] words)
item.Group = group;
Waypoints.Instance.Add(item);

Communication.WaypointMessage( item );
Communication.SendPrivateInformation(userId, string.Format("Waypoint added: '{0}' at {1}", item.Name, General.Vector3DToString(item.Position)));
Communication.SendPrivateInformation(userId, string.Format("Waypoint added: '{0}' at {1}", item.Name, General.Vector3DToString(item.Position)));
}
return true;
}
Expand Down
51 changes: 24 additions & 27 deletions EssentialsPlugin/ChatHandlers/Waypoints/HandleWaypointFactionAdd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,12 @@ public class HandleWaypointFactionAdd : ChatHandlerBase
public override string GetHelp()
{
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";
}
}

public override string GetCommandText()
{
return "/waypoint factionadd";
}

public override Communication.ServerDialogItem GetHelpDialog( )
{
Expand All @@ -26,13 +31,7 @@ public override Communication.ServerDialogItem GetHelpDialog( )
return DialogItem;
}


public override string GetCommandText()
{
return "/waypoint factionadd";
}

public override string[] GetMultipleCommandText()
public override string[] GetMultipleCommandText()
{
return new[] { "/waypoint factionadd", "/wp factionadd", "/waypoint fa", "/wp fa" };
}
Expand Down Expand Up @@ -90,6 +89,15 @@ public override bool HandleCommand(ulong userId, string[] words)

Vector3D pos = playerEntity.GetPosition();
string name = words[0];

foreach (ulong steamId in PlayerManager.Instance.ConnectedPlayers)
{
if (Player.CheckPlayerSameFaction(userId, steamId))
{
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)));
}
}

WaypointItem item = new WaypointItem
{
SteamId = (ulong) faction.FactionId,
Expand All @@ -101,16 +109,6 @@ public override bool HandleCommand(ulong userId, string[] words)
};
Waypoints.Instance.Add(item);

foreach (ulong steamId in PlayerManager.Instance.ConnectedPlayers)
{
if (Player.CheckPlayerSameFaction(userId, steamId))
{
//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)));
Communication.WaypointMessage( item );
}
}


Communication.SendFactionClientMessage(userId, string.Format("/message Server {2} has added the waypoint: '{0}' at {1} by '{2}'", item.Name, General.Vector3DToString(item.Position), playerName));
}
else
Expand All @@ -127,6 +125,14 @@ public override bool HandleCommand(ulong userId, string[] words)

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

foreach (ulong steamId in PlayerManager.Instance.ConnectedPlayers)
{
if (Player.CheckPlayerSameFaction(userId, steamId))
{
Communication.WaypointMessage(steamId, string.Format("add {0}", add));
}
}

string group = "";
if (words.Length == 7)
group = words[7];
Expand All @@ -145,15 +151,6 @@ public override bool HandleCommand(ulong userId, string[] words)
item.Leader = faction.IsLeader(playerId);
Waypoints.Instance.Add(item);

foreach (ulong steamId in PlayerManager.Instance.ConnectedPlayers)
{
if (Player.CheckPlayerSameFaction(userId, steamId))
{
//Communication.SendClientMessage(steamId, string.Format("/waypoint add {0}", add));
Communication.WaypointMessage( item );
}
}

Communication.SendFactionClientMessage(userId, string.Format("/message Server {2} has added the waypoint: '{0}' at {1} by '{2}'", item.Name, General.Vector3DToString(item.Position), playerName));
}
return true;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ public class HandleWaypointFactionRemove : ChatHandlerBase
public override string GetHelp()
{
return "Removes a faction waypoint. If a leader created the waypoint, only a leader can remove it. Usage: /waypoint factionremove \"name\"";
}
}

public override string GetCommandText()
{
return "/waypoint factionremove";
}

public override Communication.ServerDialogItem GetHelpDialog( )
{
Expand All @@ -23,13 +28,7 @@ public override Communication.ServerDialogItem GetHelpDialog( )
return DialogItem;
}


public override string GetCommandText()
{
return "/waypoint factionremove";
}

public override string[] GetMultipleCommandText()
public override string[] GetMultipleCommandText()
{
return new string[] { "/waypoint factionremove", "/wp factionremove", "/waypoint fr", "/wp fr" };
}
Expand Down Expand Up @@ -82,16 +81,14 @@ public override bool HandleCommand(ulong userId, string[] words)
Communication.SendPrivateInformation(userId, string.Format("You must be a faction leader to remove the waypoint: {0}", words[0]));
return true;
}

Waypoints.Instance.Remove((ulong)faction.FactionId, words[0]);
foreach (ulong steamId in PlayerManager.Instance.ConnectedPlayers)
{
if (Player.CheckPlayerSameFaction(userId, steamId))
{
//Communication.SendClientMessage(steamId, string.Format("/waypoint remove '{0}'", words[0]));
item.Remove = true;
Communication.WaypointMessage( item );
}
Communication.WaypointMessage(steamId, string.Format("remove '{0}'", words[0]));
}
}

Communication.SendFactionClientMessage(userId, string.Format("/message Server {0} has removed the waypoint: '{1}'", playerName, words[0]));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ public class HandleWaypointGroupAdd : ChatHandlerBase
public override string GetHelp()
{
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";
}
}

public override string GetCommandText()
{
return "/waypoint groupadd";
}

public override Communication.ServerDialogItem GetHelpDialog( )
{
Expand All @@ -23,13 +28,7 @@ public override Communication.ServerDialogItem GetHelpDialog( )
return DialogItem;
}


public override string GetCommandText()
{
return "/waypoint groupadd";
}

public override string[] GetMultipleCommandText()
public override string[] GetMultipleCommandText()
{
return new string[] { "/waypoint groupadd", "/wp groupadd", "/waypoint ga", "/wp ga" };
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ public class HandleWaypointGroupRemove : ChatHandlerBase
public override string GetHelp()
{
return "Removes a waypoint to a waypoint group. Usage: /waypoint groupremove [existing waypoint name]. Example: /waypoint groupremove Target1";
}
}

public override string GetCommandText()
{
return "/waypoint groupremove";
}

public override Communication.ServerDialogItem GetHelpDialog( )
{
Expand All @@ -23,13 +28,7 @@ public override Communication.ServerDialogItem GetHelpDialog( )
return DialogItem;
}


public override string GetCommandText()
{
return "/waypoint groupremove";
}

public override string[] GetMultipleCommandText()
public override string[] GetMultipleCommandText()
{
return new string[] { "/waypoint groupremove", "/wp groupremove", "/waypoint gr", "/wp gr" };
}
Expand Down
15 changes: 7 additions & 8 deletions EssentialsPlugin/ChatHandlers/Waypoints/HandleWaypointList.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ public class HandleWaypointList : ChatHandlerBase
public override string GetHelp()
{
return "Lists all personal waypoints. Usage: /waypoint list";
}
}

public override string GetCommandText()
{
return "/waypoint list";
}

public override Communication.ServerDialogItem GetHelpDialog( )
{
Expand All @@ -23,13 +28,7 @@ public override Communication.ServerDialogItem GetHelpDialog( )
return DialogItem;
}


public override string GetCommandText()
{
return "/waypoint list";
}

public override string[] GetMultipleCommandText()
public override string[] GetMultipleCommandText()
{
return new string[] { "/waypoint list", "/wp list" };
}
Expand Down
15 changes: 7 additions & 8 deletions EssentialsPlugin/ChatHandlers/Waypoints/HandleWaypointRefresh.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,12 @@ public class HandleWaypointRefresh : ChatHandlerBase
public override string GetHelp()
{
return "Refreshes Waypoints in case your can't see them. Usage: /waypoint refresh";
}
}

public override string GetCommandText()
{
return "/waypoint refresh";
}

public override Communication.ServerDialogItem GetHelpDialog( )
{
Expand All @@ -19,13 +24,7 @@ public override Communication.ServerDialogItem GetHelpDialog( )
return DialogItem;
}


public override string GetCommandText()
{
return "/waypoint refresh";
}

public override string[] GetMultipleCommandText()
public override string[] GetMultipleCommandText()
{
return new string[] { "/waypoint refresh", "/wp refresh" };
}
Expand Down
Loading

0 comments on commit 0ffd50c

Please sign in to comment.