public void sendTo(IWebSocketConnection socket) { Dem2Hub.sendItTo(this, socket); if (operation == 'u' || operation == 'c') { var subs = new Subscription() { onEntityId = entity.Id }; //we presume, that the entity will be displayed at the client, so we subscribe him subs.subscribe(socket); } }
public void UnsubscribeFromEntity(Subscription subs) { ServerClientEntity ent = subs.onEntity; ent.Unsubscribe(this); }
public List<Subscription> subscriptions { get; set; } //these need to be iterated over when user disconnects and removed public void SubscribeToEntity(Subscription subs) { ServerClientEntity ent = subs.onEntity; subscriptions.Add(subs); ent.Subscribe(this); }