• 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!
  • 2026 staff recruitment is open! Check it out and consider applying!

C++ Embedded proxy

klenio0

New Member
Joined
May 10, 2010
Messages
85
Reaction score
1
I am trying to implement this code on my server, but when I compile an error appears.

Feature - Embedded proxy in your server.


error:

Building CXX object CMakeFiles/tfs.dir/src/protocollogin.cpp.o
/home/proxy/src/protocollogin.cpp: In member function ‘void ProtocolLogin::addWorldInfo(OutputMessage_ptr&, const string&, const string&, uint16_t, bool)’:
/home/proxy/src/protocollogin.cpp:69:41: error: ‘account’ was not declared in this scope
auto proxyInfo = g_config.getProxyInfo(account.proxyId);
^
CMakeFiles/tfs.dir/build.make:1319: recipe for target 'CMakeFiles/tfs.dir/src/protocollogin.cpp.o' failed
make[2]: *** [CMakeFiles/tfs.dir/src/protocollogin.cpp.o] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/tfs.dir/all' failed
make[1]: *** [CMakeFiles/tfs.dir/all] Error 2
Makefile:76: recipe for target 'all' failed
make: *** [all] Error 2
 
did you put the code in addWorldInfo on accident? it should be inside of getCharacterList
forgottenserver/protocollogin.cpp at master · otland/forgottenserver · GitHub
you replace these 3 lines forgottenserver/protocollogin.cpp at master · otland/forgottenserver · GitHub
with this
C++:
auto proxyInfo = g_config.getProxyInfo(account.proxyId);
if (proxyInfo.first) {
    std::ostringstream ss;
    ss << g_config.getString(ConfigManager::SERVER_NAME) << " - " << proxyInfo.second.name;
    output->addString(ss.str());
    output->addString(proxyInfo.second.ip);
    output->add<uint16_t>(proxyInfo.second.port);
} else {
    output->addString(g_config.getString(ConfigManager::SERVER_NAME));
    output->addString(g_config.getString(ConfigManager::IP));
    output->add<uint16_t>(g_config.getNumber(ConfigManager::GAME_PORT));
}
 
Back
Top