Sistem:
1. cmd_general.cpp
Nereye: Dosyanın herhangi bir yerine (genelde en alt uygundur)
ACMD(do_gmpm)
{
if (ch->GetGMLevel() < GM_HIGH_WIZARD) {
ch->ChatPacket(CHAT_TYPE_INFO, "Bu komutu kullanmaya yetkiniz yok.");
return;
}
if (!*argument) {
ch->ChatPacket(CHAT_TYPE_INFO, "Kullanım: /gmpm [mesaj]");
return;
}
const DESC_MANAGER:ESC_SET& c_set = DESC_MANAGER::instance().GetClientSet();
for (DESC_MANAGER:ESC_SET::const_iterator it = c_set.begin(); it != c_set.end(); ++it)
{
LPDESC d = *it;
if (!d)
continue;
LPCHARACTER t = d->GetCharacter();
if (!t || t == ch)
continue;
TPacketGCWhisper pack;
pack.bHeader = HEADER_GC_WHISPER;
pack.wSize = sizeof(TPacketGCWhisper) + strlen(argument) + 1;
pack.bType = WHISPER_TYPE_NORMAL;
strlcpy(pack.szNameFrom, ch->GetName(), sizeof(pack.szNameFrom));
d->BufferedPacket(&pack, sizeof(pack));
d->Packet(argument, strlen(argument) + 1);
}
ch->ChatPacket(CHAT_TYPE_INFO, "Mesaj tüm oyunculara PM olarak gönderildi.");
}
```
---
cmd.cpp
Fonksiyon bildirimlerinin olduğu kısım (genelde en üstte):
ACMD(do_gmpm);
```
#### Komut listesi içinde `cmd_info[*]` dizisine:
{ "gmpm", do_gmpm, 0, POS_DEAD, GM_HIGH_WIZARD },
```
Kullanım
/gmpm Merhaba! Etkinlik birazdan başlıyor!
```
Oyuncular mesajı PM olarak alır. Cevap verirlerse doğrudan GM’e ulaşır.
bu sistem ile sadece game taraflı değişiklik ekleme yapıp client ve pack taraflı bir entegre yapmaya gerek kalmaz.
KANIT:
GM Tek Bir Komutla Online Oyunculara PM Atsın
Metin2 özel sunucularında oyun yönetimi sırasında, bir Game Master (GM) 'ın online olan tüm oyunculara hızlıca mesaj göndermesi oldukça faydalıdır. Bu özellikle duyuru, bakım bilgilendirme veya olay başlatma gibi durumlarda zaman kazandırır. Bu sistem, hem oyun içi etkileşimi artırır hem de yönetim kolaylığı sağlar. Bu yazıda, GM 'ın tek bir komutla online tüm oyunculara özel mesaj (PM) gönderebilmesini sağlayan bir sistem nasıl geliştirilir, onu ele alacağız.
Sistem Hakkında Genel Bilgi
Metin2 özel sunucularında, GM yetkileri genellikle Python tabanlı sunucu tarafında geliştirilen sistemlerle yönetilir. Bu sistemlerde, GM komutları genellikle 'cmdlib.py' dosyası üzerinden tanımlanır. Burada özel bir komut tanımlanarak, online tüm oyunculara özel mesaj gönderilmesi sağlanabilir. Bu işlem sırasında 'game' ve 'db' core yapıları kullanılır.
Komut Yapısı
Öncelikle, bir GM komutu tanımlamak gerekir. Örneğin '/pmall' komutu kullanılabilir. Bu komut çalıştırıldığında, sistem online oyuncuların listesini çeker ve her birine özel mesaj gönderilir. Bu işlem sırasında her oyuncuya özel bir PM (özel mesaj) gönderilir. Komutun yapısı şu şekildedir:
Python Kod Örneği
Güvenlik ve Kullanım Notları
Bu tür komutlar, sadece yetkilendirilmiş kullanıcılar tarafından kullanılmalıdır. Yanlış kullanım, spam yaratıp oyuncu deneyimini bozabilir. Ayrıca, mesaj içerikleri filtrelenmelidir. Sistemde 'chat filter' mekanizmaları da aktif tutulmalıdır.
Sunucu Tarafında Entegrasyon[/CODE]
Bu sistem, genellikle 'game' sunucusunda çalışır. Auth sunucusuyla doğrudan bağlantısı yoktur. Ancak, online oyuncuların listesi için 'db' sunucusundan veri çekmek gerekebilir. Bu nedenle, doğru core entegrasyonu önemlidir.
Yararlı Uygulamalar[/CODE]
• Sunucuda duyuru yapmak
• Oyun içi etkinlik başlatmak
• Oyunculara bakım bildirimi göndermek
• Yeni özellik duyurusu yapmak
Alternatif Yaklaşımlar
Bazı sunucularda, bu komut yerine global mesaj sistemi tercih edilebilir. Ancak, PM ile yapılan iletişim daha kişisel ve dikkat çekici olur. Ayrıca, tüm oyunculara mesaj göndermenin başka yolları da olabilir. Örneğin, e-mail sistemi üzerinden bildirim göndermek gibi. Ancak bu, oyun içi değil, sistem düzeyinde bir çözüm olacaktır.
Sonuç
GM 'ların tek komutla online oyunculara özel mesaj göndermesi, Metin2 özel sunucularında oldukça faydalı bir özelliktir. Bu işlem, Python tabanlı sistemlerle kolayca entegre edilebilir. Ancak, güvenlik önlemleri alınmalı ve komutlar sadece yetkili kullanıcılar tarafından kullanılmalıdır.
GM Send PM to Online Players with One Command
In Metin2 private servers, during game management, it is very useful for a Game Master (GM) to quickly send messages to all online players. This is especially helpful for announcements, maintenance notifications, or starting events. This system increases in-game interaction and provides management ease. In this article, we will examine how to develop a system that allows a GM to send private messages (PM) to all online players with a single command.
General Information about the System
In Metin2 private servers, GM privileges are typically managed through systems developed in Python-based server-side code. These systems usually define GM commands via the 'cmdlib.py' file. By defining a custom command here, a system can be created to send private messages to all online players. During this process, 'game' and 'db' core structures are used.
Command Structure
Firstly, a GM command must be defined. For example, the '/pmall' command can be used. When this command is executed, the system retrieves the list of online players and sends a private message to each one. The structure of the command is as follows:
Python Code Example
Security and Usage Notes
These types of commands should only be used by authorized users. Misuse can create spam and negatively affect the player experience. Additionally, message contents should be filtered. Chat filtering mechanisms should also remain active within the system.
Server-Side Integration
This system generally runs on the 'game' server. It does not have a direct connection with the auth server. However, data may need to be retrieved from the 'db' server to get the list of online players. Therefore, correct core integration is important.
Useful Applications
• Making announcements on the server
• Starting in-game events
• Sending maintenance notifications to players
• Announcing new features
Alternative Approaches
In some servers, a global message system might be preferred instead of this command. However, communication via PM is more personal and attention-grabbing. There might be other ways to send messages to all players. For example, sending notifications via an email system. However, this would be a system-level solution rather than an in-game one.
Conclusion
Allowing GMs to send private messages to online players with a single command is a highly beneficial feature in Metin2 private servers. This operation can easily be integrated into Python-based systems. However, security measures must be taken, and commands should only be used by authorized personnel.
Ziyaretçiler için gizlenmiş link,görmek için üye olmalısınız!
Giriş yap veya üye ol.
filesine kurulmuştur.1. cmd_general.cpp
Nereye: Dosyanın herhangi bir yerine (genelde en alt uygundur)
ACMD(do_gmpm)
{
if (ch->GetGMLevel() < GM_HIGH_WIZARD) {
ch->ChatPacket(CHAT_TYPE_INFO, "Bu komutu kullanmaya yetkiniz yok.");
return;
}
if (!*argument) {
ch->ChatPacket(CHAT_TYPE_INFO, "Kullanım: /gmpm [mesaj]");
return;
}
const DESC_MANAGER:ESC_SET& c_set = DESC_MANAGER::instance().GetClientSet();
for (DESC_MANAGER:ESC_SET::const_iterator it = c_set.begin(); it != c_set.end(); ++it)
{
LPDESC d = *it;
if (!d)
continue;
LPCHARACTER t = d->GetCharacter();
if (!t || t == ch)
continue;
TPacketGCWhisper pack;
pack.bHeader = HEADER_GC_WHISPER;
pack.wSize = sizeof(TPacketGCWhisper) + strlen(argument) + 1;
pack.bType = WHISPER_TYPE_NORMAL;
strlcpy(pack.szNameFrom, ch->GetName(), sizeof(pack.szNameFrom));
d->BufferedPacket(&pack, sizeof(pack));
d->Packet(argument, strlen(argument) + 1);
}
ch->ChatPacket(CHAT_TYPE_INFO, "Mesaj tüm oyunculara PM olarak gönderildi.");
}
```
---
cmd.cpp
Fonksiyon bildirimlerinin olduğu kısım (genelde en üstte):
ACMD(do_gmpm);
```
#### Komut listesi içinde `cmd_info[*]` dizisine:
{ "gmpm", do_gmpm, 0, POS_DEAD, GM_HIGH_WIZARD },
```
Kullanım
/gmpm Merhaba! Etkinlik birazdan başlıyor!
```
Oyuncular mesajı PM olarak alır. Cevap verirlerse doğrudan GM’e ulaşır.
bu sistem ile sadece game taraflı değişiklik ekleme yapıp client ve pack taraflı bir entegre yapmaya gerek kalmaz.
KANIT:
GM Tek Bir Komutla Online Oyunculara PM Atsın
Metin2 özel sunucularında oyun yönetimi sırasında, bir Game Master (GM) 'ın online olan tüm oyunculara hızlıca mesaj göndermesi oldukça faydalıdır. Bu özellikle duyuru, bakım bilgilendirme veya olay başlatma gibi durumlarda zaman kazandırır. Bu sistem, hem oyun içi etkileşimi artırır hem de yönetim kolaylığı sağlar. Bu yazıda, GM 'ın tek bir komutla online tüm oyunculara özel mesaj (PM) gönderebilmesini sağlayan bir sistem nasıl geliştirilir, onu ele alacağız.
Sistem Hakkında Genel Bilgi
Metin2 özel sunucularında, GM yetkileri genellikle Python tabanlı sunucu tarafında geliştirilen sistemlerle yönetilir. Bu sistemlerde, GM komutları genellikle 'cmdlib.py' dosyası üzerinden tanımlanır. Burada özel bir komut tanımlanarak, online tüm oyunculara özel mesaj gönderilmesi sağlanabilir. Bu işlem sırasında 'game' ve 'db' core yapıları kullanılır.
Komut Yapısı
Öncelikle, bir GM komutu tanımlamak gerekir. Örneğin '/pmall' komutu kullanılabilir. Bu komut çalıştırıldığında, sistem online oyuncuların listesini çeker ve her birine özel mesaj gönderilir. Bu işlem sırasında her oyuncuya özel bir PM (özel mesaj) gönderilir. Komutun yapısı şu şekildedir:
Python Kod Örneği
Kod:
[BR][/BR]def pm_all_command(chat, player, message):[BR][/BR] if not player.IsGM():[BR][/BR] return[BR][/BR][BR][/BR] for pid in player.GetOnlinePlayers():[BR][/BR] chat.SendWhisper(pid, message)[BR][/BR][BR][/BR]cmdlib.AddCommand('/pmall', pm_all_command)
Güvenlik ve Kullanım Notları
Bu tür komutlar, sadece yetkilendirilmiş kullanıcılar tarafından kullanılmalıdır. Yanlış kullanım, spam yaratıp oyuncu deneyimini bozabilir. Ayrıca, mesaj içerikleri filtrelenmelidir. Sistemde 'chat filter' mekanizmaları da aktif tutulmalıdır.
Sunucu Tarafında Entegrasyon[/CODE]
Bu sistem, genellikle 'game' sunucusunda çalışır. Auth sunucusuyla doğrudan bağlantısı yoktur. Ancak, online oyuncuların listesi için 'db' sunucusundan veri çekmek gerekebilir. Bu nedenle, doğru core entegrasyonu önemlidir.
Yararlı Uygulamalar[/CODE]
• Sunucuda duyuru yapmak
• Oyun içi etkinlik başlatmak
• Oyunculara bakım bildirimi göndermek
• Yeni özellik duyurusu yapmak
Alternatif Yaklaşımlar
Bazı sunucularda, bu komut yerine global mesaj sistemi tercih edilebilir. Ancak, PM ile yapılan iletişim daha kişisel ve dikkat çekici olur. Ayrıca, tüm oyunculara mesaj göndermenin başka yolları da olabilir. Örneğin, e-mail sistemi üzerinden bildirim göndermek gibi. Ancak bu, oyun içi değil, sistem düzeyinde bir çözüm olacaktır.
Sonuç
GM 'ların tek komutla online oyunculara özel mesaj göndermesi, Metin2 özel sunucularında oldukça faydalı bir özelliktir. Bu işlem, Python tabanlı sistemlerle kolayca entegre edilebilir. Ancak, güvenlik önlemleri alınmalı ve komutlar sadece yetkili kullanıcılar tarafından kullanılmalıdır.
GM Send PM to Online Players with One Command
In Metin2 private servers, during game management, it is very useful for a Game Master (GM) to quickly send messages to all online players. This is especially helpful for announcements, maintenance notifications, or starting events. This system increases in-game interaction and provides management ease. In this article, we will examine how to develop a system that allows a GM to send private messages (PM) to all online players with a single command.
General Information about the System
In Metin2 private servers, GM privileges are typically managed through systems developed in Python-based server-side code. These systems usually define GM commands via the 'cmdlib.py' file. By defining a custom command here, a system can be created to send private messages to all online players. During this process, 'game' and 'db' core structures are used.
Command Structure
Firstly, a GM command must be defined. For example, the '/pmall' command can be used. When this command is executed, the system retrieves the list of online players and sends a private message to each one. The structure of the command is as follows:
Python Code Example
Kod:
[BR][/BR]def pm_all_command(chat, player, message):[BR][/BR] if not player.IsGM():[BR][/BR] return[BR][/BR][BR][/BR] for pid in player.GetOnlinePlayers():[BR][/BR] chat.SendWhisper(pid, message)[BR][/BR][BR][/BR]cmdlib.AddCommand('/pmall', pm_all_command)
Security and Usage Notes
These types of commands should only be used by authorized users. Misuse can create spam and negatively affect the player experience. Additionally, message contents should be filtered. Chat filtering mechanisms should also remain active within the system.
Server-Side Integration
This system generally runs on the 'game' server. It does not have a direct connection with the auth server. However, data may need to be retrieved from the 'db' server to get the list of online players. Therefore, correct core integration is important.
Useful Applications
• Making announcements on the server
• Starting in-game events
• Sending maintenance notifications to players
• Announcing new features
Alternative Approaches
In some servers, a global message system might be preferred instead of this command. However, communication via PM is more personal and attention-grabbing. There might be other ways to send messages to all players. For example, sending notifications via an email system. However, this would be a system-level solution rather than an in-game one.
Conclusion
Allowing GMs to send private messages to online players with a single command is a highly beneficial feature in Metin2 private servers. This operation can easily be integrated into Python-based systems. However, security measures must be taken, and commands should only be used by authorized personnel.
