public NeonConfig()
 {
     Database           = new DatabaseConfig();
     Scripts            = new ScriptConfig();
     Mqtt               = new MqttConfig();
     Plugins            = new PluginConfig();
     Tasks              = new TaskConfig();
     FileSystem         = new FileSystemConfig();
     Components         = new ComponentConfig();
     EventsDatabase     = new EventDatabaseConfig();
     IoT                = new IoTConfig();
     JwtToken           = "password";
     EnableSwagger      = true;
     DatabaseDirectory  = "Database";
     AutoLoadComponents = true;
     Home               = new HomeConfig();
 }
        public int DeleteTaskConfig(TaskConfig taskconfig)
        {
            _admin = new PetFeedEventsAdminService.PetFeedEventsAdminServiceClient();
            int rs = 0;

            try
            {
                rs = _admin.DeleteTaskConfig(taskconfig);
                _admin.Close();
                return(rs);
            }
            catch (Exception ex)
            {
                _admin.CloseCatch(ex, "DeleteTaskConfig Failed");
                return(0);
            }
        }
        public static void CleanDotNetCoreSolution(ICakeContext context, TaskConfig config)
        {
            context.LogInfo("Shutting down .NET Core build server");
            context.DotNetCoreBuildServerShutdown();

            DotNetCoreConfig cfg = config.Load <DotNetCoreConfig>();
            string           cleanProjectFile = cfg.Build.ProjectFile.Resolve();

            if (cleanProjectFile is null)
            {
                throw new TaskConfigException("Build solution or project file not specified.");
            }

            context.DotNetCoreClean(cleanProjectFile, new DotNetCoreCleanSettings
            {
                Verbosity = context.Log.Verbosity.ToVerbosity(),
            });
        }
Exemple #4
0
        /// <summary>
        /// 设置
        /// </summary>
        /// <param name="cg">字典配置</param>
        public void Set(TaskConfig cg)
        {
            if (string.IsNullOrEmpty(cg.Info.App))
            {
                cg.Info.App = "api";
            }
            cg.Info.App = cg.Info.App.ToLower();
            var app = cg.Info.App;

            if (!Dict.ContainsKey(app))
            {
                Dict.TryAdd(app, new TaskHelper(cg));
            }
            if (Dict.TryGetValue(app, out var m))
            {
                m.Set(cg);
            }
        }
Exemple #5
0
    public bool GoToMidTalk()
    {
        TaskConfig taskConfig = Globals.Instance.MDataTableManager.GetConfig <TaskConfig>();
        Dictionary <int, TaskConfig.TaskObject> taskObjectDic;

        taskConfig.GeTaskObjectList(out taskObjectDic);

        mCurTaskId = -1;
//		for(int i = 0; i < _mUnfinishList.Count; i++)
//		{
//			if(_mUnfinishList[i].IsTaskDaily)
//			{
//				break;
//			}
//
//			TaskConfig.TaskObject taskObject = taskObjectDic[_mUnfinishList[i].Task_ID];
//
//			//if(GameStatusManager.Instance.MCurrentGameStatus == GameStatusManager.Instance.MCopyStatus && Globals.Instance.MGameDataManager.MCurrentCopyData.MCopyBasicData.CopyID == taskObject.Pass_Copy_ID)
//			if(Globals.Instance.MGameDataManager.MCurrentCopyData.MCopyBasicData.CopyID == taskObject.Pass_Copy_ID)
//			{
//				if(_mUnfinishList[i].State == TALKSTATE.MIDDLE && (!_mUnfinishList[i].IsCompletedMidTalk))
//				{
//					mCurTaskId = taskObject.Task_ID;
//				}
//			}
//		}

        if (mCurTaskId == -1)
        {
            return(false);
        }

        Globals.Instance.MGUIManager.CreateWindow <GUITaskTalkView>(
            delegate(GUITaskTalkView gui)
        {
            if (gui != null)
            {
                gui.UpdateData(mCurTaskId, null);
            }
        }
            );

        return(true);
    }
Exemple #6
0
    protected override void Awake()
    {
        if (!Application.isPlaying || null == Globals.Instance.MGUIManager)
        {
            return;
        }

        base.Awake();
        base.enabled = true;

        task = Globals.Instance.MDataTableManager.GetConfig <TaskConfig>();

        mStartTime = Convert.ToDateTime(GameDefines.GameStartDateTime);

        UIEventListener.Get(BackHomeBtn.gameObject).onClick += delegate(GameObject go) {
            this.Close();
        };
        UIEventListener.Get(ZhengRongBtn.gameObject).onClick += OnClickZhengRong;
    }
