Esempio n. 1
0
    void ReadAppointmentCSVData()
    {
        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, GameDefine.AppointmentFileName, out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            AppointmentCSVData data = new AppointmentCSVData();
            byte.TryParse(strList[i][0], out data.gameid);
            for (int index = 1; index < 7; index++)
            {
                int temp = 0;
                int.TryParse(strList[i][index], out temp);
                data.datas.Add(temp);
            }

            //int.TryParse(strList[i][8], out data.incoin);
            //int.TryParse(strList[i][9], out data.outcoin);
            //int.TryParse(strList[i][10], out data.bet);

            appointmentcsvs_.Add(data.gameid, data);
        }
    }
Esempio n. 2
0
    void ReadItemConfig(string csvname)
    {
        bagitemsdata_.Clear();

        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, csvname, out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            BagItemData data = new BagItemData();

            uint.TryParse(strList[i][0], out data.itemid);
            data.itemName = strList[i][1];
            data.itemIcon = strList[i][2];
            data.itemInfo = strList[i][3];
            uint.TryParse(strList[i][4], out data.repeatNumber);
            int isgiven = 0;
            int.TryParse(strList[i][5], out isgiven);
            data.isgiven = isgiven == 1;
            int usetype = 0;
            int.TryParse(strList[i][6], out usetype);
            data.usetype = (ItemUseType)usetype;
            uint.TryParse(strList[i][7], out data.itemScriptid);
            uint.TryParse(strList[i][8], out data.itemWorkTime);
            data.workEndTime = strList[i][9];

            bagitemsdata_.Add(data.itemid, data);
        }
    }
Esempio n. 3
0
    /// <summary>
    /// 读取游戏数据表
    /// </summary>
    public void LoadGameDataFile()
    {
        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, GameDefine.GameCsvFileName, out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            GameData gamedata = new GameData();
            byte.TryParse(strList[i][0], out gamedata.GameID);

            gamedata.GameName       = strList[i][1];
            gamedata.GameIcon       = strList[i][2];
            gamedata.GameSceneName  = strList[i][3];
            gamedata.SceneABName    = strList[i][4];
            gamedata.ResourceABName = strList[i][5];
            byte.TryParse(strList[i][7], out gamedata.BundleTotalSize);
            gamedata.GameTextIcon = strList[i][9];

            GameDataDictionary.Add(gamedata.GameID, gamedata);
        }

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, "MasterLevCsv", out strList);
        columnCount = strList.Count;
        float min;

        for (int i = 2; i < columnCount; i++)
        {
            float.TryParse(strList[i][0], out min);
            MasterLvDictionary.Add(min, strList[i][2]);
        }
        MasterLvDictionary = MasterLvDictionary.OrderByDescending(o => o.Key).ToDictionary(o => o.Key, p => p.Value);
    }
Esempio n. 4
0
    public void ReadAudioCsvData(byte gameId, string configFile)
    {
        m_nGameId = gameId;

        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, configFile, out strList);

        m_SoundList.Clear();
        int columnCount = strList.Count;
        int id          = 0;

        for (int i = 2; i < columnCount; i++)
        {
            int.TryParse(strList[i][0], out id);
            m_SoundList.Add(id, strList[i][1]);
        }
    }
Esempio n. 5
0
    /// <summary>
    /// 读取游戏界面数据表
    /// </summary>
    public void LoadGameUICsvFile()
    {
        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, GameDefine.GameUIFileName, out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            CGameUIData GameUIData = new CGameUIData();

            GameUIData.HorizontalPrefab = strList[i][1];
            GameUIData.VerticalPrefab   = strList[i][2];

            GameUIDataDictionary.Add(strList[i][0], GameUIData);
        }
    }
