• 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!

Solved [Cast Sytem for OTHIRE 1.0] error C2228: left of '.empty' must have class/struct/union

Felipe93

Ghost Member
Joined
Mar 21, 2015
Messages
2,035
Solutions
9
Reaction score
357
Location
Chile
Hello Otlanders

well im trying to add cast system to OTHIRE 1.0
i copied the code that @Nottinghster posted at this thread
[8.6x] OTServ 0.6.4 (Cast System)
i know i copy paste // edited everything properly but im having certain troubles
i searched for some solutions at google but i don't understand how to re-write those lines to delete these errors

the problem its related to Protocolgame.cpp and protocollogin.cpp
Code:
>source\protocollogin.cpp(96): error C2228: left of '.empty' must have class/struct/union
1>          type is 'uint32_t'
1>  rsa.cpp
1>source\protocolgame.cpp(409): error C2228: left of '.empty' must have class/struct/union
1>          type is 'uint32_t'

can anyone help me please?
maybe @Ezzz , @ond @Peonso ?

here it's the protocolgame.cpp file
https://ghostbin.com/paste/4vk4f
Code:
bool castAccount = false;
    if(accnumber.empty()) {  ERROR HERE (ACCNUMBER)
        if(g_config.getBoolean(ConfigManager::ENABLE_CAST))
            castAccount = true;
         else {
            g_bans.addLoginAttempt(getIP(), false);
            getConnection()->closeConnection();
            return false;
        }
    }


and here protocollogin.cpp file
https://ghostbin.com/paste/gp49z

Code:
if(accnumber.empty()){ ERROR HERE (ACCNUMBER)
        if(g_config.getBoolean(ConfigManager::ENABLE_CAST))
            castAccount = true;
        else {
            //Tibia sends this message if the account name length is < 5
            //We will send it only if account name is BLANK
            disconnectClient(0x0A, "Invalid Account Name.");
        return false;
        }
    }


AHH PLUS SOME ERRORS RELATED TO LIB REGARDING PROTOCOLGAME.CPP AND PROTOCOLLOGIN.CPP
Code:
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1>          C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *)
1>          ]
1>          source\protocolgame.cpp(669) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *),
1>              L=boost::_bi::list2<boost::_bi::value<Game *>,boost::_bi::value<uint32_t>>
1>          ]
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2039: 'result_type' : is not a member of '`global namespace''
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2146: syntax error : missing ';' before identifier 'type'
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2208: 'boost::_bi::type' : no members defined using this type
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): fatal error C1903: unable to recover from previous error(s); stopping compilation


regards and thanks in advance
 
accnumber == 0

Edit: not sure what would happen if you put zero as an account number though, else wise you need to change the type of the account number from uint32_t to reference
 
Last edited:
woow the errors lines were deleted at the documents but im still having issues

protocollogin.cpp
Code:
if(accnumber == 0()) {
        if(g_config.getBoolean(ConfigManager::ENABLE_CAST))
            castAccount = true;
        else {

protocolgame.cpp
Code:
bool castAccount = false;
    if(accnumber == 0()) {
        if(g_config.getBoolean(ConfigManager::ENABLE_CAST))
            castAccount = true;
         else {
            g_bans.addLoginAttempt(getIP(), false);
            getConnection()->closeConnection();
            return false;
        }
    }

Code:
1>source\protocollogin.cpp(96): warning C4353: nonstandard extension used: constant 0 as function expression.  Use '__noop' function intrinsic instead
1>source\protocolgame.cpp(409): warning C4353: nonstandard extension used: constant 0 as function expression.  Use '__noop' function intrinsic instead
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1>          C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1>          with
1>          [

do you have discord @ond ?

full error log
Code:
1>source\protocollogin.cpp(96): warning C4353: nonstandard extension used: constant 0 as function expression.  Use '__noop' function intrinsic instead
1>source\protocolgame.cpp(409): warning C4353: nonstandard extension used: constant 0 as function expression.  Use '__noop' function intrinsic instead
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1>          C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *)
1>          ]
1>          source\protocolgame.cpp(670) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *),
1>              L=boost::_bi::list2<boost::_bi::value<Game *>,boost::_bi::value<uint32_t>>
1>          ]
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2039: 'result_type' : is not a member of '`global namespace''
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2146: syntax error : missing ';' before identifier 'type'
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2208: 'boost::_bi::type' : no members defined using this type
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): fatal error C1903: unable to recover from previous error(s); stopping compilation
 
woow the errors lines were deleted at the documents but im still having issues

