Hello... Okay lets start... i got a function from the sources of 0.3.6TFS Crying damson.. it exactly are doSetItemAttribute, and i want to put it on my 7.6 server, but ofc there is a problem, when i try to compile it i get this error:
PLEASE READ CAREFULLY, I ALREADY COMPILE MY SERVER BY MYSELF WITH MY SOURCES, I THINK THAT TFS SOURCES ARE NOT COMPATIBLE WITH AVESTA... check the function:
In luascript.cpp
In luascript.h
aI can't put both files, they are too big... can you help me with this information?
Code:
In static member function 'static int32_t LuaScriptInterface::luaDoItemSetAttribute(lua_State*)':
1916 C:\sourceOriginal\luascript.cpp 'any' is not a member of 'boost'
1916 C:\sourceOriginal\luascript.cpp expected ';' before 'value'
1921 C:\sourceOriginal\luascript.cpp 'value' was not declared in this scope
1923 C:\sourceOriginal\luascript.cpp 'value' was not declared in this scope
1926 C:\sourceOriginal\luascript.cpp 'value' was not declared in this scope
1926 C:\sourceOriginal\luascript.cpp 'popBoolean' was not declared in this scope
1928 C:\sourceOriginal\luascript.cpp 'value' was not declared in this scope
1932 C:\sourceOriginal\luascript.cpp 'errorEx' was not declared in this scope
1939 C:\sourceOriginal\luascript.cpp 'getEnv' was not declared in this scope
1944 C:\sourceOriginal\luascript.cpp 'getError' was not declared in this scope
1949 C:\sourceOriginal\luascript.cpp 'value' was not declared in this scope
1949 C:\sourceOriginal\luascript.cpp 'value' was not declared in this scope
1953 C:\sourceOriginal\luascript.cpp expected primary-expression before '>' token
1956 C:\sourceOriginal\luascript.cpp 'errorEx' was not declared in this scope
1964 C:\sourceOriginal\luascript.cpp 'any_cast' is not a member of 'boost'
1964 C:\sourceOriginal\luascript.cpp expected primary-expression before '>' token
1966 C:\sourceOriginal\luascript.cpp 'class Item' has no member named 'setAttribute'
1966 C:\sourceOriginal\luascript.cpp 'any_cast' is not a member of 'boost'
1966 C:\sourceOriginal\luascript.cpp expected primary-expression before '>' token
1969 C:\sourceOriginal\luascript.cpp 'class Item' has no member named 'setAttribute'
1969 C:\sourceOriginal\luascript.cpp *** [obj/luascript.o] Error 1
PLEASE READ CAREFULLY, I ALREADY COMPILE MY SERVER BY MYSELF WITH MY SOURCES, I THINK THAT TFS SOURCES ARE NOT COMPATIBLE WITH AVESTA... check the function:
In luascript.cpp
Code:
int32_t LuaScriptInterface::luaDoItemSetAttribute(lua_State* L)
{
//doItemSetAttribute(uid, key, value)
boost::any value;
if(lua_isnumber(L, -1))
{
float tmp = popFloatNumber(L);
if(std::floor(tmp) < tmp)
value = tmp;
else
value = (int32_t)tmp;
}
else if(lua_isboolean(L, -1))
value = popBoolean(L);
else if(lua_isstring(L, -1))
value = popString(L);
else
{
lua_pop(L, 1);
errorEx("Invalid data type");
lua_pushboolean(L, false);
return 1;
}
std::string key = popString(L);
ScriptEnviroment* env = getEnv();
Item* item = env->getItemByUID(popNumber(L));
if(!item)
{
errorEx(getError(LUA_ERROR_ITEM_NOT_FOUND));
lua_pushboolean(L, false);
return 1;
}
if(value.type() == typeid(int32_t))
{
if(key == "uid")
{
int32_t tmp = boost::any_cast<int32_t>(value);
if(tmp < 1000 || tmp > 0xFFFF)
{
errorEx("Value for protected key \"uid\" must be in range of 1000 to 65535");
lua_pushboolean(L, false);
return 1;
}
item->setUniqueId(tmp);
}
else if(key == "aid")
item->setActionId(boost::any_cast<int32_t>(value));
else
item->setAttribute(key, boost::any_cast<int32_t>(value));
}
else
item->setAttribute(key, value);
lua_pushboolean(L, true);
return 1;
}
Code:
//doItemSetAttribute(uid, key, value)
lua_register(m_luaState, "doItemSetAttribute", LuaScriptInterface::luaDoItemSetAttribute);
In luascript.h
Code:
static int32_t luaDoItemSetAttribute(lua_State* L);
aI can't put both files, they are too big... can you help me with this information?