Exemple #1
0
 //更新任务进度
 public void UpdateTaskDB(TaskDB taskDB)
 {
     Dictionary<byte, object> parameters = new Dictionary<byte, object>();
     taskDB.Role = null;
     ParameterTool.AddParameter(parameters, ParameterCode.TaskDB, taskDB);
     PhotonEngine.Instance.SendRequest(OpCode, SubCode.UpdateTaskDB, parameters);
 }
	public void OnAddTaskDB(TaskDB taskDB)
	{
		Task task = null;
		if(taskDict.TryGetValue(taskDB.TaskID, out task))
		{
			task.SyncTask(taskDB);
		}
	}
Exemple #3
0
 public void UpdataTaskDB(TaskDB taskDB)
 {
     using (var session = NHibernateHelper.OpenSession())
     {
         using (var transaction = session.BeginTransaction())
         {
             taskDB.LastUpdateTime = DateTime.Now;
             session.Update(taskDB);
             transaction.Commit();
         }
     }
 }
	public void UpdateTask(TaskManager manager)
	{
		if(TaskDB == null)
		{
			TaskDB = new TaskDB();
			TaskDB.State = (int) taskProgress;
			TaskDB.TaskID = id;
			TaskDB.LastUpDateTime = new DateTime();
			TaskDB.Type = (int) taskType;
			manager.taskDBController.AddTaskDB(TaskDB);
		}
		else
		{
			this.TaskDB.State = (int) taskProgress;
			manager.taskDBController.UpdateTaskDB(this.TaskDB);
		}
	}
Exemple #5
0
 //用来同步任务信息的
 public void SyncTask(TaskDB taskDb)
 {
     TaskDB = taskDb;
     taskProgress = (TaskProgress) taskDb.State;
 }