Exemple #7
0
        private void btnSave_Click(object sender, EventArgs e)
        {
            TaskConfig taskConfig = new TaskConfig();

            if (!int.TryParse(txtTaskId.Text, out int Id))
            {
                MessageBox.Show("任务编码必须是数字");
                return;
            }
            if (!int.TryParse(txtTaskInterval.Text, out int Interval))
            {
                MessageBox.Show("任务频率必须是数字");
                return;
            }
            var config = Constants.config.taskConfigs.FirstOrDefault(n => n.TaskId.ToString() == txtTaskId.Text);

            taskConfig.Interval  = Interval;
            taskConfig.TaskId    = Id;
            taskConfig.TaskName  = txtTaskName.Text;
            taskConfig.TaskBz    = txtConfigBz.Text;
            taskConfig.Url       = txtUrl.Text;
            taskConfig.Method    = cmbType.SelectedIndex == 0 ? "Post" : "Get";
            taskConfig.Parameter = txtparameter.Text;
            if (IsAdd)
            {
                if (Constants.config.taskConfigs.FirstOrDefault(n => n.TaskId.ToString() == txtTaskId.Text) != null)
                {
                    MessageBox.Show("任务ID已存在");
                    return;
                }
                taskConfig.AddConfig();
            }
            else
            {
                Constants.config.taskConfigs.Remove(config);
                taskConfig.State = labState.Text;
                taskConfig.AddConfig();
            }

            Constants.config.SaveConfig();

            this.Close();
        }
Exemple #8
0
    private static bool TargetUsesInput(TaskConfig config)
    {
        if (config.Task.TargetOptions != null)
        {
            if (config.Task.TargetOptions.Any(x => x.Contains("{input}")))
            {
                return(true);
            }
        }

        if (config.Task.TargetEnv != null)
        {
            if (config.Task.TargetEnv.Values.Any(x => x.Contains("{input}")))
            {
                return(true);
            }
        }
        return(false);
    }
Exemple #9
0
    private async Task <ResultVoid <TaskConfigError> > CheckTargetExe(TaskConfig config, TaskDefinition definition)
    {
        if (config.Task.TargetExe == null)
        {
            if (definition.Features.Contains(TaskFeature.TargetExe))
            {
                return(ResultVoid <TaskConfigError> .Error(new TaskConfigError("missing target_exe")));
            }

            if (definition.Features.Contains(TaskFeature.TargetExeOptional))
            {
                return(ResultVoid <TaskConfigError> .Ok());
            }
            return(ResultVoid <TaskConfigError> .Ok());
        }

        // User-submitted paths must be relative to the setup directory that contains them.
        // They also must be normalized, and exclude special filesystem path elements.
        //
        // For example, accessing the blob store path "./foo" generates an exception, but
        // "foo" and "foo/bar" do not.

        if (!IsValidBlobName(config.Task.TargetExe))
        {
            return(ResultVoid <TaskConfigError> .Error(new TaskConfigError("target_exe must be a canonicalized relative path")));
        }


        var container = config.Containers !.FirstOrDefault(x => x.Type == ContainerType.Setup);

        if (container != null)
        {
            if (!await _containers.BlobExists(container.Name, config.Task.TargetExe, StorageType.Corpus))
            {
                var err =
                    $"target_exe `{config.Task.TargetExe}` does not exist in the setup container `{container.Name}`";

                _logTracer.Warning(err);
            }
        }

        return(ResultVoid <TaskConfigError> .Ok());
    }
Exemple #10
0
        /// <summary>
        /// Serializes the specified task to disk for running after scripts are reloaded.
        /// </summary>
        public static void RunTask(PostBuildTask task)
        {
            if (File.Exists(PostBuildTaskConfigFilePath))
            {
                Debug.LogWarningFormat(
                    "Creating a new post-build task when one already exists: {0}", PostBuildTaskConfigFilePath);
            }

            var taskFilePath = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName());
            var taskConfig   = new TaskConfig {
                taskFilePath = taskFilePath, taskTypeName = task.GetType().FullName
            };

            SerializeToJson(taskFilePath, task);
            SerializeToJson(PostBuildTaskConfigFilePath, taskConfig);

            _progress = 0.0f;
            // We don't unsubscribe from updates (except when canceling) because script reload will reset everything.
            EditorApplication.update += HandleUpdate;
        }
Exemple #11
0
 private ProcessTask GetProcessTask(TaskConfig config)
 {
     if (!processTasks.TryGetValue(config.Name, out var processTask))
     {
         processTask = new ProcessTask
         {
             Processor = ProviderManager.Instance.GetRequestProcessor <IRequestProcessor>(this.config, config.Source.Type),
             Transport = ProviderManager.Instance.GetRequestTransport <IRequestTransport>(this.config, config, config.Transport.Type)
         };
         processTask.Processor.Setup(config);
         processTask.Transport.Progress += OnProgress;
         processTask.Processor.Progress += OnProgress;
         if (config.Source.HistoryStrategy.Type == HistoryStrategyType.PeriodicDelete)
         {
             processTask.HistoryTimer = new Timer(x => ProcessHistory(processTask.Processor), null, TimeSpan.Zero, TimeSpan.FromSeconds(config.Source.HistoryStrategy.IntervalInSecond));
         }
         processTasks.TryAdd(config.Name, processTask);
     }
     return(processTask);
 }
