コード例 #1
0
    static int Send(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                Game.MessageManager          obj  = (Game.MessageManager)ToLua.CheckObject <Game.MessageManager>(L, 1);
                UFrame.MessageCenter.Message arg0 = (UFrame.MessageCenter.Message)ToLua.CheckObject <UFrame.MessageCenter.Message>(L, 2);
                obj.Send(arg0);
                return(0);
            }
            else if (count == 3)
            {
                Game.MessageManager          obj  = (Game.MessageManager)ToLua.CheckObject <Game.MessageManager>(L, 1);
                UFrame.MessageCenter.Message arg0 = (UFrame.MessageCenter.Message)ToLua.CheckObject <UFrame.MessageCenter.Message>(L, 2);
                bool arg1 = LuaDLL.luaL_checkboolean(L, 3);
                obj.Send(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: Game.MessageManager.Send"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #2
0
 static int Tick(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         Game.MessageManager obj = (Game.MessageManager)ToLua.CheckObject <Game.MessageManager>(L, 1);
         obj.Tick();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
    static int GetInstance(IntPtr L)
    {
        try
        {
            ToLua.CheckArgsCount(L, 0);
            Game.MessageManager o = UFrame.Common.Singleton <Game.MessageManager> .GetInstance();

            ToLua.PushObject(L, o);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #4
0
 static int UnRegist(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         Game.MessageManager obj = (Game.MessageManager)ToLua.CheckObject <Game.MessageManager>(L, 1);
         int arg0 = (int)LuaDLL.luaL_checknumber(L, 2);
         System.Action <UFrame.MessageCenter.Message> arg1 = (System.Action <UFrame.MessageCenter.Message>)ToLua.CheckDelegate <System.Action <UFrame.MessageCenter.Message> >(L, 3);
         obj.UnRegist(arg0, arg1);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
コード例 #5
0
    static int set_gameMessageCenter(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Game.MessageManager obj = (Game.MessageManager)o;
            UFrame.MessageCenter.ActionMessageCenter arg0 = (UFrame.MessageCenter.ActionMessageCenter)ToLua.CheckObject <UFrame.MessageCenter.ActionMessageCenter>(L, 2);
            obj.gameMessageCenter = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index gameMessageCenter on a nil value"));
        }
    }
コード例 #6
0
    static int get_gameMessageCenter(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Game.MessageManager obj = (Game.MessageManager)o;
            UFrame.MessageCenter.ActionMessageCenter ret = obj.gameMessageCenter;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index gameMessageCenter on a nil value"));
        }
    }
コード例 #7
0
    static int _CreateGame_MessageManager(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                Game.MessageManager obj = new Game.MessageManager();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: Game.MessageManager.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
コード例 #8
0
        public override void Leave()
        {
            MessageManager.GetInstance().UnRegist((int)UFrameBuildinMessage.Arrived, this.OnArrived);

            base.Leave();
        }
コード例 #9
0
ファイル: Main.cs プロジェクト: GITHUB243884919/COCSLG
 public void Update(float s)
 {
     MessageManager.GetInstance().Tick();
     gameFSMMachine.Tick((int)(s * 1000));
 }
 public override void Leave()
 {
     MessageManager.GetInstance().UnRegist((int)GameMessageDefine.VisitorGetVisitSeatReply, OnVisitorGetVisitSeatReply);
     MessageManager.GetInstance().UnRegist((int)UFrameBuildinMessage.Arrived, this.OnArrived);
     base.Leave();
 }
コード例 #11
0
ファイル: StateLogin.cs プロジェクト: GITHUB243884919/COCSLG
 void UnRegistLuaMessage()
 {
     MessageManager.GetInstance().gameMessageCenter.UnRegist(GameLogic_LoginSuccessed, MessageCallback);
 }
コード例 #12
0
 public override void Leave()
 {
     MessageManager.GetInstance().gameMessageCenter.UnRegist((int)GameMsg.C2C_Return_Login, MessageCallback);
     returnLogin = false;
     base.Leave();
 }
コード例 #13
0
ファイル: CardModel.cs プロジェクト: GITHUB243884919/Puzzle24
        void Calc()
        {
            if (!CouldCalc)
            {
                return;
            }

            int n1 = UnitData.Data(first.unitData).pointUp;
            int n2 = UnitData.Data(second.unitData).pointUp;

            Debug.LogErrorFormat("{0} {1} {2} ", n1, OperData.Data(op.unitData).op, n2);
            CalcUnit calcUnit = new CalcUnit();

            calcUnit.unitType     = CalcUnitType.Card;
            calcUnit.unitData     = new UnitData();
            calcUnit.unitData.btn = resultBtn;
            UnitData.Data(calcUnit.unitData).resultBtn = resultBtn;

            switch (OperData.Data(op.unitData).op)
            {
            case CalcOper.Add:
                Op_Add(calcUnit);
                break;

            case CalcOper.Sub:
                Op_Sub(calcUnit);
                break;

            case CalcOper.Mul:
                Op_Mul(calcUnit);
                break;

            case CalcOper.Div:
                Op_Div(calcUnit);
                break;
            }

            UnitData.Data(first.unitData).btn.gameObject.SetActive(false);
            UnitData.Data(second.unitData).btn.gameObject.SetActive(false);
            resultBtn.gameObject.SetActive(true);
            if (UnitData.Data(calcUnit.unitData).pointDown != 1)
            {
                resultBtn.GetComponentInChildren <Text>().text = UnitData.Data(calcUnit.unitData).pointUp + "/" + UnitData.Data(calcUnit.unitData).pointDown;
                txtResult.text = UnitData.Data(calcUnit.unitData).pointUp + "/" + UnitData.Data(calcUnit.unitData).pointDown;
            }
            else
            {
                resultBtn.GetComponentInChildren <Text>().text = UnitData.Data(calcUnit.unitData).pointUp.ToString();
                txtResult.text = UnitData.Data(calcUnit.unitData).pointUp.ToString();
            }

            //resultBtn.GetComponent<Outline>().enabled = true;
            //first = calcUnit;
            //resultBtn = UnitData.Data(first.unitData).resultBtn;
            op.unitData.btn.GetComponent <Outline>().enabled = false;
            first     = null;
            resultBtn = null;
            second    = null;
            op        = null;
            --leftCalcStepNum;
            txtFirst.text  = "";
            txtSecond.text = "";
            txtResult.text = "";

            if (leftCalcStepNum == 0)
            {
                leftCalcStepNum = 3;
                if (UnitData.Data(calcUnit.unitData).pointDown == 1 &&
                    UnitData.Data(calcUnit.unitData).pointUp == this.correctResult)
                {
                    PageMgr.ShowPage <UIResult>();
                    return;
                }

                MessageManager.GetInstance().Send((int)GameMessageDefine.GenLevel);
            }
        }
コード例 #14
0
 public override void Release()
 {
     fsm.Release();
     MessageManager.GetInstance().UnRegist((int)GameMessageDefine.BroadcastLetGroundParingCarLeave, OnBroadcastLetGroundParingCarLeave);
     base.Release();
 }
コード例 #15
0
        //public override void Init(EntityMovable ownerEntity, List<Vector3> pathPosList, Vector3 orgPos, int nextPosIdx, float speed)
        //{
        //    base.Init(ownerEntity, pathPosList, orgPos, nextPosIdx, speed);
        //    AddState();
        //}

        public override void Init(EntityMovable ownerEntity, int groupID, int idx, List <Vector3> pathPosList, Vector3 orgPos, int nextPosIdx, float speed)
        {
            base.Init(ownerEntity, groupID, idx, pathPosList, orgPos, nextPosIdx, speed);
            AddState();
            MessageManager.GetInstance().Regist((int)GameMessageDefine.BroadcastLetGroundParingCarLeave, OnBroadcastLetGroundParingCarLeave);
        }
コード例 #16
0
        public override void Enter(int preStateName)
        {
            //LogWarp.Log("VisitorGotoZooEntry.Enter");
            base.Enter(preStateName);

            isToVisitorStateLeaveZooEntryQueueFull = false;
            isToVisitorStateEntryQueue             = false;
            //isStartGotoEntry = false;

            isArrivedObservePos = false;

            var entity = (this.fsmCtr as FSMMachineVisitor).ownerEntity;

            DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} VisitorGotoZooEntry.Enter", entity.entityID);
            DebugFile.GetInstance().MarkGameObject(entity.mainGameObject, "visitor_{0}_{1}_{2}", entity.entityID, (VisitorState)this.preStateName, (VisitorState)this.stateName);

            entity.Reset();
            DebugFile.GetInstance().WriteKeyFile(entity.entityID, "{0} Play {1}, {2}, {3}",
                                                 entity.entityID, Config.globalConfig.getInstace().VisitorWalk,
                                                 entity.mainGameObject.GetInstanceID(),
                                                 entity.anim.animation.gameObject.GetInstanceID()
                                                 );
            entity.PlayActionAnim(Config.globalConfig.getInstace().VisitorWalk);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.AddVisitorToEntryQueuePlaceHolderReply, this.OnAddVisitorToEntryQueuePlaceHolderReply);
            MessageManager.GetInstance().Regist((int)UFrameBuildinMessage.Arrived, this.OnArrived);
            MessageManager.GetInstance().Regist((int)GameMessageDefine.BroadcastForwardOneStepInEntryGateQueue, OnBroadcastForwardOneStepInExitGateQueue);
            //去观察点
            string         pathName;
            EntityFuncType entityFuncType = (EntityFuncType)(entity.entityFuncType);

            switch (entityFuncType)
            {
            case EntityFuncType.Visitor_From_Ship:
                pathName = Config.globalConfig.getInstace().AdvertVisitorInto_2;
                EntityVisitor.GodownPath(entity, pathName, true);
                break;

            case EntityFuncType.Visitor_From_Car:
                pathName = Config.globalConfig.getInstace().EntryQueueObservePath;
                EntityVisitor.GodownPath(entity, pathName, true);
                break;

            case EntityFuncType.Visitor_From_GroundParking:
                //LogWarp.LogErrorFormat("entityID={0} StateVisitorGotoZooEntry  groupID={1}, idx={2}", entity.entityID, entity.groundParkingGroupID, entity.groundParkingIdx);
                var            pathUnit = GroundParingSpacePathManager.GetInstance().GetPathUnit(entity.groundParkingGroupID, entity.groundParkingIdx);
                List <Vector3> pathList = null;
                if (!GroundParingSpacePathManager.IsExist(pathUnit.entryObservePath))
                {
                    pathList = GroundParingSpacePathManager.GenObservePath(entity.groundParkingGroupID, entity.groundParkingIdx);
                    GroundParingSpacePathManager.GetInstance().AddPath(GroundParingSpacePathType.EntryObservePath, pathUnit, pathList, null);
                }
                pathList = pathUnit.entryObservePath;
                entity.pathList.Clear();
                entity.pathList.AddRange(pathList);
                EntityVisitor.GodownPath(entity, entity.pathList, true);

                ///*新手引导阶段    添加跟随对象 不做步骤调用(仅限于步骤9)*/
                if (GlobalData.GlobalDataManager.GetInstance().playerData.playerZoo.isGuide == true)
                {
                    UIGuidePage uIGuidePage = PageMgr.GetPage <UIGuidePage>();
                    if (uIGuidePage == null)
                    {
                        string e1 = string.Format("新手引导界面  PageMgr.allPages里 UIGuidePage   为空");
                        throw new System.Exception(e1);
                    }
                    //LogWarp.LogError("测试:  entity.mainGameObject.name " + entity.mainGameObject.name+ "    uIGuidePage.procedure= "+ uIGuidePage.procedure);
                    if (uIGuidePage.newBieGuild_step == NewBieGuild.Step_9 && uIGuidePage.number == 0)
                    {
                        uIGuidePage.entity = entity;
                        uIGuidePage.number = 1;
                    }
                }

                break;

            default:
                string e = string.Format("没有这种游客类型{0}", entityFuncType);
                throw new System.Exception(e);
            }
        }
        /// <summary>
        /// 动物栏的门票升级消息修改
        /// </summary>
        /// <param name="msg"></param>
        protected void OnSetLittleZooTicketsLevelPlayerData(Message msg)
        {
            var _msg = msg as SetDetailValueOfPlayerData;
            // 涉及金币减扣
            LittleZooModuleDataMSS littleZooModuleData = GlobalDataManager.GetInstance().playerData.GetLittleZooModuleData(_msg.detailVal);

            buildupCell = GetBuildupCell(_msg.detailVal);
            if ((littleZooModuleData.littleZooTicketsLevel + _msg.deltaVal) > buildupCell.lvmax)
            {
                return;
            }
            BigInteger bigDelta = (LittleZooModule.GetUpGradeConsumption(_msg.detailVal, littleZooModuleData.littleZooTicketsLevel + _msg.deltaVal));

            if (!playerData.playerZoo.playerCoin.WarpAddCoin(playerData, -bigDelta))
            {
                return;
            }

            //修改动物栏等级
            int currVal = littleZooModuleData.littleZooTicketsLevel + _msg.deltaVal;
            int idx     = GlobalDataManager.GetInstance().playerData.GetLittleZooIDIndexOfDataIdx(_msg.detailVal); //获取动物栏ID  下标

            this.playerData.playerZoo.littleZooModuleDatasMSS[idx].littleZooTicketsLevel = currVal;

            BroadcastDetailValueOfPlayerData.Send((int)GameMessageDefine.BroadcastLittleZooTicketsLevelPlayerData,
                                                  _msg.detailVal, currVal, _msg.deltaVal);
            BuildingLevelup.Send((int)BuildingTypeFM.LittleZoo, _msg.detailVal, (int)LittleZooProperty.TicketPrice, currVal);

            //收集星星:
            var lvshage = Config.buildupConfig.getInstace().getCell(_msg.detailVal).lvshage;

            int idx01 = FindLevelRangIndex01(lvshage, currVal);
            //LogWarp.LogErrorFormat("测试:  等级={0}  下标={1}  ",currVal,idx01);

            int stageLevel = Config.buildupConfig.getInstace().getCell(_msg.detailVal).lvshage[idx01];

            if (this.playerData.playerZoo.littleZooModuleDatasMSS[idx].littleZooTicketsLevel == stageLevel)
            {
                int awardType = Config.buildupConfig.getInstace().getCell(_msg.detailVal).lvrewardtype[idx01];
                int awardID   = Config.buildupConfig.getInstace().getCell(_msg.detailVal).lvreward[idx01];
                var cell      = Config.itemConfig.getInstace().getCell(awardID);
                if (awardType == 1)
                {
                    //发放奖励道具
                    MessageInt.Send((int)GameMessageDefine.GetItem, awardID);
                    if (cell.itemtype == 2)
                    {
                        PageMgr.GetPage <UIMainPage>().OnMoneyEffect();
                    }                    //LogWarp.LogErrorFormat("动物栏   当前等级为{0},可以发放奖励道具{1}", stageLevel, awardID);
                }
                else if (awardType == 2)
                {
                    var buildUpCell = Config.buildupConfig.getInstace().getCell(_msg.detailVal);

                    int animalID = buildUpCell.lvreward[idx01];
                    //LogWarp.LogErrorFormat("测试:AAAAAAAAAAAAAAAAAAAAAAA 动物栏:{0}   animalID ={1}" , _msg.detailVal, animalID);
                    var animalUpCell = Config.animalupConfig.getInstace().getCell(animalID);
                    //判断是否需要存储动物
                    bool isExistAnimalID = playerData.playerZoo.animalMSS15.FindAnimalID(animalID);
                    if (!isExistAnimalID)
                    {
                        playerData.playerZoo.animalMSS15.AddAnimal(animalID, true);
                        LittleZooModule.LoadAnimal(_msg.detailVal, animalID,
                                                   animalUpCell.moveradius, buildUpCell.animalwanderoffset);
                        GetShowUIReceivePage(animalID);
                        MessageInt.Send((int)GameMessageDefine.GetAnimalAtlasDataMessage, animalID);
                        MessageManager.GetInstance().Send((int)GameMessageDefine.AnimalBuffAlterSucceed);
                    }
                }
                //发放星星
                MessageInt.Send((int)GameMessageDefine.GetItem, 4);

                //LogWarp.LogErrorFormat("动物栏  当前等级为{0},可以发放星星", stageLevel);
            }
        }
コード例 #18
0
        protected void OnBroadcastOpenNewLittleZoo(Message msg)
        {
            var _msg = msg as BroadcastOpenNewLittleZoo;

            //增加数据
            ModifyLittleZooMap(_msg.littleZooID, littleZooMap);
            //自身外观变化从0级别变1级
            LoadLittleZoo(sceneID, _msg.littleZooID, 1, null);
            var cellBuildUp = Config.buildupConfig.getInstace().getCell(_msg.littleZooID);

            Config.animalupCell cellAnimalUp;
            int animalID = cellBuildUp.animalid[0];

            cellAnimalUp = Config.animalupConfig.getInstace().getCell(animalID);

            bool isFindAnimalProp = playerData.playerZoo.animalMSS15.FindAnimalProp(cellAnimalUp.bigtype, cellAnimalUp.smalltype, out AnimalProp animalProp);

            if (!isFindAnimalProp)
            {
                playerData.playerZoo.animalMSS15.AddAnimal(animalID, true);
                LittleZooModule.LoadAnimal(_msg.littleZooID, animalID, cellAnimalUp.moveradius,
                                           cellBuildUp.animalwanderoffset, sceneID);
                MessageInt.Send((int)GameMessageDefine.GetAnimalAtlasDataMessage, animalID);
                MessageManager.GetInstance().Send((int)GameMessageDefine.AnimalBuffAlterSucceed);
            }
            else
            {
                for (int j = 0; j < cellBuildUp.animalid.Length; j++)
                {
                    animalID = cellBuildUp.animalid[j];
                    bool isShow = LittleZooModule.GetExamineAnimalShowToLittleZooScene(animalID);
                    if (isShow == true)
                    {
                        cellAnimalUp = Config.animalupConfig.getInstace().getCell(animalID);
                        LittleZooModule.LoadAnimal(_msg.littleZooID, animalID, cellAnimalUp.moveradius,
                                                   cellBuildUp.animalwanderoffset, sceneID);
                    }
                }
            }


            //是否需要加载额外地块
            if (!_msg.isTriggerExtend)
            {
                return;
            }

            //加载新地块
            float extendLen = 0;

            if (_msg.triggerLoadGroupID != Const.Invalid_Int)
            {
                extendLen = LoadExtendGroup(_msg.triggerLoadGroupID);
                UIInteractive.GetInstance().Init();
            }

            int triggerLittleZooID;

            for (int i = 0; i < _msg.triggerLoadLittleZooIDs.Count; i++)
            {
                triggerLittleZooID = _msg.triggerLoadLittleZooIDs[i];
                //加载动物栏
                LoadLittleZoo(sceneID, triggerLittleZooID, 0, GlobalDataManager.GetInstance().zooGameSceneData.littleZooParentNode);
            }

            //出口后移
            MoveExitGate(extendLen);

            MessageManager.GetInstance().Send((int)GameMessageDefine.BroadcastAfterExtendSceneAndModifiedPath);
            BuildingUnlock.Send((int)BuildingTypeFM.LittleZoo, _msg.littleZooID);
        }
コード例 #19
0
 void SendReturn()
 {
     UFrame.MessageCenter.Message msg = new UFrame.MessageCenter.Message();
     msg.messageID = (int)MessageDefine.GameMsg.C2C_Return_Login;
     MessageManager.GetInstance().gameMessageCenter.Send(msg);
 }