コード例 #1
0
ファイル: MasterAPI.cs プロジェクト: danielaLopes/PADI
        public MasterAPI(string[] pcsUrls)
        {
            Servers         = new ConcurrentDictionary <string, IServer>();
            ServerUrls      = "";
            ServerIdsToUrls = new ConcurrentDictionary <string, string>();

            Clients = new ConcurrentDictionary <string, IClient>();

            PCSs = new ConcurrentDictionary <string, ProcessCreationService>();
            foreach (string url in pcsUrls)
            {
                PCSs.TryAdd(BaseUrlExtractor.Extract(url), (ProcessCreationService)Activator.GetObject(typeof(ProcessCreationService), url));
            }

            _startProcessDelegate = new StartProcessDelegate(StartProcess);

            _serverDelegate         = new ServerDelegate(ServerSync);
            _clientDelegate         = new ClientDelegate(ClientSync);
            _addRoomDelegate        = new AddRoomDelegate(AddRoomSync);
            _statusDelegate         = new StatusDelegate(StatusSync);
            _crashDelegate          = new CrashDelegate(CrashSync);
            _freezeDelegate         = new FreezeDelegate(FreezeSync);
            _unfreezeDelegate       = new UnfreezeDelegate(UnfreezeSync);
            _shutDownSystemDelegate = new ShutDownSystemDelegate(ShutDownSystemSync);

            _checkNodeStatusDelegate = new CheckNodeStatus(CheckNode);

            _nodesCreated = 0;
        }
コード例 #2
0
ファイル: MasterAPI.cs プロジェクト: danielaLopes/PADI
        // Debugging Commands


        // Crash server_id
        public void CrashSync(string fields)
        {
            // match right PCS
            string basePcsUrl          = BaseUrlExtractor.Extract(ServerIdsToUrls[fields]);
            ProcessCreationService pcs = PCSs[basePcsUrl];

            pcs.Crash(fields);
        }
コード例 #3
0
ファイル: MasterAPI.cs プロジェクト: danielaLopes/PADI
        public void StartProcess(string url, string fields, string exePath, string id)
        {
            // match right PCS
            string basePcsUrl          = BaseUrlExtractor.Extract(url);
            ProcessCreationService pcs = PCSs[basePcsUrl];

            pcs.Start(@exePath, fields, id);
        }