Not : Konu Alıntıdır. Arama yaptım, ama göremedim forumda konuyu, Daha önce açıldıysa kapatılabilir.
PythonNetworkStreamModule.cpp Açılır
Arat
Altına Ekle (portları kendi serverinin portlarıyla değiş)
Arat:
Altına Ekle;
Örnek ServerInfo.py:
Defineli eklemek isterseniz
Metin2 özel sunucularında geliştirme yaparken, bazı sistemlerin doğru şekilde entegre edilmesi büyük önem taşır. Bu bağlamda, ServerInfo Client(Exe) src'den çekme işlemi, sunucu yapılandırmasının istemci tarafında dinamik olarak okunmasını sağlar. Bu sayede farklı sunuculara özel bilgiler doğrudan derlenmiş istemci üzerinden alınabilir. Bu yazıda, ServerInfo Client exe dosyasını nasıl src'den çekip entegre edebileceğiniz detaylı olarak ele alınacaktır.
Neden ServerInfo Client Kullanılır?
Metin2 özel sunucularında genellikle birden fazla kanal veya sunucu barındırılır. Her biri farklı ayarlara sahip olabilir. Sunucu adı, IP, port gibi bilgiler sabit olursa, her değişiklikte exe dosyasının yeniden derlenmesi gerekir. Bu da hem zaman alıcıdır hem de esneklik sağlamaz. ServerInfo Client, bu bilgilerin kaynak koddan dinamik olarak çekilmesini sağlayarak, merkezi yönetim imkanı sunar.
src'den Bilgi Çekmenin Avantajları
src yani source code, sunucu tarafında çalışan ana yapıdır. Burada tanımlanan bilgilerin istemciye aktarılması, daha hızlı ve güvenilir bir yapı sunar. Özellikle çoklu sunuculu sistemlerde, her kanal için ayrı ayarlar tanımlanabilir. Örneğin, PVP sistemleri farklı kurulmuşsa, her kanalda farklı bir PvP modu aktif olabilir. Bu bilgiler src üzerinden çekilirse, client exe dosyasında herhangi bir değişiklik yapılmadan tüm ayarlar otomatik olarak güncellenmiş olur.
ServerInfo Entegrasyonu Nasıl Yapılır?
İlk olarak, authserver veya gameserver tarafında bir fonksiyon tanımlanır. Bu fonksiyon, istemciye gönderilecek olan serverinfo verilerini hazırlar. Genellikle JSON benzeri bir yapı kullanılır. Ardından client tarafında bu veriler alınarak gerekli ayarlar yapılır. Bu işlem sırasında Python GUI veya UIScript gibi arayüz yapıları da kullanılabilir. Bu sayede kullanıcıya daha kullanıcı dostu bir arayüz sağlanabilir.
C++ ile ServerInfo Tanımı
C++ tabanlı sunucu yapılarında, ServerInfo bilgileri genellikle header dosyalarında tanımlanır. Örnek olarak server_info.h dosyası oluşturulur ve bu dosya game core veya db core ile entegre edilir. Bu sayede sistemdeki tüm kanallar için farklı ayarlar tanımlanabilir. Bu yapı aynı zamanda compile işlemi sırasında da optimize edilebilir.
Client Exe Dosyasında Değişiklik
Client exe dosyası derlenirken, ServerInfo bilgileri derleme esnasında içeriye gömülebilir. Ancak bu yöntem sabittir. Dinamik yapı için src'den bilgi çekilmesi daha avantajlıdır. Bunun için root dizininde yer alan client.py veya main.py dosyasında gerekli ayarlamalar yapılır. Bu dosya py root olarak adlandırılır ve tüm sistemsel ayarlar burada yapılır.
Python ile Src'den Bilgi Çekme
Python scriptleri, Metin2 özel sunucularında sıklıkla kullanılır. Bu bağlamda, src'den server bilgilerini çeken bir Python modülü yazılabilir. Bu modül, authserver ile haberleşerek güncel bilgileri alır. Bu yapı py gui ile entegre edilirse, kullanıcıya sunulan arayüzde dinamik bilgiler gösterilebilir. Bu sayede kullanıcıların her kanalda farklı PvP sistemlerine erişimi kolaylaşır.
Martysama ve Diğer Geliştirici Araçları
Metin2 geliştiricileri arasında popüler olan Martysama gibi araçlar, src düzenlemelerinde büyük kolaylık sağlar. Bu tür araçlar sayesinde serverinfo çekme işlemi daha hızlı ve stabil hale getirilebilir. Ayrıca, paketleme süreçlerinde pack dosyaları ile birlikte bu yapı entegre edilebilir. Bu da deploy işlemlerini hızlandırır.
Sonuç
ServerInfo Client src'den çekme işlemi, Metin2 özel sunucu geliştiricileri için oldukça faydalı bir özelliktir. Dinamik yapı sayesinde hem bakım kolaylığı sunar hem de esnek yapılar oluşturulmasına olanak tanır. C++, Python, UIScript gibi teknolojilerle birlikte kullanıldığında güçlü bir sistem ortaya çıkar. Bu yapıyı doğru şekilde entegre eden sunucular, oyuncu deneyimini ciddi anlamda artırabilir.
While developing Metin2 private servers, correctly integrating certain systems is crucial. In this context, pulling ServerInfo Client(Exe) from src allows the server configuration to be dynamically read on the client side. This enables specific information for different servers to be retrieved directly from the compiled client. This article will detail how to pull and integrate the ServerInfo Client exe file from src.
Why Use ServerInfo Client?
On Metin2 private servers, there are often multiple channels or servers running. Each may have different settings. If server names, IPs, ports are hardcoded, then the exe file must be recompiled every time these details change. This is both time-consuming and lacks flexibility. ServerInfo Client allows these details to be pulled dynamically from the source code, providing centralized management capabilities.
Advantages of Pulling Info from src
src, or source code, is the core structure running on the server side. Transmitting information defined here to the client provides a faster and more reliable setup. Especially in multi-server environments, separate configurations can be defined for each channel. For example, if PVP systems are set up differently, each channel can run a distinct PvP mode. When this information is pulled from src, all settings update automatically without any changes needed in the client exe file.
How to Integrate ServerInfo?
Firstly, a function is defined on the authserver or gameserver side. This function prepares the serverinfo data to be sent to the client. Usually a JSON-like structure is used. Then, on the client side, this data is received and appropriate settings are applied. During this process, UI frameworks such as Python GUI or UIScript can also be used to provide a more user-friendly interface.
Defining ServerInfo with C++
In C++ based server structures, ServerInfo details are usually defined in header files. For example, a server_info.h file is created and integrated with the game core or db core. This way, different settings can be defined for all channels within the system. This structure can also be optimized during the compile process.
Modifying Client Exe File
When compiling the client exe file, ServerInfo details can be embedded at compile time. However, this method is static. Pulling info from src is more advantageous for dynamic structures. For this purpose, necessary adjustments are made in client.py or main.py located in the root directory. This file is known as py root and all system-level configurations are handled here.
Pulling Info from src with Python
Python scripts are frequently used in Metin2 private servers. In this regard, a Python module can be written to pull server details from src. This module communicates with the authserver to retrieve updated information. If this structure is integrated with py gui, dynamic information can be displayed in the user interface, making it easier for users to access different PvP systems across channels.
Martysama and Other Developer Tools
Tools like Martysama, popular among Metin2 developers, greatly facilitate src modifications. With such tools, the process of pulling serverinfo can be made faster and more stable. Moreover, this structure can be integrated with pack files during packaging processes, speeding up deployment operations.
Conclusion
Pulling ServerInfo Client from src is highly beneficial for Metin2 private server developers. The dynamic structure offers ease of maintenance and allows flexible systems to be built. When combined with technologies like C++, Python, and UIScript, it results in a powerful system. Servers that correctly integrate this structure can significantly enhance the player experience.
PythonNetworkStreamModule.cpp Açılır
Arat
Kod:
std::list<std::string> g_kList_strCommand;
Altına Ekle (portları kendi serverinin portlarıyla değiş)
Kod:
static const char* ServerIPVName[4][2] = { {"192.168.0.100", "turkmmo1"}, {"76.342.12.12", "turkmmo2"}, {"145.12.231.12", "turkmmo3"}, {"192.31.52.69", "turkmmo4"} }; static unsigned int ServerPORT[*] = {{1300},{1600},{1900},{2100},{1102},{1300}}; PyObject* netGetServer_IPNAME(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("ssssssss", ServerIPVName[0][0], ServerIPVName[0][1], ServerIPVName[1][0], ServerIPVName[1][1], ServerIPVName[2][0], ServerIPVName[2][1], ServerIPVName[3][0], ServerIPVName[3][1] ); } PyObject* netGetServer_PORT(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("iiiiii", ServerPORT[0],ServerPORT[1],ServerPORT[2],ServerPORT[3],ServerPORT[4],ServerPORT[5]); }
Arat:
Kod:
{ "SendOnClickPacket", netOnClickPacket, METH_VARARGS },
Altına Ekle;
Kod:
{ "GetServer_IPNAME", netGetServer_IPNAME, METH_VARARGS }, { "GetServer_PORT", netGetServer_PORT, METH_VARARGS },
Örnek ServerInfo.py:
Kod:
import net (sv1_ip, sv1_name, sv2_ip, sv2_name, sv3_ip, sv3_name, sv4_ip, sv4_name) = net.GetServer_IPNAME() (ch1_port, ch2_port, ch3_port, ch4_port, auth_port, mark_port) = net.GetServer_PORT() CH_1_NAME = "|cFF00FFFF|hCH1" CH_2_NAME = "|cFF00FFFF|hCH2" CH_3_NAME = "|cFF00FFFF|hCH3" CH_4_NAME = "|cFF00FFFF|hCH4" STATE_NONE = "|cFFFF0000|hKAPALI" STATE_DICT = { 0 : "|cFFFF0000|hKAPALI", 1 : "|cff00ff00|hNORMAL", 2 : "|cff00ff00|hYOGUN", 3 : "|cff00ff00|hDOLU" } SERVER01_CHANNEL_DICT = { 1:{"key":11,"name":CH_1_NAME,"ip":sv1_ip,"tcp_port":ch1_port,"udp_port":ch1_port,"state":STATE_NONE,}, 2:{"key":12,"name":CH_2_NAME,"ip":sv1_ip,"tcp_port":ch2_port,"udp_port":ch2_port,"state":STATE_NONE,}, 3:{"key":13,"name":CH_3_NAME,"ip":sv1_ip,"tcp_port":ch3_port,"udp_port":ch3_port,"state":STATE_NONE,}, 4:{"key":14,"name":CH_4_NAME,"ip":sv1_ip,"tcp_port":ch4_port,"udp_port":ch4_port,"state":STATE_NONE,}, } SERVER02_CHANNEL_DICT = { 1:{"key":11,"name":CH_1_NAME,"ip":sv2_ip,"tcp_port":ch1_port,"udp_port":ch1_port,"state":STATE_NONE,}, 2:{"key":12,"name":CH_2_NAME,"ip":sv2_ip,"tcp_port":ch2_port,"udp_port":ch2_port,"state":STATE_NONE,}, 3:{"key":13,"name":CH_3_NAME,"ip":sv2_ip,"tcp_port":ch3_port,"udp_port":ch3_port,"state":STATE_NONE,}, 4:{"key":14,"name":CH_4_NAME,"ip":sv2_ip,"tcp_port":ch4_port,"udp_port":ch4_port,"state":STATE_NONE,}, } SERVER03_CHANNEL_DICT = { 1:{"key":11,"name":CH_1_NAME,"ip":sv3_ip,"tcp_port":ch1_port,"udp_port":ch1_port,"state":STATE_NONE,}, 2:{"key":12,"name":CH_2_NAME,"ip":sv3_ip,"tcp_port":ch2_port,"udp_port":ch2_port,"state":STATE_NONE,}, 3:{"key":13,"name":CH_3_NAME,"ip":sv3_ip,"tcp_port":ch3_port,"udp_port":ch3_port,"state":STATE_NONE,}, 4:{"key":14,"name":CH_4_NAME,"ip":sv3_ip,"tcp_port":ch4_port,"udp_port":ch4_port,"state":STATE_NONE,}, } SERVER04_CHANNEL_DICT = { 1:{"key":11,"name":CH_1_NAME,"ip":sv4_ip,"tcp_port":ch1_port,"udp_port":ch1_port,"state":STATE_NONE,}, 2:{"key":12,"name":CH_2_NAME,"ip":sv4_ip,"tcp_port":ch2_port,"udp_port":ch2_port,"state":STATE_NONE,}, 3:{"key":13,"name":CH_3_NAME,"ip":sv4_ip,"tcp_port":ch3_port,"udp_port":ch3_port,"state":STATE_NONE,}, 4:{"key":14,"name":CH_4_NAME,"ip":sv4_ip,"tcp_port":ch4_port,"udp_port":ch4_port,"state":STATE_NONE,}, } REGION_NAME_DICT = { 0 : "", } REGION_AUTH_SERVER_DICT = { 0 : { 1 : { "ip":sv1_ip, "port":auth_port, }, 2 : { "ip":sv2_ip, "port":auth_port, }, 3 : { "ip":sv3_ip, "port":auth_port, }, 4 : { "ip":sv4_ip, "port":auth_port, }, } } REGION_DICT = { 0 : { 1 : { "name" :sv1_name, "channel" : SERVER01_CHANNEL_DICT, }, 2 : { "name" :sv2_name, "channel" : SERVER02_CHANNEL_DICT, }, 3 : { "name" :sv3_name, "channel" : SERVER03_CHANNEL_DICT, }, 4 : { "name" :sv4_name, "channel" : SERVER04_CHANNEL_DICT, }, }, } MARKADDR_DICT = { 10 : { "ip" : sv1_ip, "tcp_port" : mark_port, "mark" : "10.tga", "symbol_path" : "10", }, 20 : { "ip" : sv2_ip, "tcp_port" : mark_port, "mark" : "20.tga", "symbol_path" : "20", }, 30 : { "ip" : sv3_ip, "tcp_port" : mark_port, "mark" : "30.tga", "symbol_path" : "30", }, 40 : { "ip" : sv4_ip, "tcp_port" : mark_port, "mark" : "40.tga", "symbol_path" : "40", }, }
Defineli eklemek isterseniz
Kod:
#ifdef SERVERINFO_FOR_CLIENT static const char* ServerIPVName[4][2] = { {"192.168.0.100", "turkmmo1"}, {"76.342.12.12", "turkmmo2"}, {"145.12.231.12", "turkmmo3"}, {"192.31.52.69", "turkmmo4"} }; static unsigned int ServerPORT[*] = {{13000},{16000},{19000},{21000},{11002},{13000}}; PyObject* netGetServer_IPNAME(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("ssssssss", ServerIPVName[0][0], ServerIPVName[0][1], ServerIPVName[1][0], ServerIPVName[1][1], ServerIPVName[2][0], ServerIPVName[2][1], ServerIPVName[3][0], ServerIPVName[3][1] ); } PyObject* netGetServer_PORT(PyObject* poSelf, PyObject* poArgs) { return Py_BuildValue("iiiiii", ServerPORT[0],ServerPORT[1],ServerPORT[2],ServerPORT[3],ServerPORT[4],ServerPORT[5]); } #endif
ServerInfo Client(Exe) src'den Çekme
Metin2 özel sunucularında geliştirme yaparken, bazı sistemlerin doğru şekilde entegre edilmesi büyük önem taşır. Bu bağlamda, ServerInfo Client(Exe) src'den çekme işlemi, sunucu yapılandırmasının istemci tarafında dinamik olarak okunmasını sağlar. Bu sayede farklı sunuculara özel bilgiler doğrudan derlenmiş istemci üzerinden alınabilir. Bu yazıda, ServerInfo Client exe dosyasını nasıl src'den çekip entegre edebileceğiniz detaylı olarak ele alınacaktır.
Neden ServerInfo Client Kullanılır?
Metin2 özel sunucularında genellikle birden fazla kanal veya sunucu barındırılır. Her biri farklı ayarlara sahip olabilir. Sunucu adı, IP, port gibi bilgiler sabit olursa, her değişiklikte exe dosyasının yeniden derlenmesi gerekir. Bu da hem zaman alıcıdır hem de esneklik sağlamaz. ServerInfo Client, bu bilgilerin kaynak koddan dinamik olarak çekilmesini sağlayarak, merkezi yönetim imkanı sunar.
src'den Bilgi Çekmenin Avantajları
src yani source code, sunucu tarafında çalışan ana yapıdır. Burada tanımlanan bilgilerin istemciye aktarılması, daha hızlı ve güvenilir bir yapı sunar. Özellikle çoklu sunuculu sistemlerde, her kanal için ayrı ayarlar tanımlanabilir. Örneğin, PVP sistemleri farklı kurulmuşsa, her kanalda farklı bir PvP modu aktif olabilir. Bu bilgiler src üzerinden çekilirse, client exe dosyasında herhangi bir değişiklik yapılmadan tüm ayarlar otomatik olarak güncellenmiş olur.
ServerInfo Entegrasyonu Nasıl Yapılır?
İlk olarak, authserver veya gameserver tarafında bir fonksiyon tanımlanır. Bu fonksiyon, istemciye gönderilecek olan serverinfo verilerini hazırlar. Genellikle JSON benzeri bir yapı kullanılır. Ardından client tarafında bu veriler alınarak gerekli ayarlar yapılır. Bu işlem sırasında Python GUI veya UIScript gibi arayüz yapıları da kullanılabilir. Bu sayede kullanıcıya daha kullanıcı dostu bir arayüz sağlanabilir.
C++ ile ServerInfo Tanımı
C++ tabanlı sunucu yapılarında, ServerInfo bilgileri genellikle header dosyalarında tanımlanır. Örnek olarak server_info.h dosyası oluşturulur ve bu dosya game core veya db core ile entegre edilir. Bu sayede sistemdeki tüm kanallar için farklı ayarlar tanımlanabilir. Bu yapı aynı zamanda compile işlemi sırasında da optimize edilebilir.
Client Exe Dosyasında Değişiklik
Client exe dosyası derlenirken, ServerInfo bilgileri derleme esnasında içeriye gömülebilir. Ancak bu yöntem sabittir. Dinamik yapı için src'den bilgi çekilmesi daha avantajlıdır. Bunun için root dizininde yer alan client.py veya main.py dosyasında gerekli ayarlamalar yapılır. Bu dosya py root olarak adlandırılır ve tüm sistemsel ayarlar burada yapılır.
Python ile Src'den Bilgi Çekme
Python scriptleri, Metin2 özel sunucularında sıklıkla kullanılır. Bu bağlamda, src'den server bilgilerini çeken bir Python modülü yazılabilir. Bu modül, authserver ile haberleşerek güncel bilgileri alır. Bu yapı py gui ile entegre edilirse, kullanıcıya sunulan arayüzde dinamik bilgiler gösterilebilir. Bu sayede kullanıcıların her kanalda farklı PvP sistemlerine erişimi kolaylaşır.
Martysama ve Diğer Geliştirici Araçları
Metin2 geliştiricileri arasında popüler olan Martysama gibi araçlar, src düzenlemelerinde büyük kolaylık sağlar. Bu tür araçlar sayesinde serverinfo çekme işlemi daha hızlı ve stabil hale getirilebilir. Ayrıca, paketleme süreçlerinde pack dosyaları ile birlikte bu yapı entegre edilebilir. Bu da deploy işlemlerini hızlandırır.
Sonuç
ServerInfo Client src'den çekme işlemi, Metin2 özel sunucu geliştiricileri için oldukça faydalı bir özelliktir. Dinamik yapı sayesinde hem bakım kolaylığı sunar hem de esnek yapılar oluşturulmasına olanak tanır. C++, Python, UIScript gibi teknolojilerle birlikte kullanıldığında güçlü bir sistem ortaya çıkar. Bu yapıyı doğru şekilde entegre eden sunucular, oyuncu deneyimini ciddi anlamda artırabilir.
Pulling ServerInfo Client(Exe) from src
While developing Metin2 private servers, correctly integrating certain systems is crucial. In this context, pulling ServerInfo Client(Exe) from src allows the server configuration to be dynamically read on the client side. This enables specific information for different servers to be retrieved directly from the compiled client. This article will detail how to pull and integrate the ServerInfo Client exe file from src.
Why Use ServerInfo Client?
On Metin2 private servers, there are often multiple channels or servers running. Each may have different settings. If server names, IPs, ports are hardcoded, then the exe file must be recompiled every time these details change. This is both time-consuming and lacks flexibility. ServerInfo Client allows these details to be pulled dynamically from the source code, providing centralized management capabilities.
Advantages of Pulling Info from src
src, or source code, is the core structure running on the server side. Transmitting information defined here to the client provides a faster and more reliable setup. Especially in multi-server environments, separate configurations can be defined for each channel. For example, if PVP systems are set up differently, each channel can run a distinct PvP mode. When this information is pulled from src, all settings update automatically without any changes needed in the client exe file.
How to Integrate ServerInfo?
Firstly, a function is defined on the authserver or gameserver side. This function prepares the serverinfo data to be sent to the client. Usually a JSON-like structure is used. Then, on the client side, this data is received and appropriate settings are applied. During this process, UI frameworks such as Python GUI or UIScript can also be used to provide a more user-friendly interface.
Defining ServerInfo with C++
In C++ based server structures, ServerInfo details are usually defined in header files. For example, a server_info.h file is created and integrated with the game core or db core. This way, different settings can be defined for all channels within the system. This structure can also be optimized during the compile process.
Modifying Client Exe File
When compiling the client exe file, ServerInfo details can be embedded at compile time. However, this method is static. Pulling info from src is more advantageous for dynamic structures. For this purpose, necessary adjustments are made in client.py or main.py located in the root directory. This file is known as py root and all system-level configurations are handled here.
Pulling Info from src with Python
Python scripts are frequently used in Metin2 private servers. In this regard, a Python module can be written to pull server details from src. This module communicates with the authserver to retrieve updated information. If this structure is integrated with py gui, dynamic information can be displayed in the user interface, making it easier for users to access different PvP systems across channels.
Martysama and Other Developer Tools
Tools like Martysama, popular among Metin2 developers, greatly facilitate src modifications. With such tools, the process of pulling serverinfo can be made faster and more stable. Moreover, this structure can be integrated with pack files during packaging processes, speeding up deployment operations.
Conclusion
Pulling ServerInfo Client from src is highly beneficial for Metin2 private server developers. The dynamic structure offers ease of maintenance and allows flexible systems to be built. When combined with technologies like C++, Python, and UIScript, it results in a powerful system. Servers that correctly integrate this structure can significantly enhance the player experience.
