Block_country_ip
More code:
Common/tables.h
search this and remove:
search this too and remove
db/src:
remove this files:
BlockCountry.cpp + BlockCountry.h
open db/clientmanager.cpp
remove this:
Open db/clientmanager.h
search this and remove:
Open Main.cpp
search this and remove:
search too and remove:
and this:
makefile
Search this and remove too:
open game src and remove this files:
Block_Country.cpp + Block_Country.h -> cpp remove too makefile
Open game/db.cpp
search this and remove:
open db.h and remove this:
open input.cpp and remove this:
open input.h and remove this:
open input_db and remove this:
+ this:
and this:
+ this:
open input_login.cpp and remove this:
+ this:
open packet.h and remove this:
search this and remove:
C++:
HEADER_GD_BLOCK_COUNTRY_IP = 127, // ±¤´ëżŞ IP-Block
HEADER_GD_BLOCK_EXCEPTION = 128, // ±¤´ëżŞ IP-Block żążÜ
HEADER_DG_BLOCK_COUNTRY_IP = 171, // ±¤´ëżŞ IP-Block
HEADER_DG_BLOCK_EXCEPTION = 172, // ±¤´ëżŞ IP-Block żążÜ account
search this too and remove
C++:
// Block Country Ip
typedef struct tBlockCountryIp
{
DWORD ip_from;
DWORD ip_to;
} TPacketBlockCountryIp;
enum EBlockExceptionCommand
{
BLOCK_EXCEPTION_CMD_ADD = 1,
BLOCK_EXCEPTION_CMD_DEL = 2,
};
// Block Exception Account
typedef struct tBlockException
{
BYTE cmd; // 1 == add, 2 == delete
char login[LOGIN_MAX_LEN + 1];
}TPacketBlockException;
db/src:
remove this files:
BlockCountry.cpp + BlockCountry.h
open db/clientmanager.cpp
remove this:
Kod:
#include "BlockCountry.h"
C++:
void CClientManager::BlockException(TPacketBlockException* data)
{
sys_log(0, "[BLOCK_EXCEPTION] CMD(%d) login(%s)", data->cmd, data->login);
// save sql
{
char buf[1024];
switch (data->cmd)
{
case BLOCK_EXCEPTION_CMD_ADD:
snprintf(buf, sizeof(buf), "INSERT INTO block_exception VALUES('%s')", data->login);
CDBManager::instance().AsyncQuery(buf, SQL_ACCOUNT);
CBlockCountry::instance().AddBlockException(data->login);
break;
case BLOCK_EXCEPTION_CMD_DEL:
snprintf(buf, sizeof(buf), "DELETE FROM block_exception VALUES('%s')", data->login);
CDBManager::instance().AsyncQuery(buf, SQL_ACCOUNT);
CBlockCountry::instance().DelBlockException(data->login);
break;
default:
return;
}
}
for (itertype(m_peerList) it = m_peerList.begin(); it != m_peerList.end(); ++it)
{
CPeer* peer = *it;
if (!peer->GetChannel())
continue;
CBlockCountry::instance().SendBlockExceptionOne(peer, data->login, data->cmd);
}
}
Open db/clientmanager.h
search this and remove:
Kod:
void BlockException(TPacketBlockException* data);
Open Main.cpp
search this and remove:
Kod:
#include "BlockCountry.h"
search too and remove:
C++:
CBlockCountry BlockCountry;
and this:
C++:
BlockCountry.Load();
makefile
Search this and remove too:
Kod:
BlockCountry.cpp
open game src and remove this files:
Block_Country.cpp + Block_Country.h -> cpp remove too makefile
Open game/db.cpp
search this and remove:
C++:
void DBManager::RequestBlockException(const char* login, int cmd)
{
TPacketBlockException packet;
packet.cmd = cmd;
strlcpy(packet.login, login, sizeof(packet.login));
db_clientdesc->DBPacket(HEADER_GD_BLOCK_EXCEPTION, 0, &packet, sizeof(packet));
}
open db.h and remove this:
C++:
// BLOCK EXCEPTION
void RequestBlockException(const char* login, int cmd);
// BLOCK EXCEPTION
open input.cpp and remove this:
C++:
else if (!stBuf.compare(0, 15, "BLOCK_EXCEPTION"))
{
// BLOCK_EXCEPTION cmd(add=1, del=2) login
std::istringstream is(stBuf);
std::string dummy_string;
std::string login_string;
int cmd;
is >> dummy_string >> cmd >> login_string;
sys_log(0, "block_exception %s:%d", login_string.c_str(), cmd);
DBManager::instance().RequestBlockException(login_string.c_str(), cmd);
stResult = "BLOCK_EXCEPTION_YES";
}
open input.h and remove this:
C++:
void AddBlockCountryIp(TPacketBlockCountryIp* data);
void BlockException(TPacketBlockException* data);
open input_db and remove this:
Kod:
#include "block_country.h"
+ this:
C++:
// request blocked_country_ip
{
db_clientdesc->DBPacket(HEADER_GD_BLOCK_COUNTRY_IP, 0, NULL, 0);
dev_log(LOG_DEB0, "<sent HEADER_GD_BLOCK_COUNTRY_IP>");
}
and this:
C++:
case HEADER_DG_BLOCK_COUNTRY_IP:
this->AddBlockCountryIp((TPacketBlockCountryIp*)c_pData);
break;
case HEADER_DG_BLOCK_EXCEPTION:
this->BlockException((TPacketBlockException*)c_pData);
break;
+ this:
C++:
void CInputDB::AddBlockCountryIp(TPacketBlockCountryIp* data)
{
add_blocked_country_ip(data);
}
void CInputDB::BlockException(TPacketBlockException* data)
{
block_exception(data);
}
open input_login.cpp and remove this:
C++:
#include "block_country.h"
+ this:
C++:
// is blocked ip?
{
dev_log(LOG_DEB0, "check_blocked_country_start");
if (!is_block_exception(login) && is_blocked_country_ip(d->GetHostName()))
{
sys_log(0, "BLOCK_COUNTRY_IP (%s)", d->GetHostName());
d->SetPhase(PHASE_CLOSE);
return;
}
dev_log(LOG_DEB0, "check_blocked_country_end");
}
open packet.h and remove this:
C++:
HEADER_GG_BLOCK_EXCEPTION = 24,
More code:
Linkleri görebilmek için Turkmmo Forumuna ÜYE olmanız gerekmektedir.
Son düzenleme:
En Çok Reaksiyon Alan Mesajlar
block_country ve blockcountry diye arat herşeyi kaldır böyle anlatmaya gerek yok
Şu an konuyu görüntüleyenler (Toplam : 0, Üye: 0, Misafir: 0)
Benzer konular
- Cevaplar
- 2
- Görüntüleme
- 345
- Cevaplar
- 4
- Görüntüleme
- 203
- Cevaplar
- 2
- Görüntüleme
- 20
- Cevaplar
- 2
- Görüntüleme
- 277
