Remove Block_country_ip

  • Konbuyu başlatan Konbuyu başlatan Admin
  • Başlangıç tarihi Başlangıç tarihi
  • Cevaplar Cevaplar 0
  • Görüntüleme Görüntüleme 43

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Block_country_ip


Kod:
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

Kod:
// 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 :

BlockCountry.cpp + BlockCountry.h

open db/clientmanager.cpp

remove this:

Kod:
#include "BlockCountry.h"

Kod:
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:

Kod:
CBlockCountry    BlockCountry;

and this:

Kod:
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:

Kod:
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:

Kod:
// BLOCK EXCEPTION     void            RequestBlockException(const char* login, int cmd);     // BLOCK EXCEPTION

open input.cpp and remove this:

Kod:
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:

Kod:
void        AddBlockCountryIp(TPacketBlockCountryIp* data);     void        BlockException(TPacketBlockException* data);

open input_db and remove this:

Kod:
#include "block_country.h"

+ this:

Kod:
// 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:

Kod:
case HEADER_DG_BLOCK_COUNTRY_IP:         this->AddBlockCountryIp((TPacketBlockCountryIp*)c_pData);         break;     case HEADER_DG_BLOCK_EXCEPTION:         this->BlockException((TPacketBlockException*)c_pData);         break;

+ this:


Kod:
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:

Kod:
#include "block_country.h"

+ this:


Kod:
// 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:

Kod:
HEADER_GG_BLOCK_EXCEPTION        = 24,

More code:


Metin2 Sunucularında Ülke Bazlı IP Engeli Nasıl Kaldırılır?

Metin2 özel sunucu geliştirmesi yapan geliştiriciler, özellikle PvP sistemleri üzerinde çalışanlar için ülke bazlı IP engelleri bazen büyük bir engel teşkil edebilir. Bu tür engeller, bazı oyuncuların sunucuya erişimini sınırlarken, aynı zamanda oyun deneyimi açısından da olumsuz etkiler doğurabilir. Bu yazıda, remove block_country_ip işlemi ile nasıl bu engelleri kaldırabileceğinizi detaylıca ele alacağız.

IP Engelleme Nedir ve Neden Kullanılır?

IP engelleme, belirli IP aralıklarının veya ülkelerin sunucuya erişimini engellemek için kullanılan bir yöntemdir. Özellikle Metin2 özel sunucularında, bazı ülkelerden gelen spam saldırıları, bot kullanımı veya hileli aktiviteler nedeniyle bu tür engellemeler yapılır. Ancak bu tür engellemeler, innocent kullanıcıların da erişimini engelleyebilir.

Country IP Engeli Kalıcı mıdır?

Hayır, bu engeller genellikle kalıcı değildir. Sunucu yöneticisi tarafından config dosyaları üzerinden kolaylıkla kaldırılabilir. block_country_ip ayarları genellikle game server veya auth server yapılandırmalarında bulunur.

Remove Block_country_ip Adımları

1. Config Dosyasına Erişim
Sunucu yapılandırma dosyalarına erişim sağlayın. Genellikle src klasöründe bulunan game veya auth dosyalarında bu ayarlar yer alır.

2. Ayarları Kontrol Et
block_country_ip parametresini bulun. Bu genellikle bir dizi ülke kodundan oluşur (örneğin TR, RU, CN gibi). Bu satırları yorum satırına çevirin ya da silin.

3. Yeniden Derleme / Yeniden Başlatma
Değişikliklerin aktif olması için server yeniden başlatılmalıdır. Eğer compile işlemi yapıyorsanız, değişiklikleri tekrar derlemeniz gerekir.

Python veya C++ ile IP Engeli Otomasyonu

Gelişmiş sunucular, Python veya C++ tabanlı sistemler kullanarak IP engellerini otomatik olarak yönetebilir. Bu sistemler, belirli IP’leri analiz edip engelleme veya kaldırma işlemlerini otomatikleştirebilir. Py GUI arayüzleri kullanılarak bu işlemler daha da kullanıcı dostu hale getirilebilir.

Metin2 Sunucularında Güvenlik ve Erişim Dengesi

IP engelleme, güvenlik için önemli bir araçtır ancak aşırı kullanıldığında kullanıcı kitlesini de sınırlayabilir. remove block_country_ip işlemleri sırasında, sunucu güvenliğini riske atmadan doğru dengeleri kurmak önemlidir. Martysama gibi development kaynakları, bu konularda destek sağlayabilir.

Sonuç

Metin2 özel sunucu geliştiricileri, remove block_country_ip işlemi ile kullanıcı erişimini artırabilir ve global oyuncu katılımını teşvik edebilir. Bu işlem, doğru yapılandırıldığında hem güvenlik hem de kullanıcı deneyimi açısından faydalıdır.


How to Remove Country-Based IP Blocking on Metin2 Servers?

Metin2 private server developers, especially those working on PvP systems, may find country-based IP blocks to be a significant obstacle. These blocks can restrict certain players from accessing the server and negatively affect the overall gaming experience. In this article, we will explain in detail how to remove block_country_ip restrictions.

What Is IP Blocking and Why Is It Used?

IP blocking is a method used to prevent specific IP ranges or countries from accessing a server. On Metin2 private servers, such blocks are often implemented to counter spam attacks, bot usage, or cheating attempts from certain countries. However, these blocks might also restrict access for legitimate users.

Are Country IP Blocks Permanent?

No, these blocks are not permanent. Server administrators can easily remove them via configuration files. The block_country_ip settings are typically located within the game server or auth server configurations.

Steps to Remove Block_country_ip

1. Access the Config File
Gain access to the server configuration files. These are usually found in the src folder under game or auth files.

2. Check the Settings
Find the block_country_ip parameter. This typically consists of a list of country codes (e.g., TR, RU, CN). Comment out or delete these lines.

3. Recompile / Restart
To make changes effective, restart the server. If you're compiling, you must rebuild after the changes.

Automating IP Blocking with Python or C++

Advanced servers can manage IP blocks automatically using Python or C++-based systems. These systems can analyze specific IPs and automate the blocking or unblocking process. Py GUI interfaces can make these operations more user-friendly.

Balancing Security and Access on Metin2 Servers

IP blocking is an important security tool, but excessive use can limit your player base. When performing remove block_country_ip procedures, it's crucial to maintain security without risking server safety. Development resources like Martysama can provide support in these areas.

Conclusion

Metin2 private server developers can increase user accessibility and encourage global player participation by removing block_country_ip restrictions. When configured correctly, this action benefits both security and user experience.
 

Şuan Bu Konuyu Görüntüleyen Kullanıcılar (Toplam : 0, Üye : 0, Misafir : 0)

Benzer konular

Geri
Üst Alt