Someone can help me with this?
I got this error when i try compile with cast codes...
I think the error is here:
TFS 1.3, someone know why?
I got this error when i try compile with cast codes...
Code:
[ 1%] Building CXX object CMakeFiles/tfs.dir/src/actions.cpp.o
In file included from /root/cast/forgottenserver/src/game.h:31:0,
from /root/cast/forgottenserver/src/actions.cpp:26:
/root/cast/forgottenserver/src/player.h: In member function ‘bool Player::startLiveCast(const string&)’:
/root/cast/forgottenserver/src/player.h:1145:68: error: invalid static_cast from type ‘ProtocolGame_ptr {aka std::shared_ptr<ProtocolGame>}’ to type ‘ProtocolCaster*’
return client != nullptr && static_cast<ProtocolCaster*>(client)->startLiveCast(password);
^
/root/cast/forgottenserver/src/player.h: In member function ‘bool Player::stopLiveCast()’:
/root/cast/forgottenserver/src/player.h:1149:68: error: invalid static_cast from type ‘ProtocolGame_ptr {aka std::shared_ptr<ProtocolGame>}’ to type ‘ProtocolCaster*’
return client != nullptr && static_cast<ProtocolCaster*>(client)->stopLiveCast();
^
/root/cast/forgottenserver/src/player.h: In member function ‘bool Player::isLiveCaster() const’:
/root/cast/forgottenserver/src/player.h:1153:68: error: invalid static_cast from type ‘const ProtocolGame_ptr {aka const std::shared_ptr<ProtocolGame>}’ to type ‘ProtocolCaster*’
return client != nullptr && static_cast<ProtocolCaster*>(client)->isLiveCaster();
^
make[2]: *** [CMakeFiles/tfs.dir/src/actions.cpp.o] Error 1
make[1]: *** [CMakeFiles/tfs.dir/all] Error 2
make: *** [all] Error 2
I think the error is here:
Code:
const std::map<uint8_t, OpenContainer>& getOpenContainers() const {
return openContainers;
}
bool startLiveCast(const std::string& password) {
return client != nullptr && static_cast<ProtocolCaster*>(client)->startLiveCast(password);
}
bool stopLiveCast() {
return client != nullptr && static_cast<ProtocolCaster*>(client)->stopLiveCast();
}
bool isLiveCaster() const {
return client != nullptr && static_cast<ProtocolCaster*>(client)->isLiveCaster();
}
TFS 1.3, someone know why?