• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

C++ Black Tek Server auras/wings

_M4G0_

Intermediate OT User
Joined
Feb 6, 2016
Messages
519
Solutions
16
Reaction score
102
i tried add auras and wings system on black teck server, but i couldnt, have this error
Code:
  unity_PV4WV16A2HJFQIXU.cpp
  unity_EFKQCKK6WWIP54DC.cpp
  unity_9SK63FI0YRRGU7SN.cpp
  unity_9NTLKJMJVLH2H2TO.cpp
d:\Downloads\BlackTek-Server-master\BlackTek-Server-master\src\weapons.h(168,18): warning C4242: 'argument': conversion from 'int32_t' to 'unsigned short', possible loss of data
  (compiling source file '../build/Release/obj/64/unity_9SK63FI0YRRGU7SN.cpp')
 
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: struct Aura * __cdecl Auras::getAuraByClientID(unsigned short)" (?getAuraByClientID@Auras@@QEAAPEAUAura@@G@Z)
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: struct Aura * __cdecl Auras::getAuraByName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?getAuraByName@Auras@@QEAAPEAUAura@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: bool __cdecl Auras::loadFromXml(void)" (?loadFromXml@Auras@@QEAA_NXZ)
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: bool __cdecl Auras::reload(void)" (?reload@Auras@@QEAA_NXZ)
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: struct Shader * __cdecl Shaders::getShaderByName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?getShaderByName@Shaders@@QEAAPEAUShader@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: struct Shader * __cdecl Shaders::getShaderByID(unsigned char)" (?getShaderByID@Shaders@@QEAAPEAUShader@@E@Z)
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: bool __cdecl Shaders::loadFromXml(void)" (?loadFromXml@Shaders@@QEAA_NXZ)
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: bool __cdecl Shaders::reload(void)" (?reload@Shaders@@QEAA_NXZ)
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: struct Wing * __cdecl Wings::getWingByClientID(unsigned short)" (?getWingByClientID@Wings@@QEAAPEAUWing@@G@Z)
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: struct Wing * __cdecl Wings::getWingByName(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > const &)" (?getWingByName@Wings@@QEAAPEAUWing@@AEBV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: bool __cdecl Wings::loadFromXml(void)" (?loadFromXml@Wings@@QEAA_NXZ)
unity_EFKQCKK6WWIP54DC.obj : error LNK2001: unresolved external symbol "public: bool __cdecl Wings::reload(void)" (?reload@Wings@@QEAA_NXZ)
unity_9SK63FI0YRRGU7SN.obj : error LNK2001: unresolved external symbol "public: struct Aura * __cdecl Auras::getAuraByID(unsigned char)" (?getAuraByID@Auras@@QEAAPEAUAura@@E@Z)
unity_9SK63FI0YRRGU7SN.obj : error LNK2001: unresolved external symbol "public: struct Wing * __cdecl Wings::getWingByID(unsigned char)" (?getWingByID@Wings@@QEAAPEAUWing@@E@Z)
.\Black-Tek-Server.exe : fatal error LNK1120: 14 unresolved externals
 
Solution
Looks like linker does not know that it has to link new files (auras, shaders and wings).
Only line that does anything with .cpp/.h files I've found is:
Lua:
files { "src/**.cpp", "src/**.h" }
IDK how Black Tek compilation looks like, but you probably have to start from first step of it, to make it detect new files using Premake.
Looks like linker does not know that it has to link new files (auras, shaders and wings).
Only line that does anything with .cpp/.h files I've found is:
Lua:
files { "src/**.cpp", "src/**.h" }
IDK how Black Tek compilation looks like, but you probably have to start from first step of it, to make it detect new files using Premake.
 
Solution
if anyone have problem to add system, i made these changes
auras.cpp
C++:
Aura* Auras::getAuraByName(const std::string& name) {
    auto auraName = name.c_str();
    for (auto& it : auras) {
        if (strcasecmp(auraName, it.name.c_str()) == 0) {
            return &it;
        }
    }

    return nullptr;
}
to
C++:
Aura* Auras::getAuraByName(const std::string& name) {
    for (auto& aura : auras) {
        if (caseInsensitiveEqual(name, aura.name)) {
            return &aura;
        }
    }
    return nullptr;
}
shaders.cpp
C++:
Shader* Shaders::getShaderByName(const std::string& name) {
    auto shaderName = name.c_str();
    for (auto& it : shaders) {
        if (strcasecmp(shaderName, it.name.c_str()) == 0) {
            return &it;
        }
    }

    return nullptr;
}
to
C++:
Shader* Shaders::getShaderByName(const std::string& name) {
    for (auto& shader : shaders) {
        if (caseInsensitiveEqual(name, shader.name)) {
            return &shader;
        }
    }
    return nullptr;
}
wings.cpp
C++:
Wing* Wings::getWingByName(const std::string& name) {
    auto wingName = name.c_str();
    for (auto& it : wings) {
        if (strcasecmp(wingName, it.name.c_str()) == 0) {
            return &it;
        }
    }

    return nullptr;
}
to
C++:
Wing* Wings::getWingByName(const std::string& name) {
    for (auto& wing : wings) {
        if (caseInsensitiveEqual(name, wing.name)) {
            return &wing;
        }
    }
    return nullptr;
}
Post automatically merged:

Looks like linker does not know that it has to link new files (auras, shaders and wings).
Only line that does anything with .cpp/.h files I've found is:
Lua:
files { "src/**.cpp", "src/**.h" }
IDK how Black Tek compilation looks like, but you probably have to start from first step of it, to make it detect new files using Premake.
thank Gesior, it works perfectly
 
This is awesome! I'm excited to see others using BlackTek-Server!

I don't mean to bump an already solved support thread, but I am curious, since you were able to successfully add wings and aura's support.... could you direct me to the code that you used? I mean, if its not private or something, I wouldn't mind looking at it as a possible feature to also add to BlackTek-Server master branch
 
Back
Top