Exemplo n.º 1
0
    static int GetSeason(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        LadderConfig obj  = (LadderConfig)LuaScriptMgr.GetNetObjectSelf(L, 1, "LadderConfig");
        uint         arg0 = (uint)LuaScriptMgr.GetNumber(L, 2);
        LadderSeason o    = obj.GetSeason(arg0);

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
Exemplo n.º 2
0
    public void ReadSeason()
    {
        string text = ResourceLoadManager.Instance.GetConfigText(name2);

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

        XmlDocument xmlDoc   = CommonFunction.LoadXmlConfig(GlobalConst.DIR_XML_LADDER_SEASON, text);
        XmlNodeList nodelist = xmlDoc.SelectSingleNode("Data").ChildNodes;

        foreach (XmlElement xe in nodelist)
        {
            XmlNode comment = xe.SelectSingleNode(GlobalConst.CONFIG_SWITCH_COLUMN);
            if (comment != null && comment.InnerText == GlobalConst.CONFIG_SWITCH)
            {
                continue;
            }
            LadderSeason season = new LadderSeason();
            foreach (XmlElement xel in xe)
            {
                if (xel.Name == "season")
                {
                    uint.TryParse(xel.InnerText, out season.season);
                }
                else if (xel.Name == "start_time")
                {
                    string   date  = xel.InnerText.Split(' ')[0];
                    string[] items = date.Split('-');

                    uint.TryParse(items[0], out season.startYear);
                    uint.TryParse(items[1], out season.startMonth);
                    uint.TryParse(items[2], out season.startDay);
                }
                else if (xel.Name == "end_time")
                {
                    string   date  = xel.InnerText.Split(' ')[0];
                    string[] items = date.Split('-');

                    uint.TryParse(items[0], out season.endYear);
                    uint.TryParse(items[1], out season.endMonth);
                    uint.TryParse(items[2], out season.endDay);
                }
            }
            seasons.Add(season.season, season);
        }
    }
Exemplo n.º 3
0
    static int _CreateLadderSeason(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

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

        return(0);
    }
Exemplo n.º 4
0
    static int get_startYear(IntPtr L)
    {
        object       o   = LuaScriptMgr.GetLuaObject(L, 1);
        LadderSeason obj = (LadderSeason)o;

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

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

        LuaScriptMgr.Push(L, obj.startYear);
        return(1);
    }
Exemplo n.º 5
0
    static int set_endDay(IntPtr L)
    {
        object       o   = LuaScriptMgr.GetLuaObject(L, 1);
        LadderSeason obj = (LadderSeason)o;

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

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

        obj.endDay = (uint)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }