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

Commit

Permalink
Merge pull request #20 from 88tom/master
Browse files Browse the repository at this point in the history
fix admin delete inactive messages and scan inactive message
  • Loading branch information
rexxar-tc committed Dec 2, 2015
2 parents c9a2dc5 + 4ebd557 commit 8d0a19b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace EssentialsPlugin.ChatHandlers.AdminDelete
namespace EssentialsPlugin.ChatHandlers.AdminDelete
{
using System;
using System.Collections.Generic;
Expand Down Expand Up @@ -91,7 +91,7 @@ public override bool HandleCommand(ulong userId, string[] words)
if (entity.DisplayName.Contains("CommRelay"))
continue;

IMyCubeGrid grid = (IMyCubeGrid)entity;
IMyCubeGrid grid = (IMyCubeGrid)entity;
CubeGridEntity gridEntity = (CubeGridEntity)GameEntityManager.GetEntity(grid.EntityId);
MyObjectBuilder_CubeGrid gridBuilder = CubeGrids.SafeGetObjectBuilder(grid);
if (gridBuilder == null)
Expand All @@ -103,7 +103,7 @@ public override bool HandleCommand(ulong userId, string[] words)

if (CubeGrids.GetAllOwners(gridBuilder).Count < 1 && removeOwnerless)
{
Communication.SendPrivateInformation(userId, string.Format("Found entity '{0}' ({1}) not owned by anyone.", gridEntity.Name, entity.EntityId));
Communication.SendPrivateInformation(userId, string.Format("Found entity '{0}' ({1}) not owned by anyone.", entity.DisplayName, entity.EntityId));
entitiesFound.Add(entity);
continue;
}
Expand All @@ -117,23 +117,23 @@ public override bool HandleCommand(ulong userId, string[] words)
MyObjectBuilder_Checkpoint.PlayerItem checkItem = PlayerMap.Instance.GetPlayerItemFromPlayerId(player);
if (checkItem.IsDead || checkItem.Name == "")
{
Communication.SendPrivateInformation(userId, string.Format("Found entity '{0}' ({1}) owned by dead player - ID: {2}", gridEntity.Name, entity.EntityId, player));
Communication.SendPrivateInformation(userId, string.Format("Found entity '{0}' ({1}) owned by dead player - ID: {2}", entity.DisplayName, entity.EntityId, player));
entitiesFound.Add(entity);
continue;
}

PlayerItem item = Players.Instance.GetPlayerById(player);
if (item == null)
if (item == null)
{
if (removeNoLoginInformation)
{
Communication.SendPrivateInformation(userId, string.Format("Found entity '{0}' ({1}) owned by a player with no login info: {2}", gridEntity.Name, entity.EntityId, checkItem.Name));
Communication.SendPrivateInformation(userId, string.Format("Found entity '{0}' ({1}) owned by a player with no login info: {2}", entity.DisplayName, entity.EntityId, checkItem.Name));
entitiesFound.Add(entity);
}
}
else if (item.LastLogin < DateTime.Now.AddDays(days * -1))
{
Communication.SendPrivateInformation(userId, string.Format("Found entity '{0}' ({1}) owned by inactive player: {2}", gridEntity.Name, entity.EntityId, PlayerMap.Instance.GetPlayerItemFromPlayerId(player).Name));
Communication.SendPrivateInformation(userId, string.Format("Found entity '{0}' ({1}) owned by inactive player: {2}", entity.DisplayName, entity.EntityId, PlayerMap.Instance.GetPlayerItemFromPlayerId(player).Name));
entitiesFound.Add(entity);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ public override bool HandleCommand(ulong userId, string[] words)
{
if (removeNoLoginInformation)
{
Communication.SendPrivateInformation(userId, string.Format("Found entity owned by a player with no login info: {2}", entity.DisplayName, entity.EntityId, checkItem.Name));
Communication.SendPrivateInformation(userId, string.Format("Found entity '{0}' ({1}) owned by a player with no login info: {2}", entity.DisplayName, entity.EntityId, checkItem.Name));
entitiesFound.Add(entity);
}
}
Expand Down

0 comments on commit 8d0a19b

Please sign in to comment.