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

Errors when try to compile 0.4 with ping functions

warriorfrog

Active Member
Joined
Jul 29, 2015
Messages
334
Reaction score
35
I need to use a script to protect players against lag/ddos on 0.4.
I found a old here on forum, but it was to 0.3.6 and i have no knowledge to put it to work on 0.4
Is anyone could help me?
Everything i search here about it was requests not fixeds

What i did?
To use the script: GlobalEvent - Auto kick lagged players + DDoS protection (https://otland.net/threads/auto-kick-lagged-players-ddos-protection.121492/#post-1187916)
You need the lib: [Lua & C++] Ping lib -- ping.getPing(cid,storage) (https://otland.net/threads/lua-c-ping-lib-ping-getping-cid-storage.121183/)

And to you use the lib, need this C++ code:

But it's for 0.3.6, and i'm using 0.4

I found this guy converting to 0.4

Tried to use, but now its broke my source code and idk C++

So i tried this:
luascript.cpp

luascript.h

But got this errors:
Code:
luascript.cpp:7393:2: error: stray ‘\357’ in program
{��
  ^
luascript.cpp:7393:3: error: stray ‘\273’ in program
{��
   ^
luascript.cpp:7393:4: error: stray ‘\277’ in program
{�
    ^
luascript.cpp:7395:22: error: stray ‘\357’ in program
     ScriptEnviroment*�� env = getEnv();
                      ^
luascript.cpp:7395:23: error: stray ‘\273’ in program
     ScriptEnviroment*�� env = getEnv();
                       ^
luascript.cpp:7395:24: error: stray ‘\277’ in program
     ScriptEnviroment*� env = getEnv();
                        ^
luascript.cpp:7403:23: error: stray ‘\357’ in program
     player->lastPing =�� timeNow;
                       ^
luascript.cpp:7403:24: error: stray ‘\273’ in program
     player->lastPing =�� timeNow;
                        ^
luascript.cpp:7403:25: error: stray ‘\277’ in program
     player->lastPing =� timeNow;
                         ^
luascript.cpp:7403:26: error: stray ‘\357’ in program
     player->lastPing =�� timeNow;
                          ^
luascript.cpp:7403:27: error: stray ‘\273’ in program
     player->lastPing =�� timeNow;
                           ^
luascript.cpp:7403:28: error: stray ‘\277’ in program
     player->lastPing =� timeNow;
                            ^
luascript.cpp:7404:23: error: stray ‘\357’ in program
     if(player->client)��
                       ^
luascript.cpp:7404:24: error: stray ‘\273’ in program
     if(player->client)��
                        ^
luascript.cpp:7404:25: error: stray ‘\277’ in program
     if(player->client)�
                         ^
luascript.cpp:7407:24: error: stray ‘\357’ in program
             lua_pushboo��lean(L, true);
                        ^
luascript.cpp:7407:25: error: stray ‘\273’ in program
             lua_pushboo��lean(L, true);
                         ^
luascript.cpp:7407:26: error: stray ‘\277’ in program
             lua_pushboo�lean(L, true);
                          ^
luascript.cpp:7419:14: error: stray ‘\357’ in program
     return 1;��
              ^
luascript.cpp:7419:15: error: stray ‘\273’ in program
     return 1;��
               ^
luascript.cpp:7419:16: error: stray ‘\277’ in program
     return 1;�
                ^
luascript.cpp:7427:6: error: stray ‘\357’ in program
     {��
      ^
luascript.cpp:7427:7: error: stray ‘\273’ in program
     {��
       ^
luascript.cpp:7427:8: error: stray ‘\277’ in program
     {�
        ^
luascript.cpp:7429:24: error: stray ‘\357’ in program
          lua_pushboolea��n(L, false);
                        ^
luascript.cpp:7429:25: error: stray ‘\273’ in program
          lua_pushboolea��n(L, false);
                         ^
luascript.cpp:7429:26: error: stray ‘\277’ in program
          lua_pushboolea�n(L, false);
                          ^
luascript.cpp:7445:18: error: stray ‘\357’ in program
         return 1;��
                  ^
luascript.cpp:7445:19: error: stray ‘\273’ in program
         return 1;��
                   ^
luascript.cpp:7445:20: error: stray ‘\277’ in program
         return 1;�
                    ^
luascript.cpp:7446:6: error: stray ‘\357’ in program
     }��
      ^
luascript.cpp:7446:7: error: stray ‘\273’ in program
     }��
       ^
luascript.cpp:7446:8: error: stray ‘\277’ in program
     }�
        ^
luascript.cpp:7446:9: error: stray ‘\357’ in program
     }��
         ^
luascript.cpp:7446:10: error: stray ‘\273’ in program
     }��
          ^
luascript.cpp:7446:11: error: stray ‘\277’ in program
     }�
           ^
luascript.cpp:7447:30: error: stray ‘\357’ in program
     lua_pushnumber(L, player-��>lastPong);
                              ^
luascript.cpp:7447:31: error: stray ‘\273’ in program
     lua_pushnumber(L, player-��>lastPong);
                               ^
luascript.cpp:7447:32: error: stray ‘\277’ in program
     lua_pushnumber(L, player-�>lastPong);
                                ^
luascript.cpp: In static member function ‘static int32_t LuaInterface::luaDoPlayerSendPing(lua_State*)’:
luascript.cpp:7407:13: error: ‘lua_pushboo’ was not declared in this scope
             lua_pushboolean(L, true);
             ^~~~~~~~~~~
luascript.cpp: In static member function ‘static int32_t LuaInterface::luaGetPlayerLastPing(lua_State*)’:
luascript.cpp:7429:10: error: ‘lua_pushboolea’ was not declared in this scope
          lua_pushboolean(L, false);
          ^~~~~~~~~~~~~~
luascript.cpp:7432:13: warning: unused variable ‘timeNow’ [-Wunused-variable]
     int64_t timeNow = OTSYS_TIME();
             ^~~~~~~
luascript.cpp: In static member function ‘static int32_t LuaInterface::luaGetPlayerLastPong(lua_State*)’:
luascript.cpp:7447:33: error: expected primary-expression before ‘>’ token
     lua_pushnumber(L, player->lastPong);
                                 ^
luascript.cpp:7447:34: error: ‘lastPong’ was not declared in this scope
     lua_pushnumber(L, player->lastPong);
                                  ^~~~~~~~
Makefile:33: recipe for target 'luascript.o' failed
 
I tried the 0.3.6 ones

luascript.cpp

Code:
    // ping 1

    //doPlayerSendPing(cid)
    lua_register(m_luaState, "doPlayerSendPing", LuaScriptInterface::luadoPlayerSendPing);
    //getPlayerLastPing(cid)
    lua_register(m_luaState, "getPlayerLastPing", LuaScriptInterface::luagetPlayerLastPing);
    //getPlayerLastPong(cid)
    lua_register(m_luaState, "getPlayerLastPong", LuaScriptInterface::luagetPlayerLastPong);
    //getOtsysTime(cid)
    lua_register(m_luaState, "getOtsysTime", LuaScriptInterface::luagetOtsysTime);

    // /ping 1

Code:
// ping 2

int32_t LuaScriptInterface::luadoPlayerSendPing(lua_State* L)
{
    //doPlayerSendPing(cid)
    ScriptEnviroment* env = getEnv();
    Player* player = env->getPlayerByUID(popNumber(L));
    if(!player)
    {
        lua_pushboolean(L, false);
        return 1;
    }
    int64_t timeNow = OTSYS_TIME();
    player->lastPing = timeNow;
    if(player->client)
    {
             player->client->sendPing();
            lua_pushboolean(L, true);
    }else{
          lua_pushboolean(L, false);         
          }
    lua_pushboolean(L, true);

    return 1;
}
int32_t LuaScriptInterface::luagetOtsysTime(lua_State* L)
{
    //getOtsysTime()
    lua_pushnumber(L, OTSYS_TIME());
    return 1;
}
int32_t LuaScriptInterface::luagetPlayerLastPing(lua_State* L)
{
    //getPlayerLastPing(cid)
    ScriptEnviroment* env = getEnv();
    Player* player = env->getPlayerByUID(popNumber(L));
    if(!player)
    {
        errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
         lua_pushboolean(L, false); 
        return 1;
    }
    int64_t timeNow = OTSYS_TIME();
    lua_pushnumber(L, player->lastPing);
    return 1;
}
int32_t LuaScriptInterface::luagetPlayerLastPong(lua_State* L)
{
    //getPlayerLastPong(cid)
    ScriptEnviroment* env = getEnv();
    Player* player = env->getPlayerByUID(popNumber(L));
    if(!player)
    {
        errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
         lua_pushboolean(L, false); 
        return 1;
    }
    lua_pushnumber(L, player->lastPong);
    return 1;
}

// /ping 2

luascript.h

Code:
        // Ping
        static int32_t luadoPlayerSendPing(lua_State* L);
        static int32_t luagetPlayerLastPing(lua_State* L);
        static int32_t luagetPlayerLastPong(lua_State* L);
        static int32_t luagetOtsysTime(lua_State* L);

got this errors:

Code:
In file included from luascript.h:33:0,
                 from luascript.cpp:18:
luascript.cpp: In member function ‘virtual void LuaInterface::registerFunctions()’:
luascript.cpp:2092:47: error: ‘LuaScriptInterface’ has not been declared
  lua_register(m_luaState, "doPlayerSendPing", LuaScriptInterface::luadoPlayerSendPing);
                                               ^
/usr/include/lua5.1/lua.h:260:53: note: in definition of macro ‘lua_pushcfunction’
 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
                                                     ^
luascript.cpp:2092:2: note: in expansion of macro ‘lua_register’
  lua_register(m_luaState, "doPlayerSendPing", LuaScriptInterface::luadoPlayerSendPing);
  ^
luascript.cpp:2094:48: error: ‘LuaScriptInterface’ has not been declared
  lua_register(m_luaState, "getPlayerLastPing", LuaScriptInterface::luagetPlayerLastPing);
                                                ^
/usr/include/lua5.1/lua.h:260:53: note: in definition of macro ‘lua_pushcfunction’
 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
                                                     ^
luascript.cpp:2094:2: note: in expansion of macro ‘lua_register’
  lua_register(m_luaState, "getPlayerLastPing", LuaScriptInterface::luagetPlayerLastPing);
  ^
luascript.cpp:2096:48: error: ‘LuaScriptInterface’ has not been declared
  lua_register(m_luaState, "getPlayerLastPong", LuaScriptInterface::luagetPlayerLastPong);
                                                ^
/usr/include/lua5.1/lua.h:260:53: note: in definition of macro ‘lua_pushcfunction’
 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
                                                     ^
luascript.cpp:2096:2: note: in expansion of macro ‘lua_register’
  lua_register(m_luaState, "getPlayerLastPong", LuaScriptInterface::luagetPlayerLastPong);
  ^
luascript.cpp:2098:43: error: ‘LuaScriptInterface’ has not been declared
  lua_register(m_luaState, "getOtsysTime", LuaScriptInterface::luagetOtsysTime);
                                           ^
/usr/include/lua5.1/lua.h:260:53: note: in definition of macro ‘lua_pushcfunction’
 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
                                                     ^
luascript.cpp:2098:2: note: in expansion of macro ‘lua_register’
  lua_register(m_luaState, "getOtsysTime", LuaScriptInterface::luagetOtsysTime);
  ^
luascript.cpp: At global scope:
luascript.cpp:7394:9: error: ‘LuaScriptInterface’ has not been declared
 int32_t LuaScriptInterface::luadoPlayerSendPing(lua_State* L)
         ^~~~~~~~~~~~~~~~~~
luascript.cpp: In function ‘int32_t luadoPlayerSendPing(lua_State*)’:
luascript.cpp:7397:33: error: ‘getEnv’ was not declared in this scope
  ScriptEnviroment* env = getEnv();
                                 ^
luascript.cpp:7398:50: error: ‘popNumber’ was not declared in this scope
  Player* player = env->getPlayerByUID(popNumber(L));
                                                  ^
luascript.cpp:7405:13: error: ‘int64_t Player::lastPing’ is private within this context
     player->lastPing = timeNow;
             ^~~~~~~~
In file included from luascript.cpp:26:0:
player.h:1210:11: note: declared private here
   int64_t lastPing;
           ^~~~~~~~
luascript.cpp:7406:13: error: ‘ProtocolGame* Player::client’ is private within this context
  if(player->client)
             ^~~~~~
In file included from luascript.cpp:26:0:
player.h:1230:17: note: declared private here
   ProtocolGame* client;
                 ^~~~~~
luascript.cpp:7408:13: error: ‘ProtocolGame* Player::client’ is private within this context
     player->client->sendPing();
             ^~~~~~
In file included from luascript.cpp:26:0:
player.h:1230:17: note: declared private here
   ProtocolGame* client;
                 ^~~~~~
luascript.cpp:7408:30: error: ‘void ProtocolGame::sendPing()’ is private within this context
     player->client->sendPing();
                              ^
In file included from player.h:33:0,
                 from luascript.cpp:26:
protocolgame.h:205:8: note: declared private here
   void sendPing();
        ^~~~~~~~
luascript.cpp: At global scope:
luascript.cpp:7417:9: error: ‘LuaScriptInterface’ has not been declared
 int32_t LuaScriptInterface::luagetOtsysTime(lua_State* L)
         ^~~~~~~~~~~~~~~~~~
luascript.cpp:7423:9: error: ‘LuaScriptInterface’ has not been declared
 int32_t LuaScriptInterface::luagetPlayerLastPing(lua_State* L)
         ^~~~~~~~~~~~~~~~~~
luascript.cpp: In function ‘int32_t luagetPlayerLastPing(lua_State*)’:
luascript.cpp:7426:33: error: ‘getEnv’ was not declared in this scope
  ScriptEnviroment* env = getEnv();
                                 ^
luascript.cpp:7427:50: error: ‘popNumber’ was not declared in this scope
  Player* player = env->getPlayerByUID(popNumber(L));
                                                  ^
In file included from luascript.cpp:18:0:
luascript.cpp:7430:46: error: ‘getError’ was not declared in this scope
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
                                              ^
luascript.h:221:40: note: in definition of macro ‘errorEx’
 #define errorEx(a) error(__FUNCTION__, a)
                                        ^
luascript.h:221:41: error: ‘error’ was not declared in this scope
 #define errorEx(a) error(__FUNCTION__, a)
                                         ^
luascript.cpp:7430:3: note: in expansion of macro ‘errorEx’
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
   ^
luascript.h:221:41: note: suggested alternatives:
 #define errorEx(a) error(__FUNCTION__, a)
                                         ^
luascript.cpp:7430:3: note: in expansion of macro ‘errorEx’
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
   ^
In file included from /usr/include/boost/asio/detail/impl/posix_mutex.ipp:24:0,
                 from /usr/include/boost/asio/detail/posix_mutex.hpp:73,
                 from /usr/include/boost/asio/detail/mutex.hpp:25,
                 from /usr/include/boost/asio/detail/service_registry.hpp:20,
                 from /usr/include/boost/asio/impl/io_service.hpp:19,
                 from /usr/include/boost/asio/io_service.hpp:767,
                 from /usr/include/boost/asio/basic_io_object.hpp:19,
                 from /usr/include/boost/asio/basic_socket.hpp:20,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:20,
                 from /usr/include/boost/asio.hpp:21,
                 from otsystem.h:33,
                 from luascript.h:20,
                 from luascript.cpp:18:
/usr/include/boost/asio/error.hpp:66:11: note:   ‘boost::asio::error’
 namespace error {
           ^~~~~
In file included from /usr/include/boost/asio.hpp:82:0,
                 from otsystem.h:33,
                 from luascript.h:20,
                 from luascript.cpp:18:
/usr/include/boost/asio/placeholders.hpp:55:22: note:   ‘boost::asio::placeholders::error’
 inline boost::arg<1> error()
                      ^~~~~
luascript.cpp:7435:28: error: ‘int64_t Player::lastPing’ is private within this context
  lua_pushnumber(L, player->lastPing);
                            ^~~~~~~~
In file included from luascript.cpp:26:0:
player.h:1210:11: note: declared private here
   int64_t lastPing;
           ^~~~~~~~
luascript.cpp:7434:10: warning: unused variable ‘timeNow’ [-Wunused-variable]
  int64_t timeNow = OTSYS_TIME();
          ^~~~~~~
luascript.cpp: At global scope:
luascript.cpp:7438:9: error: ‘LuaScriptInterface’ has not been declared
 int32_t LuaScriptInterface::luagetPlayerLastPong(lua_State* L)
         ^~~~~~~~~~~~~~~~~~
luascript.cpp: In function ‘int32_t luagetPlayerLastPong(lua_State*)’:
luascript.cpp:7441:33: error: ‘getEnv’ was not declared in this scope
  ScriptEnviroment* env = getEnv();
                                 ^
luascript.cpp:7442:50: error: ‘popNumber’ was not declared in this scope
  Player* player = env->getPlayerByUID(popNumber(L));
                                                  ^
In file included from luascript.cpp:18:0:
luascript.cpp:7445:46: error: ‘getError’ was not declared in this scope
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
                                              ^
luascript.h:221:40: note: in definition of macro ‘errorEx’
 #define errorEx(a) error(__FUNCTION__, a)
                                        ^
luascript.h:221:41: error: ‘error’ was not declared in this scope
 #define errorEx(a) error(__FUNCTION__, a)
                                         ^
luascript.cpp:7445:3: note: in expansion of macro ‘errorEx’
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
   ^
luascript.h:221:41: note: suggested alternatives:
 #define errorEx(a) error(__FUNCTION__, a)
                                         ^
luascript.cpp:7445:3: note: in expansion of macro ‘errorEx’
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
   ^
In file included from /usr/include/boost/asio/detail/impl/posix_mutex.ipp:24:0,
                 from /usr/include/boost/asio/detail/posix_mutex.hpp:73,
                 from /usr/include/boost/asio/detail/mutex.hpp:25,
                 from /usr/include/boost/asio/detail/service_registry.hpp:20,
                 from /usr/include/boost/asio/impl/io_service.hpp:19,
                 from /usr/include/boost/asio/io_service.hpp:767,
                 from /usr/include/boost/asio/basic_io_object.hpp:19,
                 from /usr/include/boost/asio/basic_socket.hpp:20,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:20,
                 from /usr/include/boost/asio.hpp:21,
                 from otsystem.h:33,
                 from luascript.h:20,
                 from luascript.cpp:18:
/usr/include/boost/asio/error.hpp:66:11: note:   ‘boost::asio::error’
 namespace error {
           ^~~~~
In file included from /usr/include/boost/asio.hpp:82:0,
                 from otsystem.h:33,
                 from luascript.h:20,
                 from luascript.cpp:18:
/usr/include/boost/asio/placeholders.hpp:55:22: note:   ‘boost::asio::placeholders::error’
 inline boost::arg<1> error()
                      ^~~~~
luascript.cpp:7449:28: error: ‘int64_t Player::lastPong’ is private within this context
  lua_pushnumber(L, player->lastPong);
                            ^~~~~~~~
In file included from luascript.cpp:26:0:
player.h:1209:11: note: declared private here
   int64_t lastPong;
           ^~~~~~~~
Makefile:33: recipe for target 'luascript.o' failed
make: *** [luascript.o] Error 1
 
Last try:

luascript.cpp

luascript.h

errors
Code:
CC       = g++
In file included from luascript.h:33:0,
                 from luascript.cpp:18:
luascript.cpp: In member function ‘virtual void LuaInterface::registerFunctions()’:
luascript.cpp:2094:51: error: ‘luaGetPlayerLastPing’ is not a member of ‘LuaInterface’
     lua_register(m_luaState, "getPlayerLastPing", LuaInterface::luaGetPlayerLastPing);
                                                   ^
/usr/include/lua5.1/lua.h:260:53: note: in definition of macro ‘lua_pushcfunction’
 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
                                                     ^
luascript.cpp:2094:5: note: in expansion of macro ‘lua_register’
     lua_register(m_luaState, "getPlayerLastPing", LuaInterface::luaGetPlayerLastPing);
     ^
luascript.cpp:2096:51: error: ‘luaGetPlayerLastPong’ is not a member of ‘LuaInterface’
     lua_register(m_luaState, "getPlayerLastPong", LuaInterface::luaGetPlayerLastPong);
                                                   ^
/usr/include/lua5.1/lua.h:260:53: note: in definition of macro ‘lua_pushcfunction’
 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
                                                     ^
luascript.cpp:2096:5: note: in expansion of macro ‘lua_register’
     lua_register(m_luaState, "getPlayerLastPong", LuaInterface::luaGetPlayerLastPong);
     ^
luascript.cpp:2098:46: error: ‘luaGetOtsysTime’ is not a member of ‘LuaInterface’
     lua_register(m_luaState, "getOtsysTime", LuaInterface::luaGetOtsysTime);
                                              ^
/usr/include/lua5.1/lua.h:260:53: note: in definition of macro ‘lua_pushcfunction’
 #define lua_pushcfunction(L,f) lua_pushcclosure(L, (f), 0)
                                                     ^
luascript.cpp:2098:5: note: in expansion of macro ‘lua_register’
     lua_register(m_luaState, "getOtsysTime", LuaInterface::luaGetOtsysTime);
     ^
luascript.cpp: At global scope:
luascript.cpp:7394:9: error: ‘LuaScriptInterface’ has not been declared
 int32_t LuaScriptInterface::luaDoPlayerSendPing(lua_State* L)
         ^~~~~~~~~~~~~~~~~~
luascript.cpp: In function ‘int32_t luaDoPlayerSendPing(lua_State*)’:
luascript.cpp:7397:33: error: ‘getEnv’ was not declared in this scope
  ScriptEnviroment* env = getEnv();
                                 ^
luascript.cpp:7398:50: error: ‘popNumber’ was not declared in this scope
  Player* player = env->getPlayerByUID(popNumber(L));
                                                  ^
luascript.cpp:7405:13: error: ‘int64_t Player::lastPing’ is private within this context
     player->lastPing = timeNow;
             ^~~~~~~~
In file included from luascript.cpp:26:0:
player.h:1210:11: note: declared private here
   int64_t lastPing;
           ^~~~~~~~
luascript.cpp:7406:13: error: ‘ProtocolGame* Player::client’ is private within this context
  if(player->client)
             ^~~~~~
In file included from luascript.cpp:26:0:
player.h:1230:17: note: declared private here
   ProtocolGame* client;
                 ^~~~~~
luascript.cpp:7408:13: error: ‘ProtocolGame* Player::client’ is private within this context
     player->client->sendPing();
             ^~~~~~
In file included from luascript.cpp:26:0:
player.h:1230:17: note: declared private here
   ProtocolGame* client;
                 ^~~~~~
luascript.cpp:7408:30: error: ‘void ProtocolGame::sendPing()’ is private within this context
     player->client->sendPing();
                              ^
In file included from player.h:33:0,
                 from luascript.cpp:26:
protocolgame.h:205:8: note: declared private here
   void sendPing();
        ^~~~~~~~
luascript.cpp: At global scope:
luascript.cpp:7417:9: error: ‘LuaScriptInterface’ has not been declared
 int32_t LuaScriptInterface::luagetOtsysTime(lua_State* L)
         ^~~~~~~~~~~~~~~~~~
luascript.cpp:7423:9: error: ‘LuaScriptInterface’ has not been declared
 int32_t LuaScriptInterface::luagetPlayerLastPing(lua_State* L)
         ^~~~~~~~~~~~~~~~~~
luascript.cpp: In function ‘int32_t luagetPlayerLastPing(lua_State*)’:
luascript.cpp:7426:33: error: ‘getEnv’ was not declared in this scope
  ScriptEnviroment* env = getEnv();
                                 ^
luascript.cpp:7427:50: error: ‘popNumber’ was not declared in this scope
  Player* player = env->getPlayerByUID(popNumber(L));
                                                  ^
In file included from luascript.cpp:18:0:
luascript.cpp:7430:46: error: ‘getError’ was not declared in this scope
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
                                              ^
luascript.h:221:40: note: in definition of macro ‘errorEx’
 #define errorEx(a) error(__FUNCTION__, a)
                                        ^
luascript.h:221:41: error: ‘error’ was not declared in this scope
 #define errorEx(a) error(__FUNCTION__, a)
                                         ^
luascript.cpp:7430:3: note: in expansion of macro ‘errorEx’
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
   ^
luascript.h:221:41: note: suggested alternatives:
 #define errorEx(a) error(__FUNCTION__, a)
                                         ^
luascript.cpp:7430:3: note: in expansion of macro ‘errorEx’
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
   ^
In file included from /usr/include/boost/asio/detail/impl/posix_mutex.ipp:24:0,
                 from /usr/include/boost/asio/detail/posix_mutex.hpp:73,
                 from /usr/include/boost/asio/detail/mutex.hpp:25,
                 from /usr/include/boost/asio/detail/service_registry.hpp:20,
                 from /usr/include/boost/asio/impl/io_service.hpp:19,
                 from /usr/include/boost/asio/io_service.hpp:767,
                 from /usr/include/boost/asio/basic_io_object.hpp:19,
                 from /usr/include/boost/asio/basic_socket.hpp:20,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:20,
                 from /usr/include/boost/asio.hpp:21,
                 from otsystem.h:33,
                 from luascript.h:20,
                 from luascript.cpp:18:
/usr/include/boost/asio/error.hpp:66:11: note:   ‘boost::asio::error’
 namespace error {
           ^~~~~
In file included from /usr/include/boost/asio.hpp:82:0,
                 from otsystem.h:33,
                 from luascript.h:20,
                 from luascript.cpp:18:
/usr/include/boost/asio/placeholders.hpp:55:22: note:   ‘boost::asio::placeholders::error’
 inline boost::arg<1> error()
                      ^~~~~
luascript.cpp:7435:28: error: ‘int64_t Player::lastPing’ is private within this context
  lua_pushnumber(L, player->lastPing);
                            ^~~~~~~~
In file included from luascript.cpp:26:0:
player.h:1210:11: note: declared private here
   int64_t lastPing;
           ^~~~~~~~
luascript.cpp:7434:10: warning: unused variable ‘timeNow’ [-Wunused-variable]
  int64_t timeNow = OTSYS_TIME();
          ^~~~~~~
luascript.cpp: At global scope:
luascript.cpp:7438:9: error: ‘LuaScriptInterface’ has not been declared
 int32_t LuaScriptInterface::luagetPlayerLastPong(lua_State* L)
         ^~~~~~~~~~~~~~~~~~
luascript.cpp: In function ‘int32_t luagetPlayerLastPong(lua_State*)’:
luascript.cpp:7441:33: error: ‘getEnv’ was not declared in this scope
  ScriptEnviroment* env = getEnv();
                                 ^
luascript.cpp:7442:50: error: ‘popNumber’ was not declared in this scope
  Player* player = env->getPlayerByUID(popNumber(L));
                                                  ^
In file included from luascript.cpp:18:0:
luascript.cpp:7445:46: error: ‘getError’ was not declared in this scope
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
                                              ^
luascript.h:221:40: note: in definition of macro ‘errorEx’
 #define errorEx(a) error(__FUNCTION__, a)
                                        ^
luascript.h:221:41: error: ‘error’ was not declared in this scope
 #define errorEx(a) error(__FUNCTION__, a)
                                         ^
luascript.cpp:7445:3: note: in expansion of macro ‘errorEx’
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
   ^
luascript.h:221:41: note: suggested alternatives:
 #define errorEx(a) error(__FUNCTION__, a)
                                         ^
luascript.cpp:7445:3: note: in expansion of macro ‘errorEx’
   errorEx(getError(LUA_ERROR_PLAYER_NOT_FOUND));
   ^
In file included from /usr/include/boost/asio/detail/impl/posix_mutex.ipp:24:0,
                 from /usr/include/boost/asio/detail/posix_mutex.hpp:73,
                 from /usr/include/boost/asio/detail/mutex.hpp:25,
                 from /usr/include/boost/asio/detail/service_registry.hpp:20,
                 from /usr/include/boost/asio/impl/io_service.hpp:19,
                 from /usr/include/boost/asio/io_service.hpp:767,
                 from /usr/include/boost/asio/basic_io_object.hpp:19,
                 from /usr/include/boost/asio/basic_socket.hpp:20,
                 from /usr/include/boost/asio/basic_datagram_socket.hpp:20,
                 from /usr/include/boost/asio.hpp:21,
                 from otsystem.h:33,
                 from luascript.h:20,
                 from luascript.cpp:18:
/usr/include/boost/asio/error.hpp:66:11: note:   ‘boost::asio::error’
 namespace error {
           ^~~~~
In file included from /usr/include/boost/asio.hpp:82:0,
                 from otsystem.h:33,
                 from luascript.h:20,
                 from luascript.cpp:18:
/usr/include/boost/asio/placeholders.hpp:55:22: note:   ‘boost::asio::placeholders::error’
 inline boost::arg<1> error()
                      ^~~~~
luascript.cpp:7449:28: error: ‘int64_t Player::lastPong’ is private within this context
  lua_pushnumber(L, player->lastPong);
                            ^~~~~~~~
In file included from luascript.cpp:26:0:
player.h:1209:11: note: declared private here
   int64_t lastPong;
           ^~~~~~~~
Makefile:33: recipe for target 'luascript.o' failed
make: *** [luascript.o] Error 1
 
Back
Top