Esempio n. 1
0
    private static void OnMessage_GCID_SELECTROLE(int iMsgID, ref CMessage msg)
    {
        SDGlobal.Log("GC_SELECTROLE");
        if (SDNetGlobal.bReConnectGate)
        {
            SDNetGlobal.OnMessage_GCID_SELECTROLE(iMsgID, ref msg);
            return;
        }

        //游戏中宠物,邮件,深渊活动等管理器,数据在这里清空一下..
        sdNewPetMgr.Instance.ClearData();
        SDGlobal.Log("sdNewPetMgr.ClearData success!");
        sdActGameMgr.Instance.ClearData();
        SDGlobal.Log("sdActGameMgr.ClearData success!");
        sdMailMgr.Instance.ClearData();
        SDGlobal.Log("sdMailMgr.ClearData success!");
        sdGuideMgr.Instance.ClearData();

        sdLevelInfo.Clear();


        string rolename = SDNetGlobal.playerList[SDNetGlobal.lastSelectRole].mRoleName;

        GPUSH_API.SetUserInfo(0, rolename);
    }
Esempio n. 2
0
    public override void OnTriggerHitted(GameObject obj, int[] param)
    {
        base.OnTriggerHitted(obj, param);

        // 杀死所有怪物aa
        sdMainChar kMainChar             = sdGameLevel.instance.mainChar;
        List <sdActorInterface> lstActor =
            sdGameLevel.instance.actorMgr.FindActor(
                kMainChar,
                HeaderProto.ESkillObjType.SKILL_OBJ_ENEMY,
                kMainChar.transform.position,
                Vector3.zero,
                1,
                0,
                10000.0f,
                true);

        if (lstActor != null)
        {
            foreach (sdActorInterface a in lstActor)
            {
                if (a.actorType == ActorType.AT_Monster)
                {
                    int hp = a["HP"];
                    a.AddHP(-hp);
                }
            }
        }

        // 禁用所有的按键和手势响应aa
        sdGameLevel.instance.DestroyFingerObject();
        sdGameLevel.instance.mainChar.AddDebuffState(HeaderProto.ECreatureActionState.CREATURE_ACTION_STATE_STAY);
        sdGameLevel.instance.mainChar.AddDebuffState(HeaderProto.ECreatureActionState.CREATURE_ACTION_STATE_LIMIT_SKILL);
        GPUSH_API.Vibrate(500);

        // 初始化胜利动画aa
        sdGameMonster kMonster = obj.GetComponent <sdGameMonster>();

        sdGameLevel.instance.mainCamera.InitVictory(kMonster);

        // 请求结算aa
        if (sdUICharacter.Instance.GetBattleType() == (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_WORLD_BOSS)
        {
            sdActGameMsg.Send_CS_WB_RESULT_REQ(0);
            sdActGameMsg.OnWorldBossBeKilled();
        }
        else
        {
            Debug.Log("TuituEnd and Request Jiesuan!");
            sdGameLevel.instance.tuiTuLogic.ShowFightResult(obj);
        }
    }
Esempio n. 3
0
    void PT_End()
    {
        // 禁用所有的按键和手势响应aa
        sdGameLevel.instance.DestroyFingerObject();
        sdGameLevel.instance.mainChar.AddDebuffState(HeaderProto.ECreatureActionState.CREATURE_ACTION_STATE_STAY);
        sdGameLevel.instance.mainChar.AddDebuffState(HeaderProto.ECreatureActionState.CREATURE_ACTION_STATE_LIMIT_SKILL);
        GPUSH_API.Vibrate(500);

        // 初始化胜利动画aa
        sdGameLevel.instance.mainCamera.InitVictory(null);

        // 请求结算aa
        Debug.Log("TuituEnd and Request Jiesuan!");
        sdGameLevel.instance.tuiTuLogic.ShowFightResult(null);
    }
Esempio n. 4
0
    void RefreshNotification(List <string> lstPushInfo)
    {
        Debug.Log("RefreshNotification");
        GPUSH_API.ClearNotification();

        foreach (string s in lstPushInfo)
        {
            string[] elements   = s.Split(',');
            int      id         = int.Parse(elements[0]);
            int      repeat     = int.Parse(elements[1]);
            int      repeattype = int.Parse(elements[2]);
            int      year       = int.Parse(elements[3]);
            int      month      = int.Parse(elements[4]);
            int      day        = int.Parse(elements[5]);
            int      hour       = int.Parse(elements[6]);
            int      minute     = int.Parse(elements[7]);
            int      second     = int.Parse(elements[8]);

            if (repeattype == 0)
            {
                GPUSH_API.NewNotification(id, elements[9], elements[10], day, hour, minute, second);
            }
            else
            {
                GPUSH_API.NewNotificationRepeat(id, elements[9], elements[10], repeattype, hour, minute, second);
            }
        }

        /*
         *  GPUSH_API.NewNotification(1, "几日不见,些许怀念", "这几日在忙什么呢?", 3, 0, 0, 0);
         *  GPUSH_API.NewNotification(2, "勇士,我们想你了!", "很久没有在鲁米那见到你的身影了!", 7, 0, 0, 0);
         *  GPUSH_API.NewNotification(3, "勇士,近来身体可好?", "最近是否太忙了?", 14, 0, 0, 0);
         *  GPUSH_API.NewNotification(4, "版本更新啦!", "赶紧来体验体验吧!", 30, 0, 0, 0);
         *  GPUSH_API.NewNotification(5, "勇士,你已经二个月没有来鲁米那了!", "最近是否太忙了?", 60, 0, 0, 0);
         *  GPUSH_API.NewNotification(6, "勇士,你已经三个月没有来鲁米那了!", "最近是否太忙了?", 90, 0, 0, 0);
         *  GPUSH_API.NewNotification(7, "勇士,你已经半年没有来鲁米那了!", "最近是否太忙了?", 180, 0, 0, 0);
         *  GPUSH_API.NewNotification(8, "勇士,你已经一年没有来鲁米那了!", "是不是已经忘记咱了?重拾装甲,战斗起来吧!", 365, 0, 0, 0);
         *
         *  GPUSH_API.NewNotificationRepeat(12, "浴血竞技场", "角逐竞技之王", 1, 12, 0, 0);
         *  GPUSH_API.NewNotificationRepeat(18, "黑暗之时即将来临", "勇士们,一股强大势力正向我们咆哮而来!这是我们最后的阵地了,为了自由,为了荣誉,战斗吧", 1, 18, 0, 0);
         */

        GPUSH_API.StartNotification();
    }
Esempio n. 5
0
    IEnumerator UpdateProcess()
    {
        //APK Update
#if UNITY_ANDROID
        if (Application.platform == RuntimePlatform.Android)
        {
            glupgrade.gluInit();
            glupgrade.getCallback()._onDownloadChange = OnProcessChanged;
            glupgrade.getCallback()._onMD5CheckStart  = OnMD5CheckStart;
            glupgrade.getCallback()._onMD5CheckFinish = OnMD5CheckFinish;
            glupgrade.getCallback()._onDownloadStart  = OnDownloadStart;
            glupgrade.getCallback()._onDownloadFinish = OnDownloadFinished;
            if (m_slUpdateBar)
            {
                m_slUpdateBar.gameObject.SetActive(true);
                m_slUpdateBar.value = 0.0f;
            }

            bool ApkUpdate = false;
            while (true)
            {
                if (SDGlobal.apkUpdateEnable)
                {
                    if (!ApkUpdate)
                    {
                        int ret = glupgrade.checkNetworkStatus();
                        if (ret == 1)
                        {
                            Debug.Log("WiFi OK!");
                        }
                        else if (ret == 2)
                        {
                            Debug.Log("GPRS OK!");
                            //yield return new WaitForSeconds(10.0f);
                        }
                        else
                        {
                            sdUICharacter.Instance.ShowLoginMsg("APP更新:没有可使用的网络!3秒后重试。");
                            yield return(new WaitForSeconds(3.0f));

                            continue;
                        }

                        ApkUpdate = true;

                        ret = glupgrade.InitUpgradeEx(3000);
                        Debug.Log("InitUpgradeEx() return: " + ret);

                        if (ret == 0) // 不需要升级
                        {
                            Debug.Log("no app update");
                            break;
                        }
                        else if (ret == 1) // 强制升级
                        {
                            //sdUICharacter.Instance.ShowLoginMsg("New Version Founded, Please Waiting...");
                            glupgrade.startUpdate();
                        }
                        else if (ret == 2)// 非强制升级
                        {
                            Debug.Log("No Force Update");
                            //break;
                        }
                        else if (ret == 3)
                        {
                            sdUICharacter.Instance.ShowLoginMsg("APP更新:内部错误(访问升级接口httpCode非200)");
                            ApkUpdate = false;
                        }
                        else if (ret == 4)// 非强制升级
                        {
                            sdUICharacter.Instance.ShowLoginMsg("APP更新:内部错误(访问升级接口网络出错)");
                            ApkUpdate = false;
                        }
                        else if (ret == 5)// 非强制升级
                        {
                            sdUICharacter.Instance.ShowLoginMsg("APP更新:内部错误(JSON格式转换出错)");
                            ApkUpdate = false;
                        }
                        else if (ret == 6)// 非强制升级
                        {
                            sdUICharacter.Instance.ShowLoginMsg("APP更新:获取渠道打包信息失败!");
                            ApkUpdate = false;
                        }
                        else if (ret == 6)// 非强制升级
                        {
                            sdUICharacter.Instance.ShowLoginMsg("APP更新:手机SD卡不可用!");
                            ApkUpdate = false;
                        }
                        else
                        {
                            break;
                        }
                    }
                    yield return(new WaitForSeconds(5.0f));
                }
                else
                {
                    break;
                }
            }
        }
        if (m_slUpdateBar)
        {
            m_slUpdateBar.gameObject.SetActive(false);
        }
#endif

#if UNITY_IPHONE
#endif

        sdUICharacter.Instance.HideLoginMsg();

        if (Application.platform == RuntimePlatform.WindowsEditor)
        {
        }
        else
        {
            //读取分区信息..
            Debug.Log("Read Server Area Information");
            while (true)
            {
                string AreaID = BundleGlobal.AppVersion()["Area"];
                Debug.Log("AreaID=" + AreaID);
                WWW w = new WWW("http://180.96.39.128:8004/arealist?areaid=" + AreaID);
                yield return(w);

                if (w.error == null)
                {
                    JsonParse jp = new JsonParse();
                    jp.Parse(w.text);
                    BundleGlobal.Instance.cdn = jp.cdnlist.ToArray();
                    //BundleGlobal.Instance.
                    //jp.serverlist
                    SDNetGlobal.m_lstSrvInfo    = jp.serverlist;
                    SDNetGlobal.serverNotice    = jp.notice;
                    SDNetGlobal.defaultServerID = jp.defaultServer;

                    RefreshNotification(jp.Pushlist);
                    break;
                }
                else
                {
                    sdUICharacter.Instance.ShowLoginMsg("读取分区信息错误:" + w.error);
                }
            }
            GetSaveAreaInfo();
        }
        sdUICharacter.Instance.HideLoginMsg();

        //bbs
        if (SDNetGlobal.serverNotice.Length != 0)
        {
            sdUICharacter.Instance.ShowbbsWnd(true, SDNetGlobal.serverNotice, true, false);
        }

        //Update Bundle
        BundleGlobal.Instance.StartUpdateAllBundles();
        if (m_slUpdateBar)
        {
            m_slUpdateBar.gameObject.SetActive(true);
        }
        while (BundleGlobal.Instance.updating)
        {
            if (m_slUpdateBar && BundleGlobal.Instance.needDownLoadNum > 0)
            {
                m_slUpdateBar.value = (float)BundleGlobal.Instance.downloadedNum / (float)BundleGlobal.Instance.needDownLoadNum;
                if (m_slUpdateBar.value > 0 && m_slUpdateBar.value < 0.022f)
                {
                    m_slUpdateBar.value = 0.022f;
                }
            }
            if (m_lbUpdateInfo)
            {
                int Percent = BundleGlobal.Instance.GetBundlePercent();
                if (Percent == 100)
                {
                    Percent = 99;
                }
                string s = Percent + "%][";
                if (Percent < 10)
                {
                    s = "[0" + s;
                }
                else
                {
                    s = "[" + s;
                }
                m_lbUpdateInfo.text = "更新资源..." + s + BundleGlobal.Instance.downloadedNum + "/" + BundleGlobal.Instance.needDownLoadNum + "]";
            }
            yield return(0);
        }
        if (m_slUpdateBar)
        {
            m_slUpdateBar.gameObject.SetActive(false);
        }
        if (m_lbUpdateInfo)
        {
            m_lbUpdateInfo.text = "加载游戏配置文件...";
        }

        //Load All Config File
        LoadLevelConfig();

        while (m_strLevelConf == "" ||
               m_strLevelLang == "" ||
               m_strLevelMeta == "" ||
               m_strLevelBox == "")
        {
            yield return(0);
        }


        sdLevelInfo.LoadLevelConfig(m_strLevelConf, m_strLevelLang, m_strLevelMeta, m_strLevelBox);
        sdResourceDependenceTable.GetSingleton().LoadMonsterTable("$Conf/MonsterDependence.xml", false);
        sdResourceDependenceTable.GetSingleton().LoadMonsterTable("$Conf/PetDependence.xml", false);
        sdAITable.GetSingleton().LoadAITable("$Conf/AITable.xml", false);
        sdConfDataMgr.Instance().Init(false);

        while (!sdConfDataMgr.Instance().isInitFinish())
        {
            yield return(0);
        }
        sdUICharacter.Instance.HideLoginMsg();
        //Init GHOME GPUSH
        if (Application.platform == RuntimePlatform.Android ||
            Application.platform == RuntimePlatform.IPhonePlayer)
        {
            GHOME_CODE = -2;
            while (GHOME_CODE != 0)
            {
                if (GHOME_CODE == -2)
                {
                    GHOME_CODE = -1;
                    Debug.Log("InitGHome");
                    Init_GHOME_GPUSH();
                }
                else
                {
                    if (GHOME_CODE == 1)
                    {
                        Debug.Log("InitGHome Failed!");
                        GHOME_CODE = -2;
                    }
                    else
                    {
                        yield return(0);
                    }
                }
            }
            GPUSH_API.Init("791000015", "9728werwerwc53ba8cded5a6a2227dd8");
            sdUICharacter.Instance.HideLoginMsg();
        }
        else
        {
            m_btEnterGameButton.SetActive(false);
            SDGlobal.StartGetMacAddress();
        }
        if (Application.platform == RuntimePlatform.Android || Application.platform == RuntimePlatform.IPhonePlayer)
        {
            UILabel lb_srvName = m_btGameServer.transform.FindChild("Background").FindChild("Label").GetComponent <UILabel>();
            lb_srvName.text = SDNetGlobal.serverName;
        }

        StartCoroutine(LoginProcess());
    }
Esempio n. 6
0
    protected virtual void OnPress(bool isDown)
    {
        if (type == ShortCutType.Type_Skill && id == 1001 && !sdGameLevel.instance.AutoMode)
        {
            if (isDown)
            {
                needspell = true;
            }
            else
            {
                needspell = false;
            }
        }

        if (!isDown)
        {
            if (type == ShortCutType.Type_Skill && isBig)
            {
                gameObject.transform.localScale /= 1.2f;
                isBig = false;
            }
            return;
        }

        if (type == ShortCutType.Type_Skill)
        {
            if (isDown)
            {
                GPUSH_API.Vibrate(25);
            }
            if (!isBig)
            {
                gameObject.transform.localScale *= 1.2f;
                isBig = true;
            }

            // CD尚未结束,则直接返回aa
            if (maxCd > 0 && bIsShowCd)
            {
                return;
            }

            // 检查场景和主角战斗控制器aa
            if (sdGameLevel.instance == null)
            {
                return;
            }

            FingerControl kFingerControl = sdGameLevel.instance.GetFingerControl();;
            if (kFingerControl == null)
            {
                return;
            }

            // 自动打怪模式下:自动寻路攻击最近的目标aa
            int iSkillID = (int)id / 100;
            if (sdGameLevel.instance.AutoMode && iSkillID != 1002)
            {
                if (!kFingerControl.AttackNearest(iSkillID))
                {
                    return;
                }
            }

            // 自动打怪模式下:调整方向aa
            if (sdGameLevel.instance.AutoMode)
            {
                kFingerControl.AdjustDirection(iSkillID);
            }

            // 释放技能(自动模式下普通攻击不再强制施放)aa
            if (!sdGameLevel.instance.AutoMode || iSkillID != 1001)
            {
                sdMainChar mainChar = sdGameLevel.instance.mainChar;
                if (mainChar != null)
                {
                    sdGameSkill skill = sdGameSkillMgr.Instance.GetSkill((int)id);
                    if (skill != null)
                    {
                        int error = -1;
                        if (!mainChar.CastSkill(skill.classId, ref error))
                        {
                            string msg = string.Format("Error_{0}", error);
                            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr(msg), Color.yellow);
                        }
                    }
                    else
                    {
                        int error = -1;
                        if (!mainChar.CastSkill((int)id, ref error))
                        {
                            string msg = string.Format("Error_{0}", error);
                            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr(msg), Color.yellow);
                        }
                    }
                    //sdSkill skill = mainChar.skillTree.getSkill((int)id);
                    //if (skill != null)
                    //{
                    //	skill.spell(mainChar);
                    //}
                }
            }
        }
        else if (type == ShortCutType.Type_Pet)
        {
        }
        else if (type == ShortCutType.Type_PetSkill)
        {
        }
    }