public SendQueuedMessagesSystem(Contexts contexts) { networking = contexts.networking; entities = networking.GetGroup( NetworkingMatcher.AllOf(NetworkingMatcher.OutgoingMessages, NetworkingMatcher.Connection) ); }
public ComposeInputStateUpdateMessageSystem(Contexts contexts) { networking = contexts.networking; servers = networking.GetGroup( NetworkingMatcher.AllOf(NetworkingMatcher.Server, NetworkingMatcher.OutgoingMessages) ); input = contexts.input; }
public ComposeGameStateUpdateMessageSystem(Contexts contexts) { networking = contexts.networking; game = contexts.game; entitiesToTrack = contexts.game.GetGroup(GameMatcher.ChangeFlags); clients = networking.GetGroup( NetworkingMatcher.AllOf(NetworkingMatcher.Client, NetworkingMatcher.OutgoingMessages) ); }
/// Creates an Entity to represent a connection with a client. public static NetworkingEntity CreateClientConnection(this NetworkingContext networking, int connectionId) { var e = networking.CreateEntity(); e.AddConnection(connectionId); e.AddIncomingMessages(new Queue <INetworkMessage>()); e.AddOutgoingMessages(new Queue <INetworkMessage>()); e.isClient = true; return(e); }
public Contexts() { events = new EventsContext(); game = new GameContext(); gameState = new GameStateContext(); input = new InputContext(); networking = new NetworkingContext(); var postConstructors = System.Linq.Enumerable.Where( GetType().GetMethods(), method => System.Attribute.IsDefined(method, typeof(Entitas.CodeGeneration.Attributes.PostConstructorAttribute)) ); foreach (var postConstructor in postConstructors) { postConstructor.Invoke(this, null); } }
public InitializeServerSystem(Contexts contexts) { networking = contexts.networking; }
public HandleConnectingClientsSystem(Contexts contexts) : base(contexts.networking) { networking = contexts.networking; game = contexts.game; }
public InitializeClientSystem(Contexts contexts) { networking = contexts.networking; }
public ClientReceiveSystem(Contexts contexts) { networking = contexts.networking; }
public ServerReceiveSystem(Contexts contexts) { networking = contexts.networking; }
public static NetworkingEntity GetEntityWithPlayer(this NetworkingContext context, int id) { return(((Entitas.PrimaryEntityIndex <NetworkingEntity, int>)context.GetEntityIndex(Contexts.Player)).GetEntity(id)); }
public static System.Collections.Generic.HashSet <NetworkingEntity> GetEntitiesWithOwner(this NetworkingContext context, int value) { return(((Entitas.EntityIndex <NetworkingEntity, int>)context.GetEntityIndex(Contexts.Owner)).GetEntities(value)); }