Esempio n. 6
0
    void LoadContestRuleData(string name /* = "ContestRuleData.csv" */)
    {
        ruleData_.Clear();

        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, name, out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < strList.Count; i++)
        {
            stContestRuleData data = new stContestRuleData();
            uint.TryParse(strList[i][0], out data.nContestRuleID);
            byte contestruletype;
            byte.TryParse(strList[i][1], out contestruletype);
            data.enContestRuleType = (ContestRuleType)contestruletype;
            byte.TryParse(strList[i][2], out data.byContestRoundCount);
            uint.TryParse(strList[i][3], out data.nContestRoundTime);
            uint.TryParse(strList[i][4], out data.nContestRoundGameNum);

            string[] strverc = strList[i][5].Split('|');
            for (int index = 0; index < strverc.Length; index++)
            {
                int temp;
                int.TryParse(strverc[index], out temp);
                data.vecPreliminaryRuleParma.Add(temp);
            }

            string[] scoreverc = strList[i][7].Split('|');
            for (int index = 0; index < scoreverc.Length; index++)
            {
                float temp;
                float.TryParse(scoreverc[index], out temp);
                data.vecScoreCarryParma.Add(temp);
            }

            byte.TryParse(strList[i][8], out data.byDeskDivideRule);

            data.infomation = strList[i][9];

            ruleData_.Add(data.nContestRuleID, data);
        }
    }
Esempio n. 7
0
    /// <summary>
    /// 读取提示表
    /// </summary>
    public void LoadVipCsvFile()
    {
        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, GameDefine.VipCsvFileName, out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            VipData vipdata = new VipData();
            uint.TryParse(strList[i][0], out vipdata.VipLv);

            vipdata.VipPrice = strList[i][1];
            vipdata.Discount = strList[i][2];

            VipDataDictionary.Add(vipdata.VipLv, vipdata);
        }
    }
Esempio n. 8
0
    void LoadMatchAudioCsv()
    {
        audioconfig.Clear();

        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, "MatchAudioCsv", out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            AudioData data = new AudioData();

            uint.TryParse(strList[i][0], out data.id);
            data.name = strList[i][1];

            audioconfig.Add(data.id, data);
        }
    }
Esempio n. 9
0
    /// <summary>
    /// 读取提示表
    /// </summary>
    public void LoadTipsCsvFile()
    {
        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, GameDefine.TipsCsvFileName, out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            TipsData tipsdata = new TipsData();
            uint.TryParse(strList[i][0], out tipsdata.TipsID);

            tipsdata.TipsTitle = strList[i][1];
            tipsdata.TipsText  = strList[i][2];


            TipsDataDictionary.Add(tipsdata.TipsID, tipsdata);
        }
    }
Esempio n. 10
0
    /// <summary>
    /// 读取商品表
    /// </summary>
    public void LoadShopItemDataFile()
    {
        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, GameDefine.ShopCsvFileName, out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            ShopItemdata itemData = new ShopItemdata();
            uint.TryParse(strList[i][0], out itemData.ItemID);

            byte type;
            byte.TryParse(strList[i][1], out type);
            itemData.BelongShopType = (Shop.SHOPTYPE)type;

            byte.TryParse(strList[i][2], out type);
            itemData.ItemType = (Shop.ITEMTYPE)type;

            itemData.ItemIcon = strList[i][3];
            itemData.ItemName = strList[i][4];
            uint.TryParse(strList[i][5], out itemData.ItemNum);
            uint.TryParse(strList[i][6], out itemData.PresentItemNum);
            uint.TryParse(strList[i][7], out itemData.ItemPrice);

            byte.TryParse(strList[i][8], out type);
            itemData.CurrencyType = (Shop.CURRENCYTYPE)type;

            uint.TryParse(strList[i][9], out itemData.SpecilSign);

            int shoptype = (int)(itemData.BelongShopType);
            if (!ShopKindsItemList.ContainsKey(shoptype))
            {
                ShopKindsItemList.Add(shoptype, new List <uint>());
            }
            ShopKindsItemList[shoptype].Add(itemData.ItemID);
            ShopItemDataDictionary.Add(itemData.ItemID, itemData);
        }
    }
Esempio n. 11
0
    void ReadSelfContestCSVData()
    {
        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, GameDefine.SelfContestFileName, out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            SelfContestCSVData data = new SelfContestCSVData();
            byte.TryParse(strList[i][0], out data.gameid);
            for (int index = 1; index < 4; index++)
            {
                int temp = 0;
                int.TryParse(strList[i][index], out temp);
                data.datas.Add(temp);
            }

            selfcontestcsvs.Add(data.gameid, data);
        }
    }
