Exemplo n.º 1
0
 public GameRoomMgr()
 {
     dRooms          = new Dictionary <uint, BaseRoomItem>();
     dRooms[0]       = new BaseRoomItem();
     dRooms[9999999] = new PlotRoom();
     dRooms[3334]    = new ExpRoom();
     dRooms[3335]    = new MoneyRoom();
     dRooms[3339]    = new FSWZRoom();
     dRooms[3338]    = new MLZDRoom();
     dRooms[3340]    = new ZHSLYRoom();
     dRooms[3348]    = new ZHSLYRoom();
     dRooms[3349]    = new ZHSLYRoom();
     dRooms[3350]    = new ZHSLYRoom();
     dRooms[3351]    = new ZHSLYRoom();
     dRooms[3352]    = new ZHSLYRoom();
     dRooms[3353]    = new ZHSLYRoom();
     dRooms[3354]    = new ZHSLYRoom();
     dRooms[3355]    = new ZHSLYRoom();
     dRooms[3356]    = new ZHSLYRoom();
     dRooms[3341]    = new PVPRoom();
     dRooms[3342]    = new WdsyRoom();
     dRooms[3344]    = new DragonRoom();
     dRooms[3345]    = new TlfbRoom109();
     dRooms[3346]    = new TlfbRoom110();
     dRooms[3347]    = new TlfbRoom111();
     dRooms[3357]    = new JDZCRoom();
     dRooms[3358]    = new CityWarRoom();
 }
Exemplo n.º 2
0
 virtual public void onStart(Variant conf)
 {
     if (started)
     {
         return;
     }
     started       = true;
     instance      = this;
     dDropItem     = new Dictionary <uint, DropItem>();
     dDropItem_own = new Dictionary <uint, DropItem>();
     dDropFakeItem = new Dictionary <uint, DropItem>();
     dPickItem     = new Dictionary <uint, DropItem>();
     clearlist();
     svrConf     = conf;
     fakeItemIdx = 0;
     SceneCamera.refreshMiniMapCanvas();
     process = new TickItem(onTick);
     TickMgr.instance.addTick(process);
     initRoomObj();
     if (a1_gamejoy.inst_skillbar)
     {
         a1_gamejoy.inst_skillbar.clearCD();
     }
     goldnum           = 0;
     expnum            = PlayerModel.getInstance().exp;
     lvl               = PlayerModel.getInstance().lvl;
     zhuan             = PlayerModel.getInstance().up_lvl;
     a3_fb_finish.room = this;
 }
Exemplo n.º 3
0
        public virtual void onStart(Variant conf)
        {
            bool flag = this.started;

            if (!flag)
            {
                this.started          = true;
                BaseRoomItem.instance = this;
                this.dDropItem        = new Dictionary <uint, DropItem>();
                this.dDropItem_own    = new Dictionary <uint, DropItem>();
                this.dDropFakeItem    = new Dictionary <uint, DropItem>();
                this.svrConf          = conf;
                this.fakeItemIdx      = 0u;
                SceneCamera.refreshMiniMapCanvas();
                this.process = new TickItem(new Action <float>(this.onTick));
                TickMgr.instance.addTick(this.process);
                this.initRoomObj();
                this.goldnum = 0u;
                this.expnum  = ModelBase <PlayerModel> .getInstance().exp;

                this.lvl = ModelBase <PlayerModel> .getInstance().lvl;

                this.zhuan = ModelBase <PlayerModel> .getInstance().up_lvl;

                a3_fb_finish.room = this;
            }
        }
