Exemplo n.º 1
0
        private void UpdatePlayerShortCutList(RemoteTable shortCutList)
        {
            RemoteTable shortCut = shortCutList["shortCut"] as RemoteTable;
            int         c        = shortCut.Count;
            RemoteTable _items   = shortCutList["shortCut"] as RemoteTable;

            for (int i = 0; i < 8; i++)
            {
                int _index = i + 1;
                if (_items.ContainsKey(_index))
                {
                    int          _type   = _items[_index]["type"];
                    int          _itemId = _items[_index]["itemId"];
                    SHORTCUTITEM _sctype = SHORTCUTITEM.NONE;
                    if (_type == 2)
                    {
                        _sctype = SHORTCUTITEM.SKILL;
                    }
                    else if (_type == 1)
                    {
                        _sctype = SHORTCUTITEM.ITEM;
                    }
                    else
                    {
                        _sctype = SHORTCUTITEM.NONE;
                    }
                    ButtonBarView.GetInstance().SetShortCut(i, _sctype, _itemId, false);
                }
            }

            //shortCutList["shortCut"][0]["index"]
        }
Exemplo n.º 2
0
        private void OnTest(RemoteTable tab)
        {
            string      xxx  = tab[111];
            int         aaaa = tab["xxx"];
            RemoteTable tab2 = tab[222] as RemoteTable;
            string      x2   = tab2["ooo"];

            CallGS("OnTest", 123, "zxc");
        }
Exemplo n.º 3
0
        private uint UnPackTable(MemoryStream stream, ArrayList retArray)
        {
            BinaryReader read    = new BinaryReader(stream);
            uint         tabSize = read.ReadUInt32();
            uint         tabEnd  = (uint)(stream.Position) + tabSize;
            RemoteTable  luaTab  = new RemoteTable();

            while (stream.Position < tabEnd)
            {
                ArrayList tabKV = new ArrayList();

                KLuaValueDef keyType   = UnPackUp(stream, tabKV);
                KLuaValueDef valueType = UnPackUp(stream, tabKV);

                if (keyType == KLuaValueDef.eLuaPackNumber)
                {
                    int index = (int)tabKV[0];
                    switch (valueType)
                    {
                    case KLuaValueDef.eLuaPackNumber:
                        luaTab[index] = (RemoteInt)((int)tabKV[1]);
                        break;

                    case KLuaValueDef.eLuaPackBoolean:
                        luaTab[index] = (RemoteBool)((bool)tabKV[1]);
                        break;

                    case KLuaValueDef.eLuaPackString:
                        luaTab[index] = (RemoteString)(tabKV[1] as string);
                        break;

                    case KLuaValueDef.eLuaPackTable:
                        luaTab[index] = tabKV[1] as RemoteTable;
                        break;

                    default:
                        log.Error("UnKnow ValueType");
                        break;
                    }
                }
                else
                {
                    string name = tabKV[0] as string;
                    switch (valueType)
                    {
                    case KLuaValueDef.eLuaPackNumber:
                        luaTab[name] = (RemoteInt)((int)tabKV[1]);
                        break;

                    case KLuaValueDef.eLuaPackBoolean:
                        luaTab[name] = (RemoteBool)((bool)tabKV[1]);
                        break;

                    case KLuaValueDef.eLuaPackString:
                        luaTab[name] = (RemoteString)(tabKV[1] as string);
                        break;

                    case KLuaValueDef.eLuaPackTable:
                        luaTab[name] = tabKV[1] as RemoteTable;
                        break;

                    default:
                        log.Error("UnKnow ValueType");
                        break;
                    }
                }
            }
            retArray.Add(luaTab);
            return(tabSize);
        }
Exemplo n.º 4
0
 private void OnAddDoodad(int objID, int objType, int posX, int posY, RemoteTable table)
 {
     SceneLogic.GetInstance().OnAddDoodad((uint)objID, objType, posX, posY, table);
 }
Exemplo n.º 5
0
 private void OnPveMapInit(int pveID, int completeTime, RemoteTable pveValue)
 {
     PveAutoFight.GetInstance().Show();
     PveProcessView.GetInstance().InitPveMap(pveID, completeTime / 10, pveValue);
 }
Exemplo n.º 6
0
//////////////////////////////////////////////////////////////////////////

//副本
        private void OnPVESucess(int nPveID, int completeTime, RemoteTable award)
        {
            float fCompleteTime = (float)completeTime / 10.0f;

            PveView.GetInstance().ShowPveView(nPveID, fCompleteTime, award);
        }
Exemplo n.º 7
0
 private void OnSyncQuestList(RemoteTable acceptQuests)
 {
     MissionLogic.GetInstance().OnSyncQuestList(acceptQuests);
 }
Exemplo n.º 8
0
 private void OnSyncQuestState(RemoteTable questState)
 {
     MissionLogic.GetInstance().OnSyncQuestState(questState);
 }
Exemplo n.º 9
0
        private void UpdatePlayerGiftBagData(int levelCurrent, int combat, int onlineTime, RemoteTable rewardData)
        {
            MajorPlayer player = PlayerManager.GetInstance().MajorPlayer;

            player.levelCurrent = levelCurrent;           //当前等级
            player.combat       = combat;                 //战力
            player.onlineTime   = (float)onlineTime / 10; //1s为单位

            foreach (KeyValuePair <object, object> item in rewardData.dictKV)
            {
                Int32      key   = (Int32)item.Key;
                RemoteBool value = item.Value as RemoteBool;
                player.rewardData[key] = value.GetBool();
                //key=reward tab ID value = isGained
            }

            GiftItem.curCountingGiftItem = null;
            OnlineGiftView.GetInstance().UpdateUIOnDataChanged();
            GiftHallView.GetInstance().UpdateUIOnDataChanged();
        }
Exemplo n.º 10
0
 //同步好友
 private void OnSyncFriends(RemoteTable tab)
 {
     FriendLogic.getInstance().OnSyncFriends(tab);
 }