Beispiel #1
0
        // POST: api/Tour
        public IHttpActionResult Post([FromBody] TourSearch valFilter)
        {
            string    vResult   = "3";
            ITourData vTourData = new TourData();

            try {
                bool vNullField = VerifyNullFiledsSearch(valFilter);

                if (vNullField)
                {
                    vResult = "1";
                    return(ResponseMessage(Request.CreateResponse(HttpStatusCode.OK, new { Code = HttpStatusCode.NotAcceptable, Message = Messages.vListContainNullValue, Result = vResult })));
                }
                string vResponse = vTourData.SelectByCity(valFilter);

                if (!string.IsNullOrEmpty(vResponse))
                {
                    return(ResponseMessage(Request.CreateResponse(HttpStatusCode.OK, new { Code = HttpStatusCode.OK, Message = Messages.vOkListed, Result = vResponse })));
                }
                vResult = "2";
                return(ResponseMessage(Request.CreateResponse(HttpStatusCode.OK, new { Code = HttpStatusCode.NoContent, Message = Messages.vNotListed, Result = vResult })));
            } catch (Exception) {
                return(ResponseMessage(Request.CreateResponse(HttpStatusCode.BadRequest, new { Code = HttpStatusCode.BadRequest, Message = Messages.vInternalServerError, Result = vResult })));
            }
        }
Beispiel #2
0
 private void LoadDefaults()
 {
     if (GameState.instance.Tour.CurrentTourID == 0)
     {
         TourData firstTour = GameData.instance.TourDataList[0];
         GameState.instance.Tour.CurrentTourID = firstTour.id;
     }
 }
Beispiel #3
0
        public override global::System.Data.DataSet Clone()
        {
            TourData cln = ((TourData)(base.Clone()));

            cln.InitVars();
            cln.SchemaSerializationMode = this.SchemaSerializationMode;
            return(cln);
        }
Beispiel #4
0
    public AttrData GetTourNPCAttrData(uint NPCID, uint id)
    {
        uint      position;
        NPCConfig npcConfig = GetConfigData(NPCID);

        if (npcConfig != null)
        {
            position = npcConfig.position;
        }
        else
        {
            position = (uint)(GameSystem.Instance.RoleBaseConfigData2.GetConfigData(NPCID).position);
        }
        uint     level    = MainPlayer.Instance.Level;
        AttrData attr     = new AttrData();
        AttrData npcattr  = TourNpcs.Find(x => x.position == position && x.level == level).attrs;
        TourData tourData = GameSystem.Instance.TourConfig.GetTourData(level, id);
        uint     basic    = (uint)(Random.Range((int)tourData.baseAttrLower, (int)tourData.baseAttrUpper + 1));
        float    hedging  = Random.Range(tourData.hedgingAttrLower, tourData.hedgingAttrUpper);

        attr.attrs["shoot_near"]              = npcattr.attrs["shoot_near"] + basic;
        attr.attrs["shoot_middle"]            = npcattr.attrs["shoot_middle"] + basic;
        attr.attrs["shoot_far"]               = npcattr.attrs["shoot_far"] + basic;
        attr.attrs["dunk_near"]               = npcattr.attrs["dunk_near"] + basic;
        attr.attrs["dunk_middle"]             = npcattr.attrs["dunk_middle"] + basic;
        attr.attrs["layup_near"]              = npcattr.attrs["layup_near"] + basic;
        attr.attrs["layup_middle"]            = npcattr.attrs["layup_middle"] + basic;
        attr.attrs["anti_disturb"]            = (uint)(npcattr.attrs["anti_disturb"] * hedging);
        attr.attrs["pass"]                    = (uint)(npcattr.attrs["pass"] * hedging);
        attr.attrs["control"]                 = (uint)(npcattr.attrs["control"] * hedging);;
        attr.attrs["block"]                   = (uint)(npcattr.attrs["block"] * hedging);
        attr.attrs["anti_block"]              = (uint)(npcattr.attrs["anti_block"] * hedging);
        attr.attrs["steal"]                   = (uint)(npcattr.attrs["steal"] * hedging);
        attr.attrs["disturb"]                 = (uint)(npcattr.attrs["disturb"] * hedging);
        attr.attrs["rebound"]                 = (uint)(npcattr.attrs["rebound"] * hedging);
        attr.attrs["speed"]                   = npcattr.attrs["speed"] + basic;
        attr.attrs["strength"]                = (uint)(npcattr.attrs["strength"] * hedging);
        attr.attrs["interception"]            = (uint)(npcattr.attrs["interception"] * hedging);
        attr.attrs["ph"]                      = npcattr.attrs["ph"] + basic;
        attr.attrs["rebound_height"]          = npcattr.attrs["rebound_height"];
        attr.attrs["cross_speed"]             = npcattr.attrs["cross_speed"];
        attr.attrs["shoot_far_dist"]          = npcattr.attrs["shoot_far_dist"];
        attr.attrs["bodythrowcatch_distance"] = npcattr.attrs["bodythrowcatch_distance"];
        attr.attrs["bodythrowcatch_prob"]     = npcattr.attrs["bodythrowcatch_prob"];

        Debug.Log("================================================NPC:" + NPCID);
        Debug.Log("shoot_near:" + attr.attrs["shoot_near"]);
        Debug.Log("shoot_middle:" + attr.attrs["shoot_middle"]);
        Debug.Log("anti_disturb:" + attr.attrs["anti_disturb"]);
        Debug.Log("steal:" + attr.attrs["steal"]);
        Debug.Log("rebound:" + attr.attrs["rebound"]);
        Debug.Log("disturb:" + attr.attrs["disturb"]);
        Debug.Log("strength:" + attr.attrs["strength"]);
        //return TourNpcs.Find(x => x.position == NPCDatas[NPCID].position && x.level == MainPlayer.Instance.Level).attrs;
        return(attr);
    }