Exemplo n.º 4
0
        public void onChangeLevel(Variant svrconf, Variant cursvrmsg)
        {
            bool flag = this.curRoom != null;

            if (flag)
            {
                this.curRoom.onEnd();
                this.curRoom = null;
            }
            uint key   = svrconf["id"];
            bool flag2 = this.dRooms.ContainsKey(key);

            if (flag2)
            {
                this.curRoom = this.dRooms[key];
            }
            else
            {
                bool flag3 = MapModel.getInstance().curLevelId > 0u;
                if (flag3)
                {
                    this.curRoom = this.dRooms[9999999u];
                }
                else
                {
                    this.curRoom = this.dRooms[0u];
                }
            }
            this.curRoom.onStart(svrconf);
            bool flag4 = cursvrmsg != null && cursvrmsg.ContainsKey("dpitms");

            if (flag4)
            {
                List <Variant> arr = cursvrmsg["dpitms"]._arr;
                Dictionary <string, List <DropItemdta> > dictionary = new Dictionary <string, List <DropItemdta> >();
                long curServerTimeStampMS = NetClient.instance.CurServerTimeStampMS;
                foreach (Variant current in arr)
                {
                    int    num   = current["x"];
                    int    num2  = current["y"];
                    string key2  = num + "+" + num2;
                    bool   flag5 = !dictionary.ContainsKey(key2);
                    if (flag5)
                    {
                        dictionary[key2] = new List <DropItemdta>();
                    }
                    DropItemdta dropItemdta = new DropItemdta();
                    dropItemdta.init(current, curServerTimeStampMS);
                    dropItemdta.x = num;
                    dropItemdta.y = num2;
                    dictionary[key2].Add(dropItemdta);
                }
                foreach (List <DropItemdta> current2 in dictionary.Values)
                {
                    Vector3 pos = new Vector3((float)current2[0].x / 53.333f, 0f, (float)current2[0].y / 53.333f);
                    BaseRoomItem.instance.showDropItem(pos, current2, false);
                }
            }
        }
Exemplo n.º 5
0
        public override void onClosed()
        {
            //  InterfaceMgr.getInstance().floatUI.localScale = Vector3.one;
            destorycontain();
            openWindow();
            disposeAvatar();

            room     = null;
            _NewOne  = false;
            instance = null;
            clearAwd();
            if (closefb_way == true)
            {
                LevelProxy.getInstance().sendLeave_lvl();
            }
            if (GameObject.Find("GAME_CAMERA/myCamera"))
            {
                GameObject cameraOBJ = GameObject.Find("GAME_CAMERA/myCamera");
                if (cameraOBJ.GetComponent <DeathShader>())
                {
                    cameraOBJ.GetComponent <DeathShader>().enabled = false;
                }
            }
        }
Exemplo n.º 6
0
        public void onChangeLevel(Variant svrconf, Variant cursvrmsg)
        {
            if (curRoom != null)
            {
                curRoom.onEnd();
                curRoom = null;
            }
            //    debug.Log("!!!!:::::::::::"+cursvrmsg.dump());



            //skillbar.setAutoFightType(0);
            uint curId = svrconf["id"];

            if (dRooms.ContainsKey(curId))
            {
                curRoom = dRooms[curId];
            }
            else if (MapModel.getInstance().curLevelId > 0)
            {
                curRoom = dRooms[9999999];
            }
            else
            {
                curRoom = dRooms[0];
            }
            curRoom.onStart(svrconf);



            if (cursvrmsg != null && cursvrmsg.ContainsKey("dpitms"))
            {
                List <Variant> dps = cursvrmsg["dpitms"]._arr;
                Dictionary <string, List <DropItemdta> > ll = new Dictionary <string, List <DropItemdta> >();
                long curtimer = NetClient.instance.CurServerTimeStampMS;
                foreach (Variant v in dps)
                {
                    int x = v["x"];
                    int y = v["y"];

                    string strpos = x + "+" + y;
                    if (!ll.ContainsKey(strpos))
                    {
                        ll[strpos] = new List <DropItemdta>();
                    }
                    DropItemdta d = new DropItemdta();
                    d.init(v, curtimer);
                    d.x = x;
                    d.y = y;
                    ll[strpos].Add(d);
                }

                foreach (List <DropItemdta> l in ll.Values)
                {
                    Vector3 ve = new Vector3((float)l[0].x / GameConstant.PIXEL_TRANS_UNITYPOS, 0f, (float)l[0].y / GameConstant.PIXEL_TRANS_UNITYPOS);
                    BaseRoomItem.instance.showDropItem(ve, l);
                }
            }

            //if (curId == 0)
            //{
            //    if (skillbar.instance != null)
            //    {
            //        skillbar.instance.autifight.visiable = false;

            //    }

            //    InterfaceMgr.getInstance().close(InterfaceMgr.MONSTER_DICT);
            //    InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_NORMAL);
            //    return;
            //}
            //if (expbar.instance != null)
            //{
            //    skillbar.instance.autifight.visiable = true;

            //}

            //SXML xml = XMLMgr.instance.GetSXML("worldcfg.world", "level_id==" + MapModel.getInstance().curLevelId);

            //bool b = xml.hasFound;
            //if (xml.hasFound)
            //{
            //    skillbar.setAutoFightType();
            //    InterfaceMgr.getInstance().open(InterfaceMgr.MONSTER_DICT);
            //    InterfaceMgr.getInstance().changeState(InterfaceMgr.STATE_FB_BATTLE);
            //}
            //else if (dRooms.ContainsKey(curId))
            //{
            //    dRooms[curId].onStart();
            //    curRoom = dRooms[curId];
            //}

            //MapProxy.getInstance().sendShowMapObj();
        }
