private void RequestJobChange(bool immediate)
        {
            if (this.mRequestSent)
            {
                return;
            }
            PlayerPartyTypes dataOfClass = DataSource.FindDataOfClass <PlayerPartyTypes>(((Component)this).get_gameObject(), PlayerPartyTypes.Max);

            this.mRequestSent = true;
            if ((this.mTargetUnit.TempFlags & UnitData.TemporaryFlags.TemporaryUnitData) != (UnitData.TemporaryFlags) 0)
            {
                MonoSingleton <GameManager> .Instance.Player.FindUnitDataByUniqueID(this.mTargetUnit.UniqueID).SetJobFor(dataOfClass, this.mTargetUnit.CurrentJob);
            }
            UnitJobDropdown.OnJobChange(this.mTargetUnit.UniqueID);
            ReqUnitJob reqUnitJob = (this.mTargetUnit.TempFlags & UnitData.TemporaryFlags.TemporaryUnitData) != (UnitData.TemporaryFlags) 0 ? new ReqUnitJob(this.mTargetUnit.UniqueID, this.mTargetUnit.CurrentJob.UniqueID, PartyData.GetStringFromPartyType(dataOfClass), new Network.ResponseCallback(this.JobChangeResult)) : new ReqUnitJob(this.mTargetUnit.UniqueID, this.mTargetUnit.CurrentJob.UniqueID, new Network.ResponseCallback(this.JobChangeResult));

            if (immediate)
            {
                int num = (int)Network.RequestAPIImmediate((WebAPI)reqUnitJob, true);
            }
            else
            {
                Network.RequestAPI((WebAPI)reqUnitJob, false);
            }
        }
Exemple #2
0
        public override void OnActivate(int pinID)
        {
            if (pinID != 0)
            {
                return;
            }
            string email = FlowNode_NewGameRegister.gDeviceID.ToString().Replace("-", string.Empty).Substring(0, 16);

            FlowNode_NewGameRegister.gEmail = email;
            Network.RequestAPIImmediate((WebAPI) new ReqAuthEmailRegister(email, FlowNode_NewGameRegister.gPassword, FlowNode_NewGameRegister.gDeviceID, MonoSingleton <GameManager> .Instance.SecretKey, MonoSingleton <GameManager> .Instance.UdId, new Network.ResponseCallback(this.ImmediateResponseCallback)), true);
            ((Behaviour)this).set_enabled(true);
        }
Exemple #3
0
        private void OnApplicationPause(bool pausing)
        {
            if (!pausing || Network.Mode != Network.EConnectMode.Online || !MonoSingleton <GameManager> .Instance.update_trophy_lock.IsLock)
            {
                return;
            }
            PlayerData player = MonoSingleton <GameManager> .Instance.Player;

            if (!player.IsTrophyDirty())
            {
                return;
            }
            TrophyState[]      trophyStates = player.TrophyStates;
            List <TrophyState> trophyprogs1 = new List <TrophyState>(trophyStates.Length);
            List <TrophyState> trophyprogs2 = new List <TrophyState>(trophyStates.Length);

            for (int index = 0; index < trophyStates.Length; ++index)
            {
                if (trophyStates[index].Param.IsChallengeMission)
                {
                    if (trophyStates[index].IsDirty)
                    {
                        trophyprogs2.Add(trophyStates[index]);
                    }
                }
                else if (trophyStates[index].IsDirty)
                {
                    trophyprogs1.Add(trophyStates[index]);
                }
            }
            if (trophyprogs1.Count > 0)
            {
                int num1 = (int)Network.RequestAPIImmediate((WebAPI) new ReqUpdateTrophy(trophyprogs1, new Network.ResponseCallback(this.OnUpdateTrophyImmediate), false), true);
            }
            if (trophyprogs2.Count <= 0)
            {
                return;
            }
            int num2 = (int)Network.RequestAPIImmediate((WebAPI) new ReqUpdateBingo(trophyprogs2, new Network.ResponseCallback(this.OnUpdateTrophyImmediate), false), true);
        }