Exemple #12
0
        /// <summary>
        /// Gets the configuration of the task.
        /// </summary>
        //public TaskConfig Configuration
        //{
        //    get
        //    {
        //        if (m_Config == null)
        //        {
        //            m_Config = ServiceHost.GetActivityConfiguration(String.Empty, this.GetType()) as TaskConfig;
        //            //if (m_Config == null)
        //            //    throw new InvalidOperationException(String.Format("Task '{0}' has no defined configuration of type 'TaskConfig'. Found config entry with type '{1}'", this.GetType().Name, m_Config.GetType().Name));

        //            return m_Config;
        //        }

        //        return m_Config;
        //    }
        //}

        /// <summary>
        /// Get configuration for Task in specified orchestrationName
        /// </summary>
        /// <param name="orchestrationName"></param>
        /// <returns></returns>
        public TaskConfig GetConfiguration(object orchestrationName)
        {
            string name = orchestrationName.ToString();

            if (m_Config == null)
            {
                m_Config = ServiceHost.GetActivityConfiguration(name, this.GetType()) as TaskConfig;
                //if (m_Config == null)
                //    throw new InvalidOperationException(String.Format("Task '{0}' has no defined configuration of type 'TaskConfig'. Found config entry with type '{1}'", this.GetType().Name, m_Config.GetType().Name));

                // if still null, set to empty instance of TaskConfig
                if (m_Config == null)
                {
                    m_Config = new TaskConfig();
                }

                return(m_Config);
            }

            return(m_Config);
        }
    public void UpdateData(int taskid, TalkCallBackDelegate talkCallBackDelegate)
    {
        ResetData();

        TaskConfig taskConfig = Globals.Instance.MDataTableManager.GetConfig <TaskConfig>();
        Dictionary <int, TaskConfig.TaskObject> taskObjectDic;

        taskConfig.GeTaskObjectList(out taskObjectDic);

        CurTask = taskObjectDic[taskid];

        for (int i = 0; i < Globals.Instance.MTaskManager._mUnfinishList.Count; i++)
        {
            if (taskid == Globals.Instance.MTaskManager._mUnfinishList[i].Task_ID)
            {
                CurState = Globals.Instance.MTaskManager._mUnfinishList[i].State;
            }
        }

        int talkid = CurTask.Task_Talk_ID;


        Globals.Instance.M3DItemManager.EZ3DItemParent.localScale = Vector3.zero;

        mTalkCallBackDelegate = talkCallBackDelegate;

        if (taskTalksIDDic.ContainsKey(talkid))
        {
            talkList = taskTalksIDDic[talkid];

            SetText(talkList[curIndex]);

            //TalkAniIn();

            if (GameStatusManager.Instance.MGameState == GameState.GAME_STATE_COPY)
            {
                GameStatusManager.Instance.MCurrentGameStatus.Pause();
            }
        }
    }
Exemple #14
0
        public Result Add([FromForm] int taskId, [FromForm] string key, [FromForm] string value)
        {
            if (!GetAccess(User.Id, taskId, HandleAccess.HandleConfig))
            {
                return(Fail("您还未拥有权限操作"));
            }

            if (key == null || value == null)
            {
                return(Fail("添加配置失败,Key和Value都不能为空"));
            }

            var task = _manager.GetTasks(n => n.Id == taskId).FirstOrDefault();

            if (task == null)
            {
                return(Fail("添加配置失败,不存在任务"));
            }

            try
            {
                if (_repository.Exists(n => n.TaskId == taskId && n.Key == key))
                {
                    return(Fail("添加配置失败,存在重复的Key"));
                }
                var config = new TaskConfig {
                    Key = key, TaskId = taskId, Value = value
                };
                if (_repository.Insert(config) <= 0)
                {
                    return(Fail("添加配置失败,添加数据失败"));
                }
                return(Success(config));
            }
            catch (Exception ex)
            {
                _logger.LogError(ex.Message + ex.StackTrace);
                return(Fail("系统错误"));
            }
        }
        public static void BuildDotNetCoreSolution(ICakeContext context, TaskConfig config)
        {
            DotNetCoreConfig.BuildConfig build = config.Load <DotNetCoreConfig>().Build;

            string buildProjectFile = build.ProjectFile;

            if (buildProjectFile is null)
            {
                throw new TaskConfigException("Build solution or project file not specified.");
            }

            EnvConfig env = config.Load <EnvConfig>();

            string outputDirectory = Path.Combine(env.Directories.BinaryOutput, "__build");

            context.DotNetCoreBuild(buildProjectFile, new DotNetCoreBuildSettings
            {
                OutputDirectory = outputDirectory,
                Configuration   = env.Configuration,
                Verbosity       = context.Log.Verbosity.ToVerbosity(),
            });
        }
        /// <summary>
        /// 设置需配置的任务周期对象。
        /// </summary>
        /// <param name="taskPeriod">任务周期。</param>
        /// <param name="currentTaskConfig">设置周期时所配置的任务配置对象。</param>
        public void SetTaskPeriod(TaskPeriod taskPeriod, TaskConfig currentTaskConfig)
        {
            this.m_TaskPeriod = taskPeriod as PredecessorTaskPeriod;

            foreach (TaskConfig _TaskConfig in currentTaskConfig.Group.TaskConfigs)
            {
                if (_TaskConfig.Equals(currentTaskConfig) == false)
                {
                    this.cmbTask.Items.Add(_TaskConfig);

                    if (this.m_TaskPeriod.PredecessorTask != null && this.m_TaskPeriod.PredecessorTask.Equals(_TaskConfig))
                    {
                        this.cmbTask.SelectedIndex = this.cmbTask.Items.Count - 1;
                    }
                }
            }

            if (this.cmbTask.SelectedIndex == -1 && this.cmbTask.Items.Count > 0)
            {
                this.cmbTask.SelectedIndex = 0;
            }
        }
        public static void ConfigureGitVersion(ICakeContext ctx, TaskConfig cfg)
        {
            // Update the GitVersion config
            GitVersionConfig gitVersion = cfg.Load <GitVersionConfig>();

            Common.Tools.GitVersion.GitVersion version = ctx.GitVersion();
            gitVersion.Version = version;

            EnvConfig env = cfg.Load <EnvConfig>();

            // Update branch name
            env.Branch = version.BranchName;

            // Update primary and full versions
            env.Version.Primary = version.MajorMinorPatch;
            env.Version.Full    = version.SemVer;

            // Update build number
            env.Version.BuildNumber = version.CommitsSinceVersionSource.HasValue
                ? version.CommitsSinceVersionSource.Value.ToString()
                : version.BuildMetaData;
        }
