Example #1
0
    static int GetMapGroupDataByID(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        MapConfig    obj  = (MapConfig)LuaScriptMgr.GetNetObjectSelf(L, 1, "MapConfig");
        uint         arg0 = (uint)LuaScriptMgr.GetNumber(L, 2);
        MapGroupData o    = obj.GetMapGroupDataByID(arg0);

        LuaScriptMgr.PushObject(L, o);
        return(1);
    }
Example #2
0
    static int _CreateMapGroupData(IntPtr L)
    {
        int count = LuaDLL.lua_gettop(L);

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

        return(0);
    }
Example #3
0
    void ReadData()
    {
        string text = ResourceLoadManager.Instance.GetConfigText(GlobalConst.DIR_XML_MAP);

        if (text == null)
        {
            Debug.LogError("LoadConfig failed: " + GlobalConst.DIR_XML_MAP);
            return;
        }
        XmlDocument doc  = CommonFunction.LoadXmlConfig(GlobalConst.DIR_XML_MAP, text);
        XmlNode     root = doc.SelectSingleNode("Data");

        foreach (XmlNode line in root.SelectNodes("Line"))
        {
            if (CommonFunction.IsCommented(line))
            {
                continue;
            }
            MapGroupData groupData = new MapGroupData();
            uint         index     = uint.Parse(line.SelectSingleNode("id").InnerText);
            groupData.id        = index;
            groupData.groupName = line.SelectSingleNode("squad_name").InnerText;
            string roleIds = line.SelectSingleNode("squad_ids").InnerText;
            if (roleIds != null && roleIds != "")
            {
                string[] roles = roleIds.Split('&');
                foreach (var id in roles)
                {
                    groupData.groupIDs.Add(uint.Parse(id));
                }
            }
            groupData.attrID   = uint.Parse(line.SelectSingleNode("attr_id").InnerText);
            groupData.attrNum  = uint.Parse(line.SelectSingleNode("attr_num").InnerText);
            groupData.describe = line.SelectSingleNode("describe").InnerText;

            mapConfig.Add(index, groupData);
            mapConfigList.Add(index);
        }
        //SortMapList();
    }
Example #4
0
    static int get_groupName(IntPtr L)
    {
        object       o   = LuaScriptMgr.GetLuaObject(L, 1);
        MapGroupData obj = (MapGroupData)o;

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

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

        LuaScriptMgr.Push(L, obj.groupName);
        return(1);
    }
Example #5
0
    static int set_attrNum(IntPtr L)
    {
        object       o   = LuaScriptMgr.GetLuaObject(L, 1);
        MapGroupData obj = (MapGroupData)o;

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

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

        obj.attrNum = (uint)LuaScriptMgr.GetNumber(L, 3);
        return(0);
    }
Example #6
0
    static int set_describe(IntPtr L)
    {
        object       o   = LuaScriptMgr.GetLuaObject(L, 1);
        MapGroupData obj = (MapGroupData)o;

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

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

        obj.describe = LuaScriptMgr.GetString(L, 3);
        return(0);
    }
Example #7
0
    static int set_groupIDs(IntPtr L)
    {
        object       o   = LuaScriptMgr.GetLuaObject(L, 1);
        MapGroupData obj = (MapGroupData)o;

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

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

        obj.groupIDs = (List <uint>)LuaScriptMgr.GetNetObject(L, 3, typeof(List <uint>));
        return(0);
    }