Metin2 Client.exe giriş sınırlandırma koyma

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Hayırlı günler herkese. emek serverlerin işine yaracak bir paylaşım, uzatmadan konuya giriyorum sistemi eklediğinizde örnek veriyorum sınırı 5 ayarladınız 5 ten sonra giriş dosyanızı çalıştırdığında oyuncu alta verdiğim görseldeki uyarıyı alacak ve 6.cıyı açamayacak.

NOT : ALINTIDIR ASIL SAHİBİ KİM BENDE BİLMİYORUM BİR FİLESTEN SÖKTÜM.

Kod:
Locale_inch.h // Müsait yere ekle #define MAX_CLIENTS #ifdef MAX_CLIENTS  [HASH=1]#define[/HASH]MAX_CLIENT#ifd[HASH=2]#ifdef[/HASH] // NOT : BURA[HASH=1]#define[/HASH]ZAN YERİ SINIR#endifKOYMAK İSTİYORSANIZ DEĞİŞTİRİN. PythonApplication.cpp // En üste müsait bir yere ekle #ifdef MAX_CLIENTS #include <shlwapi.h> #pragma co#ifdefefb, "Shlwapi.#includeeclude <TlHelp#pragmaendif // Ara // END_OF_SUPPO#includeOREA_SERVER /#endifna Ekle #ifdef MAX_CLIENTS bool CPythonApplication::CanOpen#ifdefeft(){     int bActiveClientCount = 0;     PROCESSENTRY32 processEntry;     HANDLE hProcessSnap = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);     TCHAR exePath[MAX_PATH];     GetModuleFileName(NULL, exePath, MAX_PATH);     std::string exeName = std::string(PathFindFileName(exePath));     char processName[256];     if (hProcessSnap == INVALID_HANDLE_VALUE){ return 0; }     do {         snprintf(processName, sizeof(processName), "%s", processEntry.szExeFile);         if (0 == strcmp(exeName.c_str(), processName))             bActiveClientCount++;     } while (Process32Next(hProcessSnap, &processEntry));     CloseHandle(hProcessSnap);     return bActiveClientCount <= MAX_CLIENT; } #endif // Ara     if (m_pySystem.IsUseDefaultIME#endifendiftına Ekle #ifdef MAX_CLIENTS     TCHAR szE[HASH=274929]#endiftına[/HASH][MAX_PATH]#ifdefdeftModuleFileName(NULL, szExeFileName, MAX_PATH);#ifdeftModuleFileName(NULLFindFileName(szExeFileName)) != "metin2client.exe")         {         //TraceError("Oyun dosyasi hatali. %s", PathFindFileName(szExeFileName));         SET_EXCEPTION("Dosya adi degismis. Lutfen islemi geri alin.");         return false;     }     if (!CanOpenNewClient()){         TraceError("Max. 2 Client acilabilir.!");         SET_EXCEPTION("Max. 2 Client acilabilir.!");         return false;     } #endif // NOT :     if (std::string(PathFindFileNa[HASH=3]#endif[/HASH]ileName)) != "metin2client.exe") // Şu kod bloğunda metin2client.exe yazan kısmı sizin giriş dosya isminizle değiştirin. Python Applicatoin.h // Ara         bool Process(); // Üstüne Ekle #ifdef MAX_CLIENTS         bool CanOpenNewClient(); #endif [HASH=2]#ifdef[/HASH]] [/SPOILER] Hayırlı olsun. Ekleyen olursa ufak#endififeo alarak atarsa sevinirim.

Metin2 Client.exe Girişi İçin Sınırlandırma Koyma Rehberi

Metin2 özel sunucularında kullanıcı deneyimini artırmak ve server kaynaklarını daha verimli yönetmek adına, client.exe üzerinden giriş sayısını sınırlandırmak önemli bir yapılandırma seçeneğidir. Bu rehberde, C++ tabanlı server sistemlerinde nasıl giriş sınırlandırması yapılacağını detaylıca ele alacağız. Bu işlem, sunucu güvenliği ve performans açısından kritik öneme sahiptir.

Neden Giriş Sınırlandırması Yapılır?

Metin2 özel sunucularında, bir oyuncunun birden fazla client açarak hesap veya karakter çalıştırması, hem PvP dengesini bozabilir hem de server üzerinde gereksiz yük yaratabilir. Giriş sınırlandırması sayesinde, her IP veya her hesap için belirlenen limitlere göre client bağlantısı engellenebilir. Bu sayede sunucu performansı korunur ve adil bir oyun ortamı sağlanır.

C++ Kaynak Kodlarda Giriş Sınırlandırması Uygulama