Exemple #18
0
    public bool InitTaskData(PCondition[] condition = null)
    {
        TaskConfig taskconfig = ConfigManager.Get <TaskConfig>(m_taskID);

        if (taskconfig == null)
        {
            Logger.LogError("The taskid:{0} configuration information does not exist on the client.", m_taskID);
            return(false);
        }
        this.taskConditionType = taskconfig.taskFinishType;
        this.taskFinished      = taskconfig.taskFinishType == EnumTaskConditionType.FinishAll ? true : false;
        this.taskTargetID      = (NpcTypeID)taskconfig.targetID;
        this.taskType          = taskconfig.taskType;
        this.taskNameID        = taskconfig.taskNameID;
        this.taskIconID        = taskconfig.taskIconID;
        this.taskPressIcon     = taskconfig.taskPressIcon;
        this.taskDescID        = taskconfig.taskDescID;
        this.taskBelongScene   = taskconfig.markSceneID;
        for (int m = 0; m < taskconfig.taskFinishConditions.Length; m++)
        {
            taskconfig.taskFinishConditions[m].progress = 0;
            this.AddCondition(taskconfig.taskFinishConditions[m]);
        }
        if (condition != null)
        {
            if (!SetConditionValue(condition))
            {
                Logger.LogError("The taskid:{0}  The client configuration Condition Not Equal Server Condition.", m_taskID);
                return(false);
            }
        }
        m_taskSM = new TaskStateManger();
        m_taskSM.Region("Begin", new BeginTaskState(m_taskSM, this));
        m_taskSM.Region("Run", new RunningTaskState(m_taskSM, this));
        m_taskSM.Region("PreFinish", new PreFinishTaskState(m_taskSM, this));
        m_taskSM.Region("Finish", new FinishTaskState(m_taskSM, this));
        return(true);
    }
    public override void InitializeGUI()
    {
        if (_mIsLoaded)
        {
            return;
        }
        _mIsLoaded = true;

        this.GUILevel = 8;

        mCacheList = new List <int>();
        if (TaskManager.GameEndingList.Count > 0)
        {
            foreach (int id in TaskManager.GameEndingList)
            {
                mCacheList.Add(id);
            }
        }

        taskConfig = Globals.Instance.MDataTableManager.GetConfig <TaskConfig>();
        Globals.Instance.MSceneManager.ChangeCameraActiveState(SceneManager.CameraActiveState.TASKCAMERA);
        ShowMemoryInfor();
    }
Exemple #20
0
        private void _runner(object sender)
        {
            int index   = (int)(sender);
            var comm    = new ClientComm(clientConfig.url);
            var runFunc = new RunFunc(index);

            runFunc.SetUI(setRichText);
            runFunc.SetIO(comList[index]);
            comm.send("get", MainForm.clientConfig.program);
            string json = comm.recv();

            Console.WriteLine(json);
            TaskConfig task = JsonConvert.DeserializeObject <TaskConfig>(json);

            initComPort(index);
            foreach (Logic logic in task.logic_list)
            {
                MethodInfo logicFunc = runFunc.GetType().GetMethod(logic.func);
                if (!(bool)(logicFunc.Invoke(runFunc, new object[] { logic })))
                {
                    break;
                }
            }
        }
