• 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++ Same problem at this guy on compile 0.4 with pingfunction

ezeriel

New Member
Joined
Feb 26, 2017
Messages
12
Reaction score
1
I'm trying to add the same ping function at this guy from this topic:
Compiling - Help to add ping functions on 0.4

On 0.4...
He fixed, but i'm not...

My folders:
luascript.cpp
hastebin

luascript.h
hastebin

protocolgame.h
hastebin

Errors at compile:
Code:
In file included from player.h:33:0,
                 from party.h:20,
                 from chat.h:24,
                 from chat.cpp:18:
protocolgame.h:209:8: error: ‘void ProtocolGame::sendPing()’ cannot be overloaded
   void sendPing();
        ^
In file included from player.h:33:0,
                 from party.h:20,
                 from chat.h:24,
                 from chat.cpp:18:
protocolgame.h:76:8: error: with ‘void ProtocolGame::sendPing()’
   void sendPing(); // Xeraphus
        ^
In file included from player.h:33:0,
                 from actions.cpp:23:
protocolgame.h:209:8: error: ‘void ProtocolGame::sendPing()’ cannot be overloaded
   void sendPing();
        ^
In file included from player.h:33:0,
                 from actions.cpp:23:
protocolgame.h:76:8: error: with ‘void ProtocolGame::sendPing()’
   void sendPing(); // Xeraphus
        ^
In file included from player.h:33:0,
                 from house.h:27,
                 from beds.cpp:20:
protocolgame.h:209:8: error: ‘void ProtocolGame::sendPing()’ cannot be overloaded
   void sendPing();
        ^
In file included from player.h:33:0,
                 from house.h:27,
                 from beds.cpp:20:
protocolgame.h:76:8: error: with ‘void ProtocolGame::sendPing()’
   void sendPing(); // Xeraphus
        ^
Makefile:547: recipe for target 'chat.o' failed
 
Solution
luascript.cpp:
hastebin

Code:
luascript.cpp: In static member function ‘static int32_t LuaInterface::luaPlayerSendPing(lua_State*)’:
luascript.cpp:10194:21: warning: ‘client’ may be used uninitialized in this function [-Wmaybe-uninitialized]
   client->sendPing();
                     ^
mv -f .deps/map.Tpo .deps/map.Po

protocolgame.cpp:
hastebin

Code:
protocolgame.cpp: In member function ‘void ProtocolGame::AddCreatureSpeak(NetworkMessage_ptr, const Creature*, SpeakClasses, std::__cxx11::string, uint16_t, uint32_t, Position*, ProtocolGame*)’:
protocolgame.cpp:2972:158: warning: suggest parentheses around ‘&&’ within ‘||’ [-Wparentheses]
   if(speaker && type != SPEAK_RVR_ANSWER && !speaker->isAccountManager() &&...
But does it compile or does it stop after the warning?
Can you re-do the build and copy / take SS of the full log you got in putty.
 
Back
Top