Beispiel #5
0
    static int GetTourData(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        TourConfig obj  = (TourConfig)LuaScriptMgr.GetNetObjectSelf(L, 1, "TourConfig");
        uint       arg0 = (uint)LuaScriptMgr.GetNumber(L, 2);
        uint       arg1 = (uint)LuaScriptMgr.GetNumber(L, 3);
        TourData   o    = obj.GetTourData(arg0, arg1);

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
Beispiel #6
0
        public static global::System.Xml.Schema.XmlSchemaComplexType GetTypedDataSetSchema(global::System.Xml.Schema.XmlSchemaSet xs)
        {
            TourData ds = new TourData();

            global::System.Xml.Schema.XmlSchemaComplexType type     = new global::System.Xml.Schema.XmlSchemaComplexType();
            global::System.Xml.Schema.XmlSchemaSequence    sequence = new global::System.Xml.Schema.XmlSchemaSequence();
            global::System.Xml.Schema.XmlSchemaAny         any      = new global::System.Xml.Schema.XmlSchemaAny();
            any.Namespace = ds.Namespace;
            sequence.Items.Add(any);
            type.Particle = sequence;
            global::System.Xml.Schema.XmlSchema dsSchema = ds.GetSchemaSerializable();
            if (xs.Contains(dsSchema.TargetNamespace))
            {
                global::System.IO.MemoryStream s1 = new global::System.IO.MemoryStream();
                global::System.IO.MemoryStream s2 = new global::System.IO.MemoryStream();
                try {
                    global::System.Xml.Schema.XmlSchema schema = null;
                    dsSchema.Write(s1);
                    for (global::System.Collections.IEnumerator schemas = xs.Schemas(dsSchema.TargetNamespace).GetEnumerator(); schemas.MoveNext();)
                    {
                        schema = ((global::System.Xml.Schema.XmlSchema)(schemas.Current));
                        s2.SetLength(0);
                        schema.Write(s2);
                        if ((s1.Length == s2.Length))
                        {
                            s1.Position = 0;
                            s2.Position = 0;
                            for (; ((s1.Position != s1.Length) &&
                                    (s1.ReadByte() == s2.ReadByte()));)
                            {
                                ;
                            }
                            if ((s1.Position == s1.Length))
                            {
                                return(type);
                            }
                        }
                    }
                }
                finally {
                    if ((s1 != null))
                    {
                        s1.Close();
                    }
                    if ((s2 != null))
                    {
                        s2.Close();
                    }
                }
            }
            xs.Add(dsSchema);
            return(type);
        }
Beispiel #7
0
    public TourData GetTourData(uint level, uint ID)
    {
        Dictionary <uint, TourData> levelTours = null;

        if (tours.TryGetValue(level, out levelTours))
        {
            TourData tour = null;
            if (levelTours.TryGetValue(ID, out tour))
            {
                return(tour);
            }
        }
        return(null);
    }
Beispiel #8
0
    public bool setCurrentTour(int tourId)
    {
        currentTour = data.FindTourById(tourId);

        if (currentTour != null)
        {
            Debug.Log("Tour: " + currentTour.id + " started.");
            return(true);
        }
        else
        {
            Debug.Log("TourID not found: " + tourId.ToString());
            return(false);
        }
    }
    static int _CreateTourData(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

        if (count == 0)
        {
            TourData obj = new TourData();
            LuaScriptMgr.PushObject(L, obj);
            return(1);
        }
        else
        {
            LuaDLL.luaL_error(L, "invalid arguments to method: TourData.New");
        }

        return(0);
    }
Beispiel #10
0
        // GET: api/Tour/5
        public IHttpActionResult Get(Guid id)
        {
            string    vResult   = "3";
            ITourData vTourData = new TourData();

            if (VerifyNullGuid(id))
            {
                vResult = "1";
                return(ResponseMessage(Request.CreateResponse(HttpStatusCode.NotAcceptable, new { Code = HttpStatusCode.NotAcceptable, Message = Messages.vListContainNullValue, Result = vResult })));
            }
            string vResponse = vTourData.OrderByRanking(id);

            if (string.IsNullOrEmpty(vResponse))
            {
                vResult = "2";
                return(ResponseMessage(Request.CreateResponse(HttpStatusCode.OK, new { Code = HttpStatusCode.NoContent, Message = Messages.vNotListed, Result = vResult })));
            }

            return(ResponseMessage(Request.CreateResponse(HttpStatusCode.OK, new { Code = HttpStatusCode.OK, Message = Messages.vOkListed, Result = vResponse })));
        }
Beispiel #11
0
    static int set_gameModeID(IntPtr L)
    {
        object   o   = LuaScriptMgr.GetLuaObject(L, 1);
        TourData obj = (TourData)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name gameModeID");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index gameModeID on a nil value");
            }
        }

        obj.gameModeID = (uint)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }
