Ejemplo n.º 1
0
        protected DesktopGameHost(string gameName = @"", bool bindIPCPort = false)
            : base(gameName)
        {
            //todo: yeah.
            Architecture.SetIncludePath();

            foreach (string a in Environment.GetCommandLineArgs())
            {
                switch (a)
                {
                case @"--reload-on-change":
                    ensureShadowCopy();
                    break;
                }
            }

            if (bindIPCPort)
            {
                ipcProvider       = new TcpIpcProvider();
                IsPrimaryInstance = ipcProvider.Bind();
                if (IsPrimaryInstance)
                {
                    ipcProvider.MessageReceived += OnMessageReceived;
                    ipcTask = Task.Factory.StartNew(ipcProvider.StartAsync, TaskCreationOptions.LongRunning);
                }
            }
        }
Ejemplo n.º 2
0
 public DesktopGameHost(string gameName = @"", bool bindIPCPort = false) : base(gameName)
 {
     if (bindIPCPort)
     {
         IpcProvider       = new TcpIpcProvider();
         IsPrimaryInstance = IpcProvider.Bind();
         if (IsPrimaryInstance)
         {
             IpcProvider.MessageReceived += msg => OnMessageReceived(msg);
             IpcTask = IpcProvider.Start();
         }
     }
 }