Exemple #21
0
 public AzureServiceBusTransportRequest(TaskConfig config)
 {
     this.config = config;
 }
    private float radius; // set from main menu slider

    /* Use this for initialization */
    void Start()
    {
        // Position camera
        camera = GameObject.Find("MixedRealityCameraParent");
        camera.transform.position = new Vector3(0.0f, 0.0f, -2.75f);

        // Create unique out file
        fileName = fileName + System.DateTime.Now + ".txt";
        fileName = fileName.Replace("/", "-");
        fileName = fileName.Replace(":", ";");
        path     = Path.Combine(Application.persistentDataPath, fileName);
        //Test outfile
        //File.WriteAllText(@path, "trace");

        // Write task set up to results file
        // Error : R, 1, 3, 5
        // # Trials : 1, 2, 3
        config = GameObject.Find("TaskConfig").GetComponent <TaskConfig>();
        //UnityEngine.Debug.Log("pointing_error: " + config.pointing_error);
        //UnityEngine.Debug.Log("number_of_trials: " + config.number_of_trials);
        File.AppendAllText(@path, "Trials  : " + config.number_of_trials);
        File.AppendAllText(@path, "\r\n");
        File.AppendAllText(@path, "Error   : " + config.pointing_error);
        File.AppendAllText(@path, "\r\n");

        // convert # trials from string to int
        //TODO change to generic trials?
        switch (config.number_of_trials)
        {
        case "1":
            total_trials = 1;
            break;

        case "2":
            total_trials = 2;
            break;

        case "3":
            total_trials = 3;
            break;

        default:
            //
            break;
        }

        // set radius from main menu preset
        radius = config.sliderValueMainMenu_SphereCollectionSize;

        // move counter and sliders depending on how large the radius is
        counter_label  = GameObject.Find("counter label");
        slider_manager = GameObject.Find("Slider_Manager");

        if (radius >= 0.75)
        {
            counter_label.transform.position  = new Vector3(1.415f, 0.6f, 0f);
            slider_manager.transform.position = new Vector3(2.4f, 0.35f, 0f);

            CoOrds counter_1 = new CoOrds(0.71f + 0.6f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_1);
            CoOrds counter_2 = new CoOrds(0.81f + 0.6f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_2);
            CoOrds counter_3 = new CoOrds(0.91f + 0.6f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_3);
        }
        else if (radius >= 0.70f)
        {
            counter_label.transform.position  = new Vector3(1.265f, 0.6f, 0f);
            slider_manager.transform.position = new Vector3(2.25f, 0.35f, 0f);

            CoOrds counter_1 = new CoOrds(0.71f + 0.45f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_1);
            CoOrds counter_2 = new CoOrds(0.81f + 0.45f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_2);
            CoOrds counter_3 = new CoOrds(0.91f + 0.45f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_3);
        }
        else if (radius >= 0.65)
        {
            counter_label.transform.position  = new Vector3(1.115f, 0.6f, 0f);
            slider_manager.transform.position = new Vector3(2.1f, 0.35f, 0f);

            CoOrds counter_1 = new CoOrds(0.71f + 0.3f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_1);
            CoOrds counter_2 = new CoOrds(0.81f + 0.3f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_2);
            CoOrds counter_3 = new CoOrds(0.91f + 0.3f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_3);
        }
        else
        {
            CoOrds counter_1 = new CoOrds(0.71f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_1);
            CoOrds counter_2 = new CoOrds(0.81f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_2);
            CoOrds counter_3 = new CoOrds(0.91f, 0.5f, 0.0f, null);
            counter_collection.Add(counter_3);
        }

        /* Generate */
        initializeCoordinates(ref order, ref coOrds_collection, ref coOrds_collection_2);

        /* Call function once on startup to create initial hotspot */
        HotSpotTriggerInstantiate();
    }
