Logging when clients use an item on themselves or hit someone with a melee weapon

This commit is contained in:
Regalis
2017-04-17 19:52:25 +03:00
parent e4a7d31f78
commit 67a3020430
2 changed files with 12 additions and 1 deletions
@@ -3,6 +3,7 @@ using FarseerPhysics.Dynamics;
using FarseerPhysics.Dynamics.Contacts;
using Microsoft.Xna.Framework;
using System;
using System.Linq;
using System.Xml.Linq;
namespace Barotrauma.Items.Components
@@ -241,7 +242,15 @@ namespace Barotrauma.Items.Components
if (GameMain.Server != null)
{
GameMain.Server.CreateEntityEvent(item, new object[] { Barotrauma.Networking.NetEntityEvent.Type.ApplyStatusEffect, target.ID });
GameMain.Server.CreateEntityEvent(item, new object[] { Networking.NetEntityEvent.Type.ApplyStatusEffect, target.ID });
string logStr = picker?.Name + " used " + item.Name;
if (item.ContainedItems != null && item.ContainedItems.Length > 0)
{
logStr += "(" + string.Join(", ", item.ContainedItems.Select(i => i?.Name)) + ")";
}
logStr += " on " + target + ".";
Networking.GameServer.Log(logStr, Color.Orange);
}
ApplyStatusEffects(ActionType.OnUse, 1.0f, limb.character);
+2
View File
@@ -1869,6 +1869,8 @@ namespace Barotrauma
ApplyStatusEffects(ActionType.OnUse, (float)Timing.Step, c.Character);
GameServer.Log(c.Character.Name +" used item "+Name, Color.White);
GameMain.Server.CreateEntityEvent(this, new object[] { NetEntityEvent.Type.ApplyStatusEffect, c.Character.ID });
break;