Esempio n. 12
0
    void LoadRewardSchemeData(string name /* = "RewardSchemeData.csv" */)
    {
        rewardData_.Clear();
        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, name, out strList);
        int columnCount = strList.Count;

        for (int i = 2; i < strList.Count; i++)
        {
            uint RewardDataId;
            uint.TryParse(strList[i][0], out RewardDataId);
            CContestRewardData  pReward   = GetRewardDataById(RewardDataId);
            stRankingRewardData pRinkData = new stRankingRewardData();
            uint.TryParse(strList[i][1], out pRinkData.nRankingBegin);
            uint.TryParse(strList[i][2], out pRinkData.nRankingEnd);
            float.TryParse(strList[i][3], out pRinkData.fMasterReward);
            uint.TryParse(strList[i][4], out pRinkData.nRechargeCoinReward);
            uint.TryParse(strList[i][5], out pRinkData.nRechargeCoinPercent);
            uint.TryParse(strList[i][6], out pRinkData.nMoneyCommonReward);
            uint.TryParse(strList[i][7], out pRinkData.nChargeMoneyReward);
            float.TryParse(strList[i][8], out pRinkData.fRedbegReward);
            uint.TryParse(strList[i][9], out pRinkData.nRewardItem1Id);
            uint.TryParse(strList[i][10], out pRinkData.nRewardItem1Num);
            uint.TryParse(strList[i][11], out pRinkData.nRewardItem2Id);
            uint.TryParse(strList[i][12], out pRinkData.nRewardItem2Num);
            uint.TryParse(strList[i][13], out pRinkData.nRewardItem3Id);
            uint.TryParse(strList[i][14], out pRinkData.nRewardItem3Num);
            pRinkData.nRewardContent = strList[i][15];

            if (pReward == null)
            {
                pReward = new CContestRewardData();
                pReward.nRewardSchemeID = RewardDataId;
                rewardData_.Add(RewardDataId, pReward);
            }
            pReward.vecRankingReward.Add(pRinkData);
        }
    }
Esempio n. 13
0
    private void LoadGuildCsvData()
    {
        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, GameDefine.ClubFileName, out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            GuildCsvData csvdata = new GuildCsvData();
            byte.TryParse(strList[i][0], out csvdata.ClubLv);
            csvdata.ClubLevelName = strList[i][1];
            long.TryParse(strList[i][2], out csvdata.ClubMinExp);
            short.TryParse(strList[i][3], out csvdata.MaxPlayer);
            byte.TryParse(strList[i][4], out csvdata.AttenuationCycle);
            long.TryParse(strList[i][5], out csvdata.AttenuationNum);
            csvdata.Discount = strList[i][6];
            long.TryParse(strList[i][7], out csvdata.GiveLimit);

            m_GuildCsvData.Add(csvdata);
        }
    }
Esempio n. 14
0
    void ReadBetData()
    {
        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, "Game21BetCsv.txt", out strList);
        int columnCount = strList.Count;
        int j;

        for (int i = 2; i < columnCount; i++)
        {
            j = 0;
            BetData gamedata = new BetData();
            int.TryParse(strList[i][j++], out gamedata.m_nMin);
            int.TryParse(strList[i][j++], out gamedata.m_nKickout);

            for (int k = 0; k < gamedata.m_nGrades.Length; k++)
            {
                int.TryParse(strList[i][j++], out gamedata.m_nGrades[k]);
            }

            m_BetData.Add(gamedata);
        }
    }