Exemple #23
0
        protected override async void Run(Session session, C2G_LoginGate message, Action <G2C_LoginGate> reply)
        {
            G2C_LoginGate response = new G2C_LoginGate();

            try
            {
                long userId = Game.Scene.GetComponent <NjmjGateSessionKeyComponent>().Get(message.Key);
                if (userId == 0)
                {
                    response.Error   = ErrorCode.ERR_ConnectGateKeyError;
                    response.Message = "Gate key验证失败!";
                    reply(response);
                    return;
                }

                // 检测是否已存在
                UserComponentSystem.CheckIsExistTheUser(userId);

                //创建User对象
                User user = UserFactory.Create(userId, session);
                await user.AddComponent <MailBoxComponent>().AddLocation();

                //添加心跳包
                session.AddComponent <HeartBeatComponent>().CurrentTime = TimeHelper.ClientNowSeconds();
                //添加User对象关联到Session上
                session.AddComponent <SessionUserComponent>().User = user;

                //添加消息转发组件
                session.AddComponent <MailBoxComponent, string>(ActorType.GateSession);

                response.PlayerId = user.Id;
                response.Uid      = userId;

                ConfigComponent  configCom      = Game.Scene.GetComponent <ConfigComponent>();
                DBProxyComponent proxyComponent = Game.Scene.GetComponent <DBProxyComponent>();

                {
                    //商城
                    if (ShopData.getInstance().getDataList().Count == 0)
                    {
                        List <ShopConfig> shopList = new List <ShopConfig>();
                        for (int i = 1; i < configCom.GetAll(typeof(ShopConfig)).Length + 1; ++i)
                        {
                            int        id     = 1000 + i;
                            ShopConfig config = (ShopConfig)configCom.Get(typeof(ShopConfig), id);
                            shopList.Add(config);
                        }
                        ShopData.getInstance().getDataList().AddRange(shopList);
                    }

                    //#region AddShopInfo
                    List <ShopInfo> shopInfoList = new List <ShopInfo>();
                    for (int i = 0; i < ShopData.getInstance().getDataList().Count; ++i)
                    {
                        ShopConfig config = ShopData.getInstance().getDataList()[i];
                        ShopInfo   info   = new ShopInfo();
                        info.Id           = (int)config.Id;
                        info.Name         = config.Name;
                        info.Price        = config.Price;
                        info.ShopType     = config.shopType;
                        info.Desc         = config.Desc;
                        info.CurrencyType = config.CurrencyType;
                        info.Items        = config.Items;
                        info.Icon         = config.Icon;
                        info.VipPrice     = config.VipPrice;
                        shopInfoList.Add(info);
                    }
                    response.ShopInfoList = shopInfoList;
                }
                {
                    //任务
                    if (TaskData.getInstance().getDataList().Count == 0)
                    {
                        List <TaskConfig> taskList = new List <TaskConfig>();
                        for (int i = 1; i < configCom.GetAll(typeof(TaskConfig)).Length + 1; ++i)
                        {
                            int        id     = 100 + i;
                            TaskConfig config = (TaskConfig)configCom.Get(typeof(TaskConfig), id);
                            taskList.Add(config);
                        }
                        TaskData.getInstance().getDataList().AddRange(taskList);
                    }
                }

                {
                    //成就
                    if (ChengjiuData.getInstance().getDataList().Count == 0)
                    {
                        List <ChengjiuConfig> chengjiuList = new List <ChengjiuConfig>();
                        for (int i = 1; i < configCom.GetAll(typeof(ChengjiuConfig)).Length + 1; ++i)
                        {
                            int            id     = 100 + i;
                            ChengjiuConfig config = (ChengjiuConfig)configCom.Get(typeof(ChengjiuConfig), id);
                            chengjiuList.Add(config);
                        }
                        ChengjiuData.getInstance().getDataList().AddRange(chengjiuList);
                    }
                }

                List <UserBag> bagInfoList = await proxyComponent.QueryJson <UserBag>($"{{UId:{userId}}}");

                response.BagList = new List <Bag>();
                List <Bag> bagList = new List <Bag>();
                for (int i = 0; i < bagInfoList.Count; ++i)
                {
                    Bag bag = new Bag();
                    bag.ItemId = bagInfoList[i].BagId;
                    bag.Count  = bagInfoList[i].Count;
                    bagList.Add(bag);
                }
                response.BagList = bagList;

                PlayerBaseInfo playerBaseInfo = await DBCommonUtil.getPlayerBaseInfo(userId);

                // 老用户检测
                {
                    try
                    {
                        AccountInfo accountInfo = await DBCommonUtil.getAccountInfo(userId);

                        if (accountInfo.OldAccountState == 1)
                        {
                            string url = "http://fksq.hy51v.com:10086/CheckIsOldUser?machine_id=" + accountInfo.MachineId + "&game_id=217";
                            string str = HttpUtil.GetHttp(url);
                            Log.Debug("web地址:" + url);
                            Log.Debug("判断是否是老用户:" + str);

                            JObject result  = JObject.Parse(str);
                            string  old_uid = (string)result.GetValue("old_uid");

                            // 不是老用户
                            if (string.IsNullOrEmpty(old_uid))
                            {
                                accountInfo.OldAccountState = 3;
                                await proxyComponent.Save(accountInfo);
                            }
                            // 是老用户
                            else
                            {
                                List <Log_OldUserBind> log_OldUserBinds = await proxyComponent.QueryJson <Log_OldUserBind>($"{{macId:'{accountInfo.MachineId}'}}");

                                if (log_OldUserBinds.Count > 0)
                                {
                                    accountInfo.OldAccountState = 3;
                                    await proxyComponent.Save(accountInfo);
                                }
                                else
                                {
                                    accountInfo.OldAccountState = 2;
                                    await proxyComponent.Save(accountInfo);

                                    // 记录绑定日志
                                    {
                                        Log_OldUserBind log_OldUserBind = ComponentFactory.CreateWithId <Log_OldUserBind>(IdGenerater.GenerateId());
                                        log_OldUserBind.Uid          = userId;
                                        log_OldUserBind.OldUid       = old_uid;
                                        log_OldUserBind.macId        = accountInfo.MachineId;
                                        log_OldUserBind.isSendReward = 1;

                                        await proxyComponent.Save(log_OldUserBind);
                                    }

                                    {
                                        url = ("http://fksq.hy51v.com:10086/GetOldNjmjData?UserId=" + old_uid);
                                        str = HttpUtil.GetHttp(url);

                                        result = JObject.Parse(str);
                                        int moneyAmount  = (int)result.GetValue("moneyAmount");
                                        int gIngotAmount = (int)result.GetValue("gIngotAmount");

                                        Log.Debug("老用户金币=" + moneyAmount + "   元宝=" + gIngotAmount);

                                        playerBaseInfo.GoldNum = moneyAmount;
                                        playerBaseInfo.WingNum = gIngotAmount;
                                        await proxyComponent.Save(playerBaseInfo);

                                        await DBCommonUtil.changeWealthWithStr(userId, "111:10;2:10", "老用户赠送");
                                    }

                                    // 发送老用户广播
                                    Actor_OldUser actor_OldUser = new Actor_OldUser();
                                    actor_OldUser.OldAccount = old_uid;
                                    Game.Scene.GetComponent <UserComponent>().BroadCastToSingle(actor_OldUser, userId);
                                }
                            }
                        }
                        else if (accountInfo.OldAccountState == 2)
                        {
                            List <Log_OldUserBind> log_OldUserBinds = await proxyComponent.QueryJson <Log_OldUserBind>($"{{macId:'{accountInfo.MachineId}'}}");

                            if (log_OldUserBinds.Count > 0)
                            {
                                if (log_OldUserBinds[0].isSendReward != 1)
                                {
                                    log_OldUserBinds[0].isSendReward = 1;
                                    await proxyComponent.Save(log_OldUserBinds[0]);

                                    await DBCommonUtil.SendMail(userId, "更新游戏奖励", "亲爱的玩家,南京麻将最新版本更新了,特意送上更新奖励,请笑纳,祝您游戏愉快!", "111:10;2:10");
                                }
                            }
                        }
                    }
                    catch (Exception ex)
                    {
                        Log.Error("检测是否是老用户出错:" + ex);
                    }
                }

                #region 用户活动所获得的头像数据
                List <OtherData> otherDatas = await proxyComponent.QueryJson <OtherData>($"{{UId:{userId}}}");

                if (otherDatas.Count > 0)
                {
                    response.ownIcon = otherDatas[0].OwnIcon;
                }
                #endregion

                reply(response);
                session.Send(new G2C_TestHotfixMessage()
                {
                    Info = "recv hotfix message success"
                });

                // vip上线全服广播
                {
                    if (playerBaseInfo.VipTime.CompareTo(CommonUtil.getCurTimeNormalFormat()) > 0)
                    {
                        Actor_LaBa actor_LaBa = new Actor_LaBa();
                        actor_LaBa.LaBaContent = "贵族玩家" + playerBaseInfo.Name + "上线啦!";
                        Game.Scene.GetComponent <UserComponent>().BroadCast(actor_LaBa);
                    }
                }
            }
            catch (Exception e)
            {
                ReplyError(response, e, reply);
            }
        }
