コード例 #1
0
        public void UseSkillLock(NetCmdPack pack)
        {
            NetCmdSkillLock cmd = (NetCmdSkillLock)pack.cmd;
            //客户端可以使用锁定技能
            //...
            byte clientSeat = SceneRuntime.ServerToClientSeat(cmd.Seat);

            if (clientSeat == SceneRuntime.PlayerMgr.MyClientSeat)
            {
                IEvent   evt       = new GF.Event(EventMsg.UPDATE_USERITEM);
                object[] parameter =
                {
                    SkillSetting.SkillDataList[(byte)SkillType.SKILL_LOCK].CDTime,
                    SkillType.SKILL_LOCK
                };
                evt.parameter = parameter;
                EventManager.Instance.DispatchEvent(evt);

                //SceneRuntime.LogicUI.PlayCD(SkillSetting.SkillDataList[(byte)SkillType.SKILL_LOCK].CDTime, SkillType.SKILL_LOCK);
                SceneRuntime.PlayerMgr.MySelf.Launcher.OnClickAutoShotCancel(null);
                SceneRuntime.PlayerMgr.SetLocked(true);
            }
            else
            {
                SceneRuntime.PlayerMgr.ShowOtherUserLocked(clientSeat);
            }
        }
コード例 #2
0
ファイル: SkillModel.cs プロジェクト: isoundy000/L3D
 //普通技能
 public void UpdateSkillState(NetCmdChangeLauncher ncc)
 {
     if (PlayerRole.Instance.RoleInfo.RoleMe.GetVipLevel() >= 2)
     {
         if (SceneRuntime.PlayerMgr.MySelf.Launcher.LauncherType >= 2)
         {
             byte Idx = LauncherSetting.LauncherDataList[SceneRuntime.PlayerMgr.MySelf.Launcher.LauncherType].nSkillBind;
             if (Idx != 255)
             {
                 m_CurSkillType = Idx;
                 m_bCanUse[0]   = true;
                 IEvent evt = new GF.Event(EventMsg.UPDATE_CANON_SKILL);
                 evt.parameter = m_CurSkillType;
                 EventManager.Instance.DispatchEvent(evt);
             }
         }
         else
         {
             IEvent evt = new GF.Event(EventMsg.HIDE_CANON_SKILL);
             EventManager.Instance.DispatchEvent(evt);
         }
     }
     else
     {
         IEvent evt = new GF.Event(EventMsg.HIDE_CANON_SKILL);
         EventManager.Instance.DispatchEvent(evt);
     }
 }
コード例 #3
0
ファイル: RoleItem.cs プロジェクト: isoundy000/L3D
        private bool HandleGetUserItem(NetCmdBase obj)
        {
            //获得全部的物品
            LC_Cmd_GetUserItem ncb = (LC_Cmd_GetUserItem)obj;

            if ((ncb.States & FishDataInfo.MsgBegin) != 0)
            {
                ItemMap.Clear();
                ItemCountMap.Clear();
            }
            for (UInt16 i = 0; i < ncb.Sum; ++i)
            {
                OnAddItemMap(ncb.Array[i]);
            }
            if ((ncb.States & FishDataInfo.MsgEnd) != 0)
            {
                m_IsLoadItem = true;
                //tagItemChangeEvent Event = new tagItemChangeEvent();
                //MsgEventHandle.HandleMsg(Event);
                IEvent evt = new GF.Event(EventMsg.UPDATE_USERITEM);
                //evt.parameter = ncc;
                EventManager.Instance.DispatchEvent(evt);
            }
            return(true);
        }
コード例 #4
0
ファイル: LoginModel.cs プロジェクト: isoundy000/L3D
        public void OnAccountOnlyId(IEvent iEvent)
        {
            NetCmdPack pack = (NetCmdPack)iEvent.parameter;
            //玩家登陆的结果 或者是注册的结果
            LC_Cmd_AccountOnlyID ncb = (LC_Cmd_AccountOnlyID)pack.cmd;

            switch (ncb.LogonTypeID)
            {
            case 1:
            {
                //正常登陆
                Debug.Log("1");
            }
            break;

            case 2:
            {
                Debug.Log("2");
            }
            break;
            }

            //UIManager.Instance.ShowView<MainMenuView>();
            if (ncb.dwUserID == 0)
            {
                UIManager.Instance.ShowMessage("账号密码错误", MessageBoxEnum.Style.Ok, null);
            }
            else
            {
                Debug.Log(_mUserId);
                IEvent evt = new GF.Event(EventMsg.LOGON_SUCCESS);
                EventManager.Instance.DispatchEvent(evt);
                //将IP转化为String
                _mUserId = ncb.dwUserID;
                _mOnlyId = ncb.dwOnlyID;
                ServerSetting.HallServerIP   = Utility.IPToString(ncb.GateIp);
                ServerSetting.HallServerPort = ncb.GatePort;
                ServerSetting.NewIP          = ncb.GameIp;
                ServerSetting.NewPort        = ncb.GamePort;
                UserDefault.Instance.SetStringForKey("Account", accountInfo.UID);
                UserDefault.Instance.SetStringForKey("Password", accountInfo.PWD);
                ConnectHall();//加入到大厅并且发送命令 设置好IP 和 Port 并且 设置好需要发送的命令的参赛
            }
        }