Metin2 server tarafında, Auth Server veya Game Server seviyesinde bu işlem yapılabilmektedir. Öncelikle, auth server kaynak kodlarında, kullanıcı girişi sırasında IP kontrolü yapılması sağlanmalıdır. Bu işlem genellikle login isteği geldiğinde, aynı IP adresinden kaç adet aktif bağlantı olduğunu denetleyerek yapılır.

Örnek olarak, C++ kod seviyesinde şu mantık izlenebilir:
- Kullanıcı login olduğunda, IP adresi veritabanına veya belleğe alınır.
- Aynı IP üzerinden yeni bir bağlantı gelirse, tanımlı limit kontrol edilir.
- Eğer limit aşıldıysa, bağlantı reddedilir ve kullanıcıya uyarı mesajı gönderilir.

Python ile Destekleyici Script Geliştirme

Metin2 sunucularında backend işlemlerini kolaylaştırmak adına Python tabanlı sistemler de entegre edilebilir. PyRoot üzerinde geliştirilen scriptler ile IP temelli giriş kontrolü daha esnek bir şekilde yapılandırılabilir. Örneğin, py dosyasında bir sayaç oluşturulup, giriş yapan client sayısı her IP için takip edilebilir. Bu sayaç, auth server ile senkronize çalışacak şekilde tasarlanabilir.

Client Tarafında Yapılan Kontroller

Giriş sınırlandırmasının sadece server tarafında değil, client tarafında da bazı kontrollerle desteklenmesi faydalı olabilir. Örneğin, client.exe başlatıldığında, sistemde zaten çalışan başka bir client varsa, ikinci açılımın engellenmesi gibi basit ama etkili çözümler uygulanabilir. Bu tür kontroller genellikle UIScript veya client kaynak kodları üzerinde C++ ile geliştirilir.

Veritabanı (DB) Entegrasyonu

Giriş sınırlarını daha kalıcı ve güvenilir tutmak için, DB üzerinden IP adreslerinin ve bağlantı sayılarının loglanması önemlidir. Bu sayede, admin paneli üzerinden client bağlantıları izlenebilir ve gerekirse manuel müdahaleler yapılabilir. MySQL veya PostgreSQL gibi veritabanı sistemleri bu süreçte destek sağlar.

Sonuç

Metin2 özel sunucularında client girişlerini sınırlandırmak, server performansını artıran ve adil bir oyun ortamı sağlayan önemli bir özelliktir. C++ tabanlı server geliştirme bilgisi, Python script desteği ve DB yönetimi ile bu işlem profesyonel seviyede uygulanabilir. Bu tür geliştirmeler, Metin2 sunucularında kayıt ve giriş süreçlerini daha kontrollü hale getirir.


How to Limit Client.exe Logins in Metin2

In Metin2 private servers, limiting the number of logins via client.exe is an important configuration option to enhance user experience and manage server resources more efficiently. In this guide, we will detail how to implement login restrictions in C++ based server systems. This process is critical for server security and performance.

Why Implement Login Restrictions?

In Metin2 private servers, allowing a player to run multiple clients simultaneously can disrupt PvP balance and create unnecessary load on the server. By implementing login limits, connections from each IP or account can be restricted according to predefined rules. This preserves server performance and ensures a fair gaming environment.

Implementing Login Limits in C++ Source Code

In Metin2 server environments, this process can be implemented at either the Auth Server or Game Server level. First, during user login, IP address checks must be performed on the auth server source code. Typically, upon receiving a login request, the number of active connections from the same IP address is checked.

As an example, the following logic can be followed at the C++ code level:
- When a user logs in, their IP address is stored in the database or memory.
- If a new connection arrives from the same IP, the defined limit is checked.
- If the limit is exceeded, the connection is rejected and a warning message is sent to the user.

Developing Supporting Scripts with Python

Metin2 servers can also integrate Python-based systems to simplify backend operations. Login controls based on IP can be configured more flexibly using scripts developed within PyRoot. For instance, a counter can be created in a py file to track the number of client logins per IP. This counter can be designed to work in sync with the auth server.

Controls on the Client Side

Login restrictions are not only effective on the server side but can also be supported by checks on the client side. For example, if another client is already running, launching a second client.exe can be prevented. Such controls are usually developed using C++ on UIScript or client source codes.

Database (DB) Integration

To maintain persistent and reliable login limits, logging IP addresses and connection counts in the DB is essential. This allows administrators to monitor client connections via admin panels and manually intervene when necessary. Database systems like MySQL or PostgreSQL support this process.

Conclusion

Limiting client logins in Metin2 private servers is an important feature that enhances server performance and creates a fair gameplay environment. With knowledge of C++-based server development, Python scripting support, and DB management, this task can be implemented professionally. Such improvements make registration and login processes more controllable in Metin2 servers.
 

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

Geri
Üst Alt