コード例 #1
0
        public void DumpConfigHandler()
        {
            Logger.Info("Manual config dump");

            var cfgLines = GameUtility.DumpCfg();

            Logger.Debug($"CFG lines: {cfgLines.Count}");
        }
コード例 #2
0
        private void ParseBarcodeCommandResponse(string barcode, int counts)
        {
            List <string> cfgLines;

            switch (counts)
            {
            case 1:
                Logger.Info("Get new CFG");

                cfgLines = ServerUtility.GetCfg(_config.ServerUrl, barcode);
                if (cfgLines == null)
                {
                    return;
                }

                ApplyNewCfg(cfgLines);

                _status.LastBarcode = barcode;

                break;

            case 2:
                Logger.Info("Save CFG");

                if (barcode != _status.LastBarcode)
                {
                    Logger.Warn("CFG not saved for different barcode");
                    return;
                }

                cfgLines = GameUtility.DumpCfg();
                if (cfgLines == null)
                {
                    return;
                }

                ServerUtility.SaveCfg(_config.ServerUrl, barcode, cfgLines);

                break;

            default:
                return;
            }
        }