Exemple #24
0
 public AzureServiceBusTransportSync(TaskConfig config)
 {
     this.config = config;
 }
Exemple #25
0
 public T GetSyncTransport <T>(SyncConfig config, TaskConfig taskConfig, string typeName) => GetProvivder <T>(config.Providers.Sync.Transport, typeName, taskConfig);
 public Task(TaskConfig config){}
Exemple #27
0
 public GitVersionConfig(TaskConfig taskConfig)
     : base(taskConfig)
 {
 }
Exemple #28
0
 /// <summary>
 /// Begins to clear the content of the specified <paramref name="bitmapData"/> and fills it with the specified <paramref name="color"/> asynchronously.
 /// <br/>This method is similar to <see cref="Graphics.Clear">Graphics.Clear</see> except that this one supports any <see cref="PixelFormat"/> and also dithering.
 /// </summary>
 /// <param name="bitmapData">The <see cref="IWritableBitmapData"/> to be cleared.</param>
 /// <param name="color">A <see cref="Color32"/> that represents the desired result color of the <paramref name="bitmapData"/>.
 /// If it has transparency, which is not supported by <see cref="IBitmapData.PixelFormat"/> of <paramref name="bitmapData"/>, then the result might be either
 /// completely transparent (depends also on <see cref="IBitmapData.AlphaThreshold"/>), or the color will be blended with <see cref="IBitmapData.BackColor"/>.
 /// </param>
 /// <param name="ditherer">The ditherer to be used for the clearing. Has no effect if <see cref="IBitmapData.PixelFormat"/> of <paramref name="bitmapData"/> has at least 24 bits-per-pixel size. This parameter is optional.
 /// <br/>Default value: <see langword="null"/>.</param>
 /// <param name="asyncConfig">The configuration of the asynchronous operation such as parallelization, cancellation, reporting progress, etc. This parameter is optional.
 /// <br/>Default value: <see langword="null"/>.</param>
 /// <returns>A <see cref="Task"/> that represents the asynchronous operation, which could still be pending.</returns>
 /// <remarks>
 /// <para>This method is not a blocking call even if the <see cref="AsyncConfigBase.MaxDegreeOfParallelism"/> property of the <paramref name="asyncConfig"/> parameter is 1.</para>
 /// </remarks>
 public static Task ClearAsync(this IWritableBitmapData bitmapData, Color32 color, IDitherer ditherer = null, TaskConfig asyncConfig = null)
 {
     if (bitmapData == null)
         throw new ArgumentNullException(nameof(bitmapData), PublicResources.ArgumentNull);
     return AsyncContext.DoOperationAsync(ctx => DoClear(ctx, bitmapData, color, ditherer), asyncConfig);
 }
