mirror of
https://github.com/space-wizards/RobustToolbox.git
synced 2026-02-15 11:40:52 +01:00
* Refactors EntityManager to not do any networking. ServerEntityManager and ClientEntityManager now do the networking instead. * Rename property for "backwards compat." * Remove comented out code in robust server simulation
27 lines
974 B
C#
27 lines
974 B
C#
using Robust.Client.GameStates;
|
|
using Robust.Client.Player;
|
|
using Robust.Shared.GameObjects;
|
|
using Robust.Shared.IoC;
|
|
using Robust.Shared.Utility;
|
|
|
|
namespace Robust.Client.GameObjects
|
|
{
|
|
public static class EntityManagerExt
|
|
{
|
|
public static void RaisePredictiveEvent<T>(this IEntityManager entityManager, T msg)
|
|
where T : EntityEventArgs
|
|
{
|
|
var localPlayer = IoCManager.Resolve<IPlayerManager>().LocalPlayer;
|
|
DebugTools.AssertNotNull(localPlayer);
|
|
|
|
var sequence = IoCManager.Resolve<IClientGameStateManager>().SystemMessageDispatched(msg);
|
|
entityManager.EntityNetManager?.SendSystemNetworkMessage(msg, sequence);
|
|
|
|
var eventArgs = new EntitySessionEventArgs(localPlayer!.Session);
|
|
|
|
entityManager.EventBus.RaiseEvent(EventSource.Local, msg);
|
|
entityManager.EventBus.RaiseEvent(EventSource.Local, new EntitySessionMessage<T>(eventArgs, msg));
|
|
}
|
|
}
|
|
}
|