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

Compiling BanIP function source

oliverarrow

Member
Joined
Jul 31, 2015
Messages
82
Reaction score
6
I'm using 0.4, and i want know how to banip as this function LUA
Code:
doAddIpBanishment(getPlayerIp(cid), 2 * 2 * 60 * 60)

2 hours to ban IP...

How to do it in my sources?
 
Maybe try to search in your source files for the doAddIpBanishment function? Just suggesting, I don't know much about sources but it should be there if it isn't a custom function written in 050-functions.lua lib.
 
Search in your luascript.cpp file for: int32_t LuaScriptInterface::luaDoAddIpBanishment(lua_State* L)

Code:
int32_t LuaInterface::luaDoAddIpBanishment(lua_State* L)
{
   //doAddIpBanishment(ip[, mask[, length[, reason[, comment[, admin[, statement]]]]]])
   uint32_t admin = 0, reason = 21, mask = 0xFFFFFFFF, params = lua_gettop(L);
   int64_t length = time(NULL) + g_config.getNumber(ConfigManager::IPBANISHMENT_LENGTH);
   std::string statement, comment;

   if(params > 6)
     statement = popString(L);

   if(params > 5)
     admin = popNumber(L);

   if(params > 4)
     comment = popString(L);

   if(params > 3)
     reason = popNumber(L);

   if(params > 2)
     length = popNumber(L);

   if(params > 1)
     mask = popNumber(L);

   lua_pushboolean(L, IOBan::getInstance()->addIpBanishment((uint32_t)popNumber(L),
     length, reason, comment, admin, mask, statement));
   return 1;
}

Code:
  //doAddIpBanishment(...)
   lua_register(m_luaState, "doAddIpBanishment", LuaInterface::luaDoAddIpBanishment);

my luascript.cpp
http://pastebin.com/C8Ruwi2f
 
What do you want to do in sources with this function? I can not help you much, because I'm not very knowledgeable on source editing, but you haven't really described properly what you want to do with the function.
If you do, perhaps someone else can help you out.
 
What do you want to do in sources with this function? I can not help you much, because I'm not very knowledgeable on source editing, but you haven't really described properly what you want to do with the function.
If you do, perhaps someone else can help you out.

Bap IP in 1 hour if any try AD in my server

Code:
  if(
  int(text.find("servegame")) > 0 ||
  int(text.find(".servegame")) > 0 ||
  int(text.find("no-ip")) > 0 ||
  int(text.find(".no-ip")) > 0 ||
  int(text.find(".net")) > 0 ||
  int(text.find(".com")) > 0 ||
  int(text.find(".org")) > 0 ||
  int(text.find("biz")) > 0 ||
  int(text.find(".biz")) > 0 ||
  int(text.find(".br")) > 0 ||
  int(text.find("sytes")) > 0 ||
  int(text.find(".sytes")) > 0 ||
  int(text.find(".info")) > 0
  )
  {
  BANIP = 1 hour!
  return false;
  }
 
Bap IP in 1 hour if any try AD in my server

Code:
  if(
  int(text.find("servegame")) > 0 ||
  int(text.find(".servegame")) > 0 ||
  int(text.find("no-ip")) > 0 ||
  int(text.find(".no-ip")) > 0 ||
  int(text.find(".net")) > 0 ||
  int(text.find(".com")) > 0 ||
  int(text.find(".org")) > 0 ||
  int(text.find("biz")) > 0 ||
  int(text.find(".biz")) > 0 ||
  int(text.find(".br")) > 0 ||
  int(text.find("sytes")) > 0 ||
  int(text.find(".sytes")) > 0 ||
  int(text.find(".info")) > 0
  )
  {
  BANIP = 1 hour!
  return false;
  }

Ah, I see. Well, you didn't specify that anywhere in your original post, so that's what I was wondering. Unfortunately, I can't help you out, but if I may chip in my opinion - that's a very ineffective solution for your problem as it limits the freedom of speech (so to say) ingame. If that means what I think it means, anyone who says a sentence that has any of those domain types in it automatically gets an 1 hour ban?

This means any kind of a link that ends with ".com" or ".org" or ".net" will earn you a ban, and most websites that exist use one of those 3, so players wouldn't be able to send any links ingame or talk about them.
What about the word "biz" without the dot in front of it. There are words in english language (and other languages) that have the character combination 'biz' in them, wouldn't that prevent them from saying such words too?
 
Back
Top