Beispiel #12
0
    static int set_star(IntPtr L)
    {
        object   o   = LuaScriptMgr.GetLuaObject(L, 1);
        TourData obj = (TourData)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name star");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index star on a nil value");
            }
        }

        obj.star = (List <uint>)LuaScriptMgr.GetNetObject(L, 3, typeof(List <uint>));
        return(0);
    }
Beispiel #13
0
    static int get_ID(IntPtr L)
    {
        object   o   = LuaScriptMgr.GetLuaObject(L, 1);
        TourData obj = (TourData)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name ID");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index ID on a nil value");
            }
        }

        LuaScriptMgr.Push(L, obj.ID);
        return(1);
    }
Beispiel #14
0
    static int set_hedgingAttrUpper(IntPtr L)
    {
        object   o   = LuaScriptMgr.GetLuaObject(L, 1);
        TourData obj = (TourData)o;

        if (obj == null)
        {
            LuaTypes types = LuaDLL.lua_type(L, 1);

            if (types == LuaTypes.LUA_TTABLE)
            {
                LuaDLL.luaL_error(L, "unknown member name hedgingAttrUpper");
            }
            else
            {
                LuaDLL.luaL_error(L, "attempt to index hedgingAttrUpper on a nil value");
            }
        }

        obj.hedgingAttrUpper = (float)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }
    private List <TourData> LoadTourData()
    {
        currentSheet = "TourData";
        currentRows  = dataReader.GetRows(currentSheet);

        List <TourData> tourDataList = new List <TourData>();

        int rowNum = currentRows.Count;

        for (int i = 0; i < rowNum; i++)
        {
            TourData tourDataObject = new TourData();

            TryLoadInt(i, "ID", out tourDataObject.id);
            TryLoadInt(i, "Level", out tourDataObject.level);
            TryLoadFloat(i, "CoinMultiplier", out tourDataObject.coinMultiplier);
            TryLoadFloat(i, "FanMultiplier", out tourDataObject.fanMultiplier);
            TryLoadFloat(i, "TapMultiplier", out tourDataObject.tapMultiplier);
            TryLoadInt(i, "FanRequirementToSkip", out tourDataObject.fanRequirementToSkip);
            tourDataList.Add(tourDataObject);
        }

        return(tourDataList);
    }
    private void OnPrestige(TourData tour)
    {
        currencyState.Coins = 0;
        currencyState.Fans = 0;
        currencyState.AddTapMultiplier(tour.tapStrengthMultiplier);

        currencyState.SynchronizeRealCurrencyAndScreenCurrency();
    }
    private List<TourData> LoadTourData()
    {
        currentSheet = "TourData";
        currentRows = dataReader.GetRows(currentSheet);

        List<TourData> tourDataList = new List<TourData>();

        int rowNum = currentRows.Count;
        for (int i = 0; i < rowNum; i++)
        {
            TourData tourDataObject = new TourData();

            TryLoadInt(i, "ID", out tourDataObject.id);
            TryLoadInt(i, "Level", out tourDataObject.level);
            TryLoadFloat(i, "CoinMultiplier", out tourDataObject.coinMultiplier);
            TryLoadFloat(i, "FanMultiplier", out tourDataObject.fanMultiplier);
            TryLoadFloat(i, "TapMultiplier", out tourDataObject.tapMultiplier);
            TryLoadInt(i, "FanRequirementToSkip", out tourDataObject.fanRequirementToSkip);
            tourDataList.Add(tourDataObject);
        }

        return tourDataList;
    }
