• 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
 
I'll get the lastest sources from OTHire and implement Cast System for you guys !!!
Maybe I'll add Guild War too...
that would be amazing bro :D
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
gz by the way if you fix the problem about packet header 97 tell me or if u are using the sources that i did send you, well anyway @Nottinghster is going to release it done and with guild war system so :D i'll be waiting for that one :O
 
that would be amazing bro :D

gz by the way if you fix the problem about packet header 97 tell me or if u are using the sources that i did send you, well anyway @Nottinghster is going to release it done and with guild war system so :D i'll be waiting for that one :O
im using the latest source files i used your files to compare some lines errors and im very glad that you did it because i were stuck
i fix it i will share the fix with you because a promes its a promes bro
im going to check it now i just don't know how to edit the schema.mysql (i would ask your db but they are bit different. anyway can you upload yours please? im very excited and want to check it now) my db has GM x-RAY VISION 0.3 have not :/
pd: here its the code change yours by mine protoocolgame.cpp
void ProtocolGame::parsePacket(NetworkMessage &msg)
https://ghostbin.com/paste/gdxjr
@Olddies
 
that would be amazing bro :D

gz by the way if you fix the problem about packet header 97 tell me or if u are using the sources that i did send you, well anyway @Nottinghster is going to release it done and with guild war system so :D i'll be waiting for that one :O
i got bug packet header 06 XD :/ i'lll keep trying
also i walk but at the other windows the character is just standing that happened to you?(i have not updated the db yet)
Code:
mysql_real_query(): UPDATE `players` SET `level` = 50, `vocation` = 0, `health` = 100, `healthmax` = 100, `direction` = 2, `experience` = 1847300, `lookbody` = 114, `lookfeet` = 112, `lookhead` = 77, `looklegs` = 0, `looktype` = 239, `maglevel` = 4, `mana` = 100, `manamax` = : MYSQL ERROR: Unknown column 'cast' in 'field list'
mysql_real_query(): UPDATE `players` SET `level` = 50, `vocation` = 0, `health` = 100, `healthmax` = 100, `direction` = 2, `experience` = 1847300, `lookbody` = 114, `lookfeet` = 112, `lookhead` = 77, `looklegs` = 0, `looktype` = 239, `maglevel` = 4, `mana` = 100, `manamax` = : MYSQL ERROR: Unknown column 'cast' in 'field list'
mysql_real_query(): UPDATE `players` SET `level` = 50, `vocation` = 0, `health` = 100, `healthmax` = 100, `direction` = 2, `experience` = 1847300, `lookbody` = 114, `lookfeet` = 112, `lookhead` = 77, `looklegs` = 0, `looktype` = 239, `maglevel` = 4, `mana` = 100, `manamax` = : MYSQL ERROR: Unknown column 'cast' in 'field list'
mysql_real_query(): UPDATE `players` SET `level` = 50, `vocation` = 0, `health` = 100, `healthmax` = 100, `direction` = 2, `experience` = 1847300, `lookbody` = 114, `lookfeet` = 112, `lookhead` = 77, `looklegs` = 0, `looktype` = 239, `maglevel` = 4, `mana` = 100, `manamax` = : MYSQL ERROR: Unknown column 'cast' in 'field list'
Error while saving player: GM Sample
 
i got bug packet header 06 XD :/ i'lll keep trying
also i walk but at the other windows the character is just standing that happened to you?(i have not updated the db yet)
what u did click for the packet header 06? since mine was 97 and no when i try the cast the characters moves good without problems
 
:/ same issue i walk in the other windows nothing happened the char just stand :/ that happened to you?also i have unkown packet header error 06 XD
i gonna take a shower and ill keep trying
 
maybe we should wait to @Nottinghster release the othire one with cast and guild war since i was trying by my self how to figure out that but didnt have luck.. and i didnt try it anymore xdd
don't give up mate these things take time
i solved the issue regardless the walking issue at my sources
now i going to focus on the issue related to the new channels issue
 
Why does spectators type with the same name as the player that they are spectating?
How do i give spectators their "spectator name", such as "Spectator 1, 2, 3 etc"???

Anyone can help?
 
Why does spectators type with the same name as the player that they are spectating?
How do i give spectators their "spectator name", such as "Spectator 1, 2, 3 etc"???

Anyone can help?
lol i never noticed about it, i can't help you bru, you can compare the sources with otx2 to check where you should do the changes, GL
 
Is it stable like OTHire, or how is it compared to it?
pretty good and it has more features tought i remade the npc system(with remade i mean i change npc.cpp and.h + libs for the ones of othire as example) on it and change npc libs because default files related to npcs are trash

but you must know that otx2 has it disvantages ..... its not really support on otland forums as othire is
 
Last edited:
Back
Top