Exemplo n.º 7
0
        private int showDrop(Vector3 dropPos, int wrongcount, int idx, DropItemdta item, bool isfake = false)
        {
            bool flag = this.lDropOffset.Count <= idx;

            if (flag)
            {
                idx = 0;
            }
            Vector3 vector  = dropPos + this.lDropOffset[idx];
            Vector3 vector2 = vector;

            vector2.y = -99f;
            NavMeshHit navMeshHit;

            NavMesh.SamplePosition(vector, out navMeshHit, 100f, NavmeshUtils.allARE);
            Vector3 position = navMeshHit.position;
            bool    flag2    = position.x == vector.x && position.z == vector.z;
            int     result;

            if (flag2)
            {
                vector.y = position.y;
                DropItem dropItem = BaseRoomItem.getDropItem(vector, Vector3.zero, item, isfake);
                DropItemUIMgr.getInstance().show(dropItem, dropItem.itemdta.getDropItemName());
                bool flag3 = !isfake;
                if (flag3)
                {
                    this.dDropItem[item.dpid] = dropItem;
                    bool flag4 = item.ownerId == ModelBase <PlayerModel> .getInstance().cid || item.ownerId == 0u || (BaseProxy <TeamProxy> .getInstance().MyTeamData != null && item.ownerId == BaseProxy <TeamProxy> .getInstance().MyTeamData.teamId);

                    if (flag4)
                    {
                        this.dDropItem_own[item.dpid] = dropItem;
                    }
                }
                else
                {
                    item.dpid = this.fakeItemIdx;
                    this.dDropFakeItem[item.dpid] = dropItem;
                    this.fakeItemIdx += 1u;
                }
                result = idx + 1;
            }
            else
            {
                bool flag5 = wrongcount >= 3;
                if (flag5)
                {
                    debug.Log(":" + item.dpid);
                    DropItem dropItem2 = BaseRoomItem.getDropItem(position, Vector3.zero, item, false);
                    DropItemUIMgr.getInstance().show(dropItem2, dropItem2.itemdta.getDropItemName());
                    bool flag6 = !isfake;
                    if (flag6)
                    {
                        this.dDropItem[item.dpid] = dropItem2;
                        bool flag7 = item.ownerId == ModelBase <PlayerModel> .getInstance().cid || item.ownerId == 0u || (BaseProxy <TeamProxy> .getInstance().MyTeamData != null && item.ownerId == BaseProxy <TeamProxy> .getInstance().MyTeamData.teamId);

                        if (flag7)
                        {
                            this.dDropItem_own[item.dpid] = dropItem2;
                        }
                    }
                    else
                    {
                        item.dpid = this.fakeItemIdx;
                        this.dDropFakeItem[item.dpid] = dropItem2;
                        this.fakeItemIdx += 1u;
                    }
                    result = idx + 1;
                }
                else
                {
                    wrongcount++;
                    result = this.showDrop(dropPos, wrongcount, idx + 1, item, isfake);
                }
            }
            return(result);
        }