public void ClusterConnect() { while (Cluster == null) { try { Cluster = ProxyClient.Create <ICluster>(m_RemoteURI); if (!Information.IsNothing(Cluster)) { WorldServerConfiguration configuration = WorldServiceLocator._ConfigurationProvider.GetConfiguration(); if (Cluster.Connect(LocalURI, configuration.Maps.Select(_Closure_0024__._0024I13_002D0 ??= x => Conversions.ToUInteger(x)).ToList())) { break; } Cluster.Disconnect(LocalURI, configuration.Maps.Select(_Closure_0024__._0024I13_002D1 ??= x => Conversions.ToUInteger(x)).ToList()); } } catch (Exception ex) { ProjectData.SetProjectError(ex); Exception e = ex; WorldServiceLocator._WorldServer.Log.WriteLine(LogType.FAILED, "Unable to connect to cluster. [{0}]", e.Message); ProjectData.ClearProjectError(); } Cluster = null; Thread.Sleep(3000); } WorldServiceLocator._WorldServer.Log.WriteLine(LogType.SUCCESS, "Contacted cluster [{0}]", m_RemoteURI); }
public void ClusterConnect() { while (Cluster == null) { try { Cluster = ProxyClient.Create <ICluster>(m_RemoteURI); if (Cluster != null) { var configuration = WorldServiceLocator._ConfigurationProvider.GetConfiguration(); if (Cluster.Connect(LocalURI, configuration.Maps.Select(x => Conversions.ToUInteger(x)).ToList())) { break; } Cluster.Disconnect(LocalURI, configuration.Maps.Select(x => Conversions.ToUInteger(x)).ToList()); } } catch (Exception ex) { var e = ex; WorldServiceLocator._WorldServer.Log.WriteLine(LogType.FAILED, "Unable to connect to cluster. [{0}]", e.Message); } Cluster = null; Thread.Sleep(3000); } WorldServiceLocator._WorldServer.Log.WriteLine(LogType.SUCCESS, "Contacted cluster [{0}]", m_RemoteURI); }
public bool Connect(string uri, List <uint> maps) { try { Disconnect(uri, maps); var worldServerInfo = new WorldInfo(); _clusterServiceLocator.WorldCluster.Log.WriteLine(LogType.INFORMATION, "Connected Map Server: {0}", uri); lock (((ICollection)Worlds).SyncRoot) { foreach (var map in maps) { // NOTE: Password protected remoting Worlds[map] = ProxyClient.Create <IWorld>(uri); WorldsInfo[map] = worldServerInfo; } } } catch (Exception ex) { _clusterServiceLocator.WorldCluster.Log.WriteLine(LogType.CRITICAL, "Unable to reverse connect. [{0}]", ex.ToString()); return(false); } return(true); }