warriorfrog
Active Member
- Joined
- Jul 29, 2015
- Messages
- 334
- Reaction score
- 35
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:
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:
Lua Function - getOtsysTime() + getPlayerPing(cid) + doPlayerSendPing(cid)
I did this function by things that already exist on open tibia. for tfs 03.6 If you dont know the tibia client already got a ping system so i am using it. And getOtsystime is like os.time() + os.clock(), you got year, month, day, hour, minut, second, miliseconds :D All functions by me ^^...
otland.net
But it's for 0.3.6, and i'm using 0.4
GitHub - Fir3element/3777: The Forgotten Server 0.4 (rev 3777) with several improvements and bugfixes
The Forgotten Server 0.4 (rev 3777) with several improvements and bugfixes - Fir3element/3777
github.com
I found this guy converting to 0.4
[Lua & C++] getOtsysTime() + getPlayerPing(cid) + doPlayerSendPing(cid)
#Introdução Bom hoje estarei trazendo aqui o sistema de Ping feito pelo Mock, com uma pequena adaptação feita por mim para funcionar em TFS 0.4(talvez podendo funcionar em outras) Pois o que ele disponibilizou foi apenas para TFS 0.3.6 e nem foi muito utilizado pela comunidade. Muitos servidores ...
tibiaking.com
Tried to use, but now its broke my source code and idk C++
So i tried this:
luascript.cpp
Hastebin: Send and Save Text or Code Snippets for Free | Toptal®
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
hastebin.com
luascript.h
Hastebin: Send and Save Text or Code Snippets for Free | Toptal®
Hastebin is a free web-based pastebin service for storing and sharing text and code snippets with anyone. Get started now.
hastebin.com
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