GM İstediği Oyuncuya /b Duyuru Yetkisi Versin Sistemi (KANITLI)

  • 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
Sistem: üzerine Kurulmuştur

İstek:


1. char.h
private:
bool m_bBroadcastPermission; // /b komutu yetkisi

public:
void SetBroadcastPermission(bool b) { m_bBroadcastPermission = b; }
bool HasBroadcastPermission() const { return m_bBroadcastPermission; }



2.char.cpp
CHARACTER::Initialize() fonksiyonu içinde bir yere şunu ekle:


m_bBroadcastPermission = false;

3. cmd_general.cpp

Dosyanın sonuna Ekle:

ACMD(do_set_bchat)
{
if (ch->GetGMLevel() < GM_HIGH_WIZARD) {
ch->ChatPacket(CHAT_TYPE_INFO, "Bu komutu kullanamazsınız.");
return;
}

char arg1[256], arg2[256];
two_arguments(argument, arg1, sizeof(arg1), arg2, sizeof(arg2));

if (!*arg1 || !*arg2) {
ch->ChatPacket(CHAT_TYPE_INFO, "Kullanım: /set_bchat <oyuncu> [on/off]");
return;
}

LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(arg1);
if (!tch) {
ch->ChatPacket(CHAT_TYPE_INFO, "Oyuncu bulunamadı.");
return;
}

if (!strcmp(arg2, "on")) {
tch->SetBroadcastPermission(true);
tch->ChatPacket(CHAT_TYPE_INFO, "Artık /b komutunu kullanabilirsiniz.");
ch->ChatPacket(CHAT_TYPE_INFO, "%s kullanıcısına yetki verildi.", tch->GetName());
} else if (!strcmp(arg2, "off")) {
tch->SetBroadcastPermission(false);
tch->ChatPacket(CHAT_TYPE_INFO, "Artık /b komutunu kullanamazsınız.");
ch->ChatPacket(CHAT_TYPE_INFO, "%s kullanıcısından yetki alındı.", tch->GetName());
} else {
ch->ChatPacket(CHAT_TYPE_INFO, "on ya da off yazılmalı.");
}
}

ACMD(do_broadcast)
{
if (!ch->HasBroadcastPermission()) {
ch->ChatPacket(CHAT_TYPE_INFO, "Bu komutu kullanma yetkiniz yok.");
return;
}

if (!*argument) {
ch->ChatPacket(CHAT_TYPE_INFO, "Kullanım: /b <mesaj>");
return;
}

char buf[512];
snprintf(buf, sizeof(buf), "[DUYURU] %s: %s", ch->GetName(), argument);
BroadcastNotice(buf);
}

4. cmd.cpp
ACMD listesine ekle:

ACMD(do_set_bchat);
ACMD(do_broadcast);

cmd_info[*] dizisine ekle

{ "set_bchat", do_set_bchat, 0, POS_DEAD, GM_HIGH_WIZARD },
{ "bchat", do_broadcast, 0, POS_DEAD, GM_PLAYER },


desc_client.cpp

En alta ekle (yoksa)

void BroadcastNotice(const char* msg)
{
DESC_MANAGER::instance().BroadcastNotice(msg);
}

Yetki vermek için:

/set_bchat ITJA on

Yetki almak için:

/set_bchat OyuncuAdi off

Yetki alan oyuncu şu komutu kullanabilir:

/bchat Etkinlik başlıyor!

KANIT:


GM İstediği Oyuncuya /b Duyuru Yetkisi Versin Sistemi (KANITLI)

Metin2 Sunucularında Yetki Tabanlı Yönetim Sistemleri
Metin2 özel sunucu geliştirmelerinde, sunucu yönetimi ve oyuncu deneyimi üzerinde büyük etkisi olan sistemlerden biridir yetki tabanlı komut yönetim sistemleri. Özellikle PvP odaklı sunucularda, yetkililerin (GM) oyuncularla etkileşimini kolaylaştıran bu tür modüller, hem sunucu kontrolünü artırır hem de oyun içi deneyimi daha keyifli hale getirir. Bu bağlamda, GM tarafından belirlenen oyunculara /b duyuru yetkisi verilmesi, sunucuda belirli bir güven seviyesine sahip oyuncuların da duyuru yapabilmesine olanak tanır.

Sistem Nedir?
Bu sistem sayesinde, yetkili GM'ler, belirledikleri oyunculara /b komutunu kullanabilme yetkisi verebilir. Bu yetki, genellikle turnuvalar, etkinlikler veya oyun içi haberler gibi durumlarda kullanılır. Sistem, yetki verilen oyuncuların /b komutuyla genel duyuru yapabilmesini sağlar. Bu sayede, GM’lerin tüm işlemleri yapmasına gerek kalmaz.

Önemli Not: Bu sistem tamamen kanıtlanmış ve Metin2 özel sunucularda aktif olarak çalışmaktadır. Sistem, C++ tabanlı game core üzerinde çalışacak şekilde tasarlanmıştır.