Esempio n. 15
0
    void ReadFishingData()
    {
        List <string[]> strList;
        int             j;
        byte            id;
        ushort          pathId;
        byte            temp;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, "Fishing_Cannon.txt", out strList);
        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            j = 0;
            FishingCannonData gamedata = new FishingCannonData();
            byte.TryParse(strList[i][j++], out id);
            gamedata.m_szCannon = strList[i][j++];
            gamedata.m_szBullet = strList[i][j++];
            float.TryParse(strList[i][j++], out gamedata.m_fBulletSpeed);
            float.TryParse(strList[i][j++], out gamedata.m_fBulletCD);
            float.TryParse(strList[i][j++], out gamedata.m_fBulletLifeTime);
            byte.TryParse(strList[i][j++], out gamedata.m_nBounceTimes);
            //float.TryParse(strList[i][j++], out gamedata.m_fExplosinRange);
            j++;
            gamedata.m_szNet = strList[i][j++];
            //int.TryParse(strList[i][j++], out gamedata.m_nBulletCost);
            j++;

            //level not read
            j++;

            gamedata.m_szBulletPoint = strList[i][j++].Split('|');
            gamedata.m_szLvPoint     = strList[i][j++];
            //gamedata.m_szIcon = strList[i][j++];
            j++;
            int.TryParse(strList[i][j++], out gamedata.m_nAudio);

            j += 2;
            gamedata.m_szName   = strList[i][j++];
            gamedata.m_szDetail = strList[i][j++];

            m_CannonData[id] = gamedata;
        }

        strList.Clear();
        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, "Fishing_Path.txt", out strList);
        columnCount = strList.Count;
        for (int i = 2; i < columnCount; i++)
        {
            j = 0;
            FishingPathData gamedata = new FishingPathData();
            ushort.TryParse(strList[i][j++], out pathId);
            gamedata.m_szPath = strList[i][j++];
            float.TryParse(strList[i][j++], out gamedata.m_fSpeed);
            float.TryParse(strList[i][j++], out gamedata.m_fTime);
            byte.TryParse(strList[i][j++], out temp);
            gamedata.m_bLoop = temp == 0 ? false : true;
            string str = strList[i][j++];
            if (!string.IsNullOrEmpty(str))
            {
                string[] offsets = str.Split('@');
                string[] point;
                foreach (string oft in offsets)
                {
                    point = oft.Split('|');
                    Debug.Assert(point.Length == 3, "offset point coordinate wrong(not 3)!!");
                    Vector3 pos = new Vector3();
                    float.TryParse(point[0], out pos.x);
                    float.TryParse(point[1], out pos.y);
                    float.TryParse(point[2], out pos.z);
                    gamedata.m_Offsets.Add(pos);
                }
            }
            str = strList[i][j++];
            if (!string.IsNullOrEmpty(str))
            {
                string[] speedChange = str.Split('@');
                string[] info;
                foreach (string sc in speedChange)
                {
                    info = sc.Split('|');
                    Debug.Assert(info.Length == 3, "point change speed info is wrong(not 3)!!");
                    byte  pointIndex, endIndex;
                    float speed, time;
                    byte.TryParse(info[0], out pointIndex);
                    float.TryParse(info[1], out speed);
                    if (speed == 0f)//pause
                    {
                        float.TryParse(info[2], out time);
                        gamedata.m_ChangePoints[pointIndex] = -time;
                    }
                    else//change speed
                    {
                        byte.TryParse(info[2], out endIndex);
                        gamedata.m_ChangePoints[pointIndex] = speed;
                        gamedata.m_ChangePoints[endIndex]   = 1f;//change back
                    }
                }
            }


            m_PathData[pathId] = gamedata;
        }

        strList.Clear();
        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, "Fishing_Fish.txt", out strList);
        columnCount = strList.Count;
        for (int i = 2; i < columnCount; i++)
        {
            j = 0;
            FishingFishData gamedata = new FishingFishData();
            byte.TryParse(strList[i][j++], out id);
            gamedata.m_szFish = strList[i][j++];

            string[] groupspeed = strList[i][j++].Split('@');
            string[] speedStr;
            foreach (string speed in groupspeed)
            {
                speedStr = speed.Split('|');
                Debug.Assert(speedStr.Length == 2, "group speed data is wrong(not 2)!!");
                gamedata.m_GroupSpeed[byte.Parse(speedStr[0])] = float.Parse(speedStr[1]);
            }

            //float.TryParse(strList[i][j++], out gamedata.m_fHitRate);
            j++;
            int.TryParse(strList[i][j++], out gamedata.m_nMultiple);

            j += 5;
            int.TryParse(strList[i][j++], out gamedata.m_nHitAudio);
            int.TryParse(strList[i][j++], out gamedata.m_nDeadAudio);

            string[] strs = strList[i][j++].Split('|');
            if (strs.Length == 3)
            {
                byte.TryParse(strs[0], out gamedata.m_nTalkInterval);
                byte.TryParse(strs[1], out gamedata.m_nTalkShowTime);
                gamedata.m_szTalk = strs[2];
            }

            j += 3;

            byte.TryParse(strList[i][j++], out temp);
            gamedata.m_eFishType = (FishType)temp;
            gamedata.m_szName    = strList[i][j++];
            gamedata.m_szIcon    = strList[i][j++];

            byte.TryParse(strList[i][j++], out gamedata.m_nRotType);

            m_FishData[id] = gamedata;
        }
    }
