/*Observable Stuff*/ void IConnectionObservable.registerObserver(IConnectionObserver newObserver) { myObservers.Add(newObserver); }
void IConnectionObservable.removeObserver(IConnectionObserver newObserver) { myObservers.Remove(newObserver); }
async Task <ISceneActor> IConnection.RegisterClient(Guid clientid, Guid sceneId, IConnectionObserver client) { _logger.Info("Registering client:" + clientid); _logger.Warn("SceneId:" + sceneId); #region проверка существования сцены if (!_loadedScenes.ContainsKey(sceneId)) { _logger.Warn($"Trying to connect to scene {sceneId}, which is not loaded!"); return(null); } #endregion #region ассылка сообщения о логине _clients.Add(clientid, client); #endregion //TODO - track disconnected status //Context.Watch(Sender); return(_loadedScenes[sceneId]); }
public void AddObserver(IConnectionObserver observer) { connection.AddObserver(observer); }
public IConnection Create(ISerializer serializer, IConnectionEndPoint endpoint, Configuration configuration, IConnectionObserver connectionObserver) { var connection = _func(endpoint); var queue = CreatedConnections.GetOrAdd(endpoint.GetHostIpEndPointWithFallback(), _ => new ConcurrentQueue <IConnection>()); queue.Enqueue(connection); OnCreate?.Invoke(connection); return(connection); }
public void AddObserver(IConnectionObserver observer) { observerList.Add(observer); }
public IConnection Create( Serializer serializer, IConnectionEndPoint endPoint, Configuration configuration, IConnectionObserver connectionObserver) { return(new Connection( serializer, endPoint, configuration, new StartupRequestFactory(configuration.StartupOptionsFactory), connectionObserver)); }