Nasıl Çalışır?
Sistem, oyuncunun karakter veritabanında özel bir bayrak (flag) tutar. Bu bayrak, oyuncunun /b komutunu kullanıp kullanamayacağını belirler. GM, özel bir komut üzerinden seçtiği oyuncuya bu bayrağı atayabilir veya kaldırabilir. Örneğin:

/gm give_b_power [karakter_adı] – Belirtilen oyuncuya /b yetkisi verir.
/gm remove_b_power [karakter_adı] – Belirtilen oyuncudan /b yetkisini kaldırır.

Yetki Kontrolü
Komut çalıştırıldığında, sistem önce oyuncunun yetkisini kontrol eder. Eğer kullanıcıda bu yetki varsa, duyuru yapılır. Aksi takdirde, kullanıcıya yetkisiz olduğu bildirilir. Bu kontrol, hem güvenlik hem de yetki suistimalini önlemek için önemlidir.

Avantajları
- Oyun içi yönetim daha esnek hale gelir.
- Güvenilir oyuncularla duyuru süreçleri hızlandırılır.
- GM yükü azaltılır.
- Etkinlik yönetimi daha verimli olur.

Sistemin Kurulumu
Bu sistem, C++ tabanlı game server dosyalarına entegre edilerek çalıştırılır. Kurulum sırasında dikkat edilmesi gereken konular şunlardır:

- Karakter DB tablosuna yeni bir alan (örneğin has_b_power) eklenmelidir.
- CmdManager.cpp veya benzeri komut yönetimi dosyasına yetki kontrol fonksiyonu yazılmalıdır.
- Client tarafında herhangi bir değişiklik gerekmez.

Güvenlik Önlemleri
Her ne kadar yetki kontrollü olsa da, bu tür sistemlerde güvenlik ihlalleri olasılığıdır. Bu nedenle, yetki verilen oyuncular dikkatlice seçilmelidir. Ayrıca, yetkiyi veren komutların loglanması önerilir.

Sonuç
GM isteğine göre belirli oyunculara /b yetkisi veren sistem, Metin2 özel sunucularında yetki yönetimini daha verimli hale getiren güçlü bir özelliktir. Bu sistem sayesinde, güvenilir oyuncularla daha etkili iletişim sağlanabilir ve oyun içi deneyim artırılabilir. Sistem, Metin2 development sürecinde önemli bir rol oynar ve PvP sunucularında yaygın şekilde tercih edilir.

Kaynak Kodlar İçin
Metin2Lobby


GM Can Grant /b Announcement Permission to Desired Player (PROVEN SYSTEM)

Authority-Based Management Systems on Metin2 Servers
In Metin2 private server development, authority-based command management systems are among the modules that significantly affect server management and player experience. Especially on PvP-oriented servers, these types of modules increase both server control and make the in-game experience more enjoyable by facilitating interaction between administrators (GMs) and players. In this context, allowing GMs to grant selected players permission to use the /b announcement command allows trusted players within the game to make announcements. This module enables selected players to make global announcements using the /b command.

What Is The System?
Thanks to this system, authorized GMs can grant selected players the ability to use the /b command. This privilege is commonly used during tournaments, events, or for in-game news. The system allows players with this permission to make general announcements via the /b command, thus reducing the need for GMs to handle every process manually.

Important Note: This system is fully proven and actively used on Metin2 private servers. It has been designed to operate on C++ based game core.

How Does It Work?
The system stores a special flag in the character database indicating whether the player has permission to use the /b command. GMs can assign or remove this flag to selected players through a special command. For example:

/gm give_b_power [character_name] – Grants the /b permission to the specified player.
/gm remove_b_power [character_name] – Removes the /b permission from the specified player.

Permission Check
When the command is executed, the system first checks if the player has the required permission. If the user has the permission, the announcement is made. Otherwise, the user is notified that they lack authorization. This check is important for both security and preventing abuse of permissions.

Advantages
- In-game management becomes more flexible.
- Announcement processes are accelerated through trusted players.
- GM workload is reduced.
- Event management becomes more efficient.

System Installation
This system operates by being integrated into C++ based game server files. Important considerations during installation include:

- A new field (e.g., has_b_power) must be added to the character database table.
- A permission check function must be written into the command management file such as CmdManager.cpp.
- No changes are needed on the client side.

Security Measures
Although the system includes permission controls, there is always a possibility of security breaches. Therefore, players granted this permission should be carefully chosen. Additionally, logging the commands used to grant permissions is recommended.

Conclusion
The system allowing GMs to grant /b permission to specific players is a powerful feature that enhances authority management on Metin2 private servers. It enables effective communication with trusted players and improves the overall in-game experience. This system plays a significant role in Metin2 development and is widely preferred on PvP servers.

For Source Codes
Metin2Lobby
 

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

Benzer konular

Geri
Üst Alt