protocollogin.cpp
Code:
if(accnumber == 0()) {
        if(g_config.getBoolean(ConfigManager::ENABLE_CAST))
            castAccount = true;
        else {

protocolgame.cpp
Code:
bool castAccount = false;
    if(accnumber == 0()) {
        if(g_config.getBoolean(ConfigManager::ENABLE_CAST))
            castAccount = true;
         else {
            g_bans.addLoginAttempt(getIP(), false);
            getConnection()->closeConnection();
            return false;
        }
    }

Code:
1>source\protocollogin.cpp(96): warning C4353: nonstandard extension used: constant 0 as function expression.  Use '__noop' function intrinsic instead
1>source\protocolgame.cpp(409): warning C4353: nonstandard extension used: constant 0 as function expression.  Use '__noop' function intrinsic instead
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1>          C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1>          with
1>          [

do you have discord @ond ?

full error log
Code:
1>source\protocollogin.cpp(96): warning C4353: nonstandard extension used: constant 0 as function expression.  Use '__noop' function intrinsic instead
1>source\protocolgame.cpp(409): warning C4353: nonstandard extension used: constant 0 as function expression.  Use '__noop' function intrinsic instead
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1>          C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *)
1>          ]
1>          source\protocolgame.cpp(670) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *),
1>              L=boost::_bi::list2<boost::_bi::value<Game *>,boost::_bi::value<uint32_t>>
1>          ]
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2039: 'result_type' : is not a member of '`global namespace''
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2146: syntax error : missing ';' before identifier 'type'
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2208: 'boost::_bi::type' : no members defined using this type
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): fatal error C1903: unable to recover from previous error(s); stopping compilation
i didnt make a pull request because my files when u try to open a new channel it gives unknow header packet sen f97 and disconnect the player from the game, the cast is working well but now i encounter that problem so i'm looking around if it is my custom client or what right now im compiling it so i can test with normal tibia client in my own computer... i'm using tibianic client and it send differents packets to the server maybe is that

EDIT

after i compiled again the error still there

Unknown packet header: 97, player GM Legacy
@MartyX

i did look into protocolgame.cpp and i did look for the packet

Code:
        case 0x97: // request Channels
            addGameTask(&Game::playerRequestChannels, player->getID(), this);
            break;

so atm i dont know whats going on xD
 
Last edited:
i didnt make a pull request because my files when u try to open a new channel it gives unknow header packet sen f97 and disconnect the player from the game, the cast is working well but now i encounter that problem so i'm looking around if it is my custom client or what right now im compiling it so i can test with normal tibia client in my own computer... i'm using tibianic client and it send differents packets to the server maybe is that

EDIT

after i compiled again the error still there

Unknown packet header: 97, player GM Legacy

i did look into protocolgame.cpp and i did look for the packet

Code:
        case 0x97: // request Channels
            addGameTask(&Game::playerRequestChannels, player->getID(), this);
            break;

so atm i dont know whats going on xD
but how did you solve or what you did to solve? the issues that im suffering while im compiling? because i can't get the exe and you did maybe we can test this together (pd: i solved the questlog issue at the tibianic client)
 
but how did you solve or what you did to solve? the issues that im suffering while im compiling? because i can't get the exe and you did maybe we can test this together (pd: i solved the questlog issue at the tibianic client)
i did solved the questlog too is the same thing as the questlog with the tibianic client but now here is when you hit open new channel, and you are asking me how i did solved the error for compiling i dont know xD i just did follow the guide like 100 times adding and deletting things because the sources of @Nottinghster is for 8.60 and othire have alot of diferent codes
 