Beispiel #18
0
    public void EndCurrentTour()
    {
        EndCurrentPackage();

        currentTour = null;
    }
Beispiel #19
0
    void ReadTourConfig()
    {
        string text = ResourceLoadManager.Instance.GetConfigText(name1);

        if (text == null)
        {
            Debug.LogError("LoadConfig failed: " + name1);
            return;
        }

        tours.Clear();

        //读取以及处理XML文本的类
        XmlDocument xmlDoc = CommonFunction.LoadXmlConfig(GlobalConst.DIR_XML_TOUR, text);
        //解析xml的过程
        XmlNode root = xmlDoc.SelectSingleNode("Data");

        foreach (XmlNode line in root)
        {
            XmlNode comment = line.SelectSingleNode(GlobalConst.CONFIG_SWITCH_COLUMN);
            if (comment != null && comment.InnerText == GlobalConst.CONFIG_SWITCH)
            {
                continue;
            }

            uint level = uint.Parse(line.SelectSingleNode("level").InnerText);
            Dictionary <uint, TourData> levelTours = null;
            if (!tours.TryGetValue(level, out levelTours))
            {
                levelTours = new Dictionary <uint, TourData>();
                tours.Add(level, levelTours);
            }
            uint ID = uint.Parse(line.SelectSingleNode("id").InnerText);
            if (levelTours.ContainsKey(ID))
            {
                Debug.LogError("TourConfig, tour config already existed. Level: " + level + " ID: " + ID);
            }

            TourData tour = new TourData();
            tour.level = level;
            tour.ID    = ID;

            string[] tokens = line.SelectSingleNode("attr_lower_limit").InnerText.Split('&');
            tour.baseAttrLower    = uint.Parse(tokens[0]);
            tour.hedgingAttrLower = float.Parse(tokens[1]);
            tokens                = line.SelectSingleNode("attr_upper_limit").InnerText.Split('&');
            tour.baseAttrUpper    = uint.Parse(tokens[0]);
            tour.hedgingAttrUpper = float.Parse(tokens[1]);

            tour.challengeConsume = uint.Parse(line.SelectSingleNode("challenge_consume").InnerText);

            tokens = line.SelectSingleNode("win_awards").InnerText.Split('&');
            foreach (string token in tokens)
            {
                if (!string.IsNullOrEmpty(token))
                {
                    uint id = uint.Parse(token);
                    if (id != 0)
                    {
                        tour.winAwards.Add(id);
                    }
                }
            }
            tokens = line.SelectSingleNode("fail_awards").InnerText.Split('&');
            foreach (string token in tokens)
            {
                if (!string.IsNullOrEmpty(token))
                {
                    uint id = uint.Parse(token);
                    if (id != 0)
                    {
                        tour.failAwards.Add(id);
                    }
                }
            }

            tour.gameModeID = uint.Parse(line.SelectSingleNode("game_mode_id").InnerText);

            for (int i = 1; i <= 3; i++)
            {
                string node = "quality_star" + i;
                tokens = line.SelectSingleNode(node).InnerText.Split('&');
                string t = tokens[0];
                if (!string.IsNullOrEmpty(t))
                {
                    tour.quality.Add(uint.Parse(t));
                }

                t = tokens[1];
                if (!string.IsNullOrEmpty(t))
                {
                    tour.star.Add(uint.Parse(t));
                }
            }
            levelTours.Add(tour.ID, tour);
        }
    }