/// <summary> /// Initialize the node /// </summary> /// <param name="portal">access portal to the Matrix. should be stored.</param> public void Initialize(IMatrixPortal portal) { log.Info("Launching a new game server node on port "+Settings.Default.GameInterfacePort); server = MmoZmq.context.CreateSocket(ZeroMQ.SocketType.ROUTER); log.Debug(MmoEncrypt.Keys.Count+" encryption keys."); controller = portal.GetNodeProxy<IMMOCluster>(); log.Debug("Realms count: "+MmoWorld.Realms.Count); status = 1; serverTask = Task.Factory.StartNew(ServerThread); }
/// <summary> /// Initialize the node /// </summary> /// <param name="portal">access portal to the Matrix. should be stored.</param> public void Initialize(IMatrixPortal portal) { log.Info("Launching a new launcher handler node."); log.Debug("Downloading file index from s3"); using(MemoryStream ms = new MemoryStream()) { MmoAws.AmazonS3.GetObject(new GetObjectRequest() { BucketName = Settings.Default.BucketName, Key = Settings.Default.FolderName + "/index.mhash" }).ResponseStream.CopyTo(ms); ms.Position = 0; fileIndex = Serializer.Deserialize<Dictionary<string, byte[]>>(ms); } log.Debug("Binding the server to port "+Settings.Default.LauncherInterfacePort); server = MmoZmq.context.CreateSocket(SocketType.REP); status = 1; serverTask = Task.Factory.StartNew(ServerThread); }