Logging when clients use an item on themselves or hit someone with a melee weapon
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user