Esempio n. 16
0
    void ReadConstDataConfig(string name)
    {
        contestData.Clear();

        List <string[]> strList;

        CReadCsvBase.ReaderCsvDataFromAB(GameDefine.CsvAssetbundleName, name, out strList);

        int columnCount = strList.Count;

        for (int i = 2; i < columnCount; i++)
        {
            stContestData data = new stContestData();

            uint.TryParse(strList[i][0], out data.nContestDataID);
            data.sContestName = strList[i][1];
            byte.TryParse(strList[i][2], out data.byGameID);
            ushort.TryParse(strList[i][3], out data.nGamePlayerNum);
            byte contesttype;
            byte.TryParse(strList[i][4], out contesttype);
            data.enContestType = (ContestType)contesttype;
            byte contestkind;
            byte.TryParse(strList[i][5], out contestkind);
            data.enContestKind = (ContestKind)contestkind;
            byte organiserstype;
            byte.TryParse(strList[i][6], out organiserstype);
            data.enOrganisersType = (ContestOrganisersType)organiserstype;
            byte contestopencycle;
            byte.TryParse(strList[i][7], out contestopencycle);
            data.enContestOpenCycle = (ContestOpenCycle)contestopencycle;

            string[] strverc = strList[i][8].Split('|');
            for (int index = 0; index < strverc.Length; index++)
            {
                byte temp;
                byte.TryParse(strverc[index], out temp);
                data.vecContestDate.Add(temp);
            }
            //string[] Admissionverc = strList[i][9].Split('|');
            //for (int index = 0; i < Admissionverc.Length; index++)
            //{
            //    stConstestTime paddata;
            //    sscanf(Admissionverc[i].c_str(), "%d:%d", &paddata.ContestHour, &paddata.ContestMin);
            //    pData->vecAdmissionHour.push_back(paddata);
            //}

            //std::vector < std::string> startcontestverc = StdAndFile::Split(tab[i][10], "|");
            //for (int i = 0; i < startcontestverc.size(); i++)
            //{
            //    stConstestTime phodata;
            //    sscanf(startcontestverc[i].c_str(), "%d:%d", &phodata.ContestHour, &phodata.ContestMin);
            //    pData->vecContestHour.push_back(phodata);
            //}

            int.TryParse(strList[i][10], out data.nExhibitionTime);
            int.TryParse(strList[i][11], out data.nEnrollStartTime);
            uint.TryParse(strList[i][13], out data.nMaxEnrollPlayerNum);
            uint.TryParse(strList[i][14], out data.nMinEnrollPlayerNum);
            uint.TryParse(strList[i][15], out data.nEnrollReputationMiniNum);
            uint.TryParse(strList[i][16], out data.nEnrollMasterMiniNum);
            uint.TryParse(strList[i][17], out data.nEnrollNamelistID);
            uint.TryParse(strList[i][18], out data.nEnrollItemID);
            uint.TryParse(strList[i][19], out data.nEnrollItemNum);
            uint.TryParse(strList[i][20], out data.nEnrollRechargeCoin);
            //uint.TryParse(strList[i][21], out data.nEnrollMoneyNum);

            ushort.TryParse(strList[i][21], out data.shPreliminaryRuleID);
            ushort.TryParse(strList[i][22], out data.shFinalsRuleID);

            uint.TryParse(strList[i][23], out data.nContestBeginBroadcastID);
            uint.TryParse(strList[i][24], out data.nChampionBroadcastID);
            uint.TryParse(strList[i][25], out data.nRewardDataID);
            //uint.TryParse(strList[i][26], out data.nContestQualificationBuyID);
            data.iconname           = strList[i][26];
            data.nContestRule       = strList[i][27];
            data.nContestRuleDetail = strList[i][28];
            data.playmode           = strList[i][29];
            data.playmodeicon       = strList[i][30];
            data.resetDetail        = strList[i][31];
            data.ticketIcon         = strList[i][32];
            data.reward             = strList[i][36];

            contestData.Add(data.nContestDataID, data);
        }
    }