i did solved the questlog too is the same thing as the questlog with the tibianic client but now here is when you hit open new channel, and you are asking me how i did solved the error for compiling i dont know xD i just did follow the guide like 100 times adding and deletting things because the sources of @Nottinghster is for 8.60 and othire have alot of diferent codes
Could you check these lines please?
protocollogin.cpp
Code (Text):
  1. if(accnumber == 0()) {
  2. if(g_config.getBoolean(ConfigManager::ENABLE_CAST))
  3. castAccount = true;
  4. else {
protocolgame.cpp
Code (Text):
  1. bool castAccount = false;
  2. if(accnumber == 0()) {
  3. if(g_config.getBoolean(ConfigManager::ENABLE_CAST))
  4. castAccount = true;
  5. else {
  6. g_bans.addLoginAttempt(getIP(), false);
  7. getConnection()->closeConnection();
  8. return false;
  9. }
  10. }
im stuck there
 
here you have the sources bro if you fix the problem tell me how xD im stuck
thank you very much i'll check c:
ill be in touch with you to try to solve the issue with new with im pretty sure its something related to protocolgame.cpp

and ofc i will men
 
Could you check these lines please?
protocollogin.cpp
Code (Text):
  1. if(accnumber == 0()) {
  2. if(g_config.getBoolean(ConfigManager::ENABLE_CAST))
  3. castAccount = true;
  4. else {
protocolgame.cpp
Code (Text):
  1. bool castAccount = false;
  2. if(accnumber == 0()) {
  3. if(g_config.getBoolean(ConfigManager::ENABLE_CAST))
  4. castAccount = true;
  5. else {
  6. g_bans.addLoginAttempt(getIP(), false);
  7. getConnection()->closeConnection();
  8. return false;
  9. }
  10. }
im stuck there
your problem is not there your problem was in line 1297 and down so maybe my problem is there too i just saw now something about new channel in that line
 
your problem is not there your problem was in line 1297 and down so maybe my problem is there too i just saw now something about new channel in that line
that another problem :/ the main ones are line 96 and 409
bro your sources works but im suffering problem with the libs can you post your lib folder please?
im using othire 1.0 and i noticed that you used 0.0.3
 
i'm using this libs
Code:
https://github.com/TwistedScorpio/OTHire/wiki/Compiling-under-Windows-(Visual-Studio-2010)
and following the same guide for compile
didn't you do changes at the libs files? im suffrering problem with libs
specifically at bind.hpp and bind_template.hpp

Code:
>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1>          C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *)
1>          ]
1>          source\protocolgame.cpp(519) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *),
1>              L=boost::_bi::list2<boost::_bi::value<Game *>,boost::_bi::value<uint32_t>>
1>          ]
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2039: 'result_type' : is not a member of '`global namespace''
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2146: syntax error : missing ';' before identifier 'type'
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): error C2208: 'boost::_bi::type' : no members defined using this type
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\OTHIRE\libraries\inc\boost\boost/bind/bind.hpp(69): fatal error C1903: unable to recover from previous error(s); stopping compilation
 
Last edited:
make a new project and do it with my sources i dont know what is going on
:/ i did again im suffreing the same issues

Code:
  raids.cpp
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1>          C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *)
1>          ]
1>          source\protocolgame.cpp(519) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *),
1>              L=boost::_bi::list2<boost::_bi::value<Game *>,boost::_bi::value<uint32_t>>
1>          ]
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind.hpp(69): error C2039: 'result_type' : is not a member of '`global namespace''
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind.hpp(69): error C2146: syntax error : missing ';' before identifier 'type'
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind.hpp(69): error C2208: 'boost::_bi::type' : no members defined using this type
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind.hpp(69): fatal error C1903: unable to recover from previous error(s); stopping compilation
1>  rsa.cpp

i'll keep trying tomorrow i used the othire lib 0.0.3 now
 
:/ i did again im suffreing the same issues

Code:
  raids.cpp
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind.hpp(69): error C2825: 'F': must be a class or namespace when followed by '::'
1>          C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind_template.hpp(15) : see reference to class template instantiation 'boost::_bi::result_traits<R,F>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *)
1>          ]
1>          source\protocolgame.cpp(519) : see reference to class template instantiation 'boost::_bi::bind_t<R,F,L>' being compiled
1>          with
1>          [
1>              R=boost::_bi::unspecified,
1>              F=bool (__thiscall Game::* )(uint32_t,ProtocolGame *),
1>              L=boost::_bi::list2<boost::_bi::value<Game *>,boost::_bi::value<uint32_t>>
1>          ]
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind.hpp(69): error C2039: 'result_type' : is not a member of '`global namespace''
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind.hpp(69): error C2146: syntax error : missing ';' before identifier 'type'
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind.hpp(69): error C2208: 'boost::_bi::type' : no members defined using this type
1>C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE-CAST\OTHIRE-CAST\libraries\inc\boost\boost/bind/bind.hpp(69): fatal error C1903: unable to recover from previous error(s); stopping compilation
1>  rsa.cpp

i'll keep trying tomorrow i used the othire lib 0.0.3 now
i dontt know then bro that are the sources i'm using right now and the libs from othire use his protocolgame.cpp ////////////////////////////////////////////////////////////////////// // OpenT - Pastebin.com
 
I'll get the lastest sources from OTHire and implement Cast System for you guys !!!
Maybe I'll add Guild War too...
WUAJAJJAA
FINNALY I SOLVED IT
Code:
1>------ Build started: Project: OTHIRE, Configuration: Release Win32 ------
1>  protocolgame.cpp
1>  Generating code
1>  Finished generating code
1>  OTHIRE.vcxproj -> C:\Users\Cheng Zhi\Documents\Visual Studio 2010\Projects\OTHIRE\Release\OTHIRE.exe
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 0 skipped ==========

I GOING TO TEST bugs now but do it if you can or have time i have a trouble while i was implemeiung your code i had to remove my custom outfits :/ dunno why
thanks @Nottinghster to @Olddies too because i compared some wrong line that i had at my protocolgame.cpp lines
TwistedScorpio/OTHire
 
Last edited:
Back
Top