/// <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); }
public Client(LoginNode inter, IMMOCluster cluster) { controller = cluster; log = LogManager.GetLogger("CLIENT "+this.GetHashCode().ToString().Truncate(4)); clientInfo = new ClientInfo() {Id = ClientCache.RandomId()}; status = ClientStatus.NoIdentity; passwordSalt = Path.GetRandomFileName(); heartbeat.Elapsed += (sender, args) => { log.Info("Client timed out, terminating"); DisconnectClient(); }; clientInter = inter; }