Exemple #29
0
        /// <summary>
        /// 设置需配置的任务周期对象。
        /// </summary>
        /// <param name="taskPeriod">任务周期。</param>
        /// <param name="currentTaskConfig">设置周期时所配置的任务配置对象。</param>
        public void SetTaskPeriod(TaskPeriod taskPeriod, TaskConfig currentTaskConfig)
        {
            this.m_TaskPeriod = taskPeriod as DayTaskPeriod;

            this.tlpPeriod = new System.Windows.Forms.TableLayoutPanel();
            this.labDay    = new System.Windows.Forms.Label();
            this.numHour   = new System.Windows.Forms.NumericUpDown();
            this.labHour   = new System.Windows.Forms.Label();
            this.numMinute = new System.Windows.Forms.NumericUpDown();
            this.labMinute = new System.Windows.Forms.Label();

            this.tlpPeriod.ColumnCount = 6;
            this.tlpPeriod.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tlpPeriod.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tlpPeriod.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tlpPeriod.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tlpPeriod.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle());
            this.tlpPeriod.ColumnStyles.Add(new System.Windows.Forms.ColumnStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tlpPeriod.Controls.Add(this.labDay, 0, 0);
            this.tlpPeriod.Controls.Add(this.numHour, 1, 0);
            this.tlpPeriod.Controls.Add(this.labHour, 2, 0);
            this.tlpPeriod.Controls.Add(this.numMinute, 3, 0);
            this.tlpPeriod.Controls.Add(this.labMinute, 4, 0);
            this.tlpPeriod.Dock     = System.Windows.Forms.DockStyle.Top;
            this.tlpPeriod.Location = new System.Drawing.Point(0, 0);
            this.tlpPeriod.RowCount = 1;
            this.tlpPeriod.RowStyles.Add(new System.Windows.Forms.RowStyle(System.Windows.Forms.SizeType.Percent, 100F));
            this.tlpPeriod.Size     = new System.Drawing.Size(554, 25);
            this.tlpPeriod.TabIndex = 0;

            this.labDay.AutoSize  = true;
            this.labDay.Dock      = System.Windows.Forms.DockStyle.Fill;
            this.labDay.Location  = new System.Drawing.Point(3, 0);
            this.labDay.Size      = new System.Drawing.Size(29, 25);
            this.labDay.TabIndex  = 0;
            this.labDay.Text      = "每天";
            this.labDay.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;

            this.numHour.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.numHour.Location = new System.Drawing.Point(38, 3);
            this.numHour.Maximum  = new decimal(new int[] { 23, 0, 0, 0 });
            this.numHour.Size     = new System.Drawing.Size(50, 21);
            this.numHour.TabIndex = 1;

            this.labHour.AutoSize  = true;
            this.labHour.Dock      = System.Windows.Forms.DockStyle.Fill;
            this.labHour.Location  = new System.Drawing.Point(94, 0);
            this.labHour.Size      = new System.Drawing.Size(17, 25);
            this.labHour.TabIndex  = 2;
            this.labHour.Text      = "时";
            this.labHour.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;

            this.numMinute.Dock     = System.Windows.Forms.DockStyle.Fill;
            this.numMinute.Location = new System.Drawing.Point(117, 3);
            this.numMinute.Maximum  = new decimal(new int[] { 59, 0, 0, 0 });
            this.numMinute.Size     = new System.Drawing.Size(50, 21);
            this.numMinute.TabIndex = 3;

            this.labMinute.AutoSize  = true;
            this.labMinute.Dock      = System.Windows.Forms.DockStyle.Fill;
            this.labMinute.Location  = new System.Drawing.Point(173, 0);
            this.labMinute.Size      = new System.Drawing.Size(65, 25);
            this.labMinute.TabIndex  = 4;
            this.labMinute.Text      = "分开始执行";
            this.labMinute.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;

            this.Controls.Add(this.tlpPeriod);

            this.numHour.Value   = this.m_TaskPeriod.TimeNum / 10000;
            this.numMinute.Value = (this.m_TaskPeriod.TimeNum / 100) % 100;
        }
Exemple #30
0
 public void reloadConfig()
 {
     config = TaskConfig.get(id);
 }
Exemple #31
0
 public IEnumerable <string>?GetInputContainerQueues(TaskConfig config)
 {
     throw new NotImplementedException();
 }