Pm bilgi sistemi

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

Admin

Metin2Lobby
Yönetici
Founder
Katılım
6 Mayıs 2022
Mesajlar
52,647
Ticaret : 1 / 0 / 0
Server/src/
char.h aç ve arat
void SetGMLevel();
altına ekle
Kod:
int            GetChannel() const;

char.cpp arat
quest::CQuestManager::instance().LevelUp(GetPlayerID());
altına ekle
Kod:
// UpdateP2P                TPacketGGLogin p;                 p.bHeader = HEADER_GG_LOGIN;                 strlcpy(p.szName, GetName(), sizeof(p.szName));                 p.dwPID = GetPlayerID();                 p.bEmpire = GetEmpire();                 p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(GetX(), GetY());                 p.bChannel = g_bChannel;                 p.iLevel = GetLevel();                 P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGLogin));

arat
BYTE CHARACTER::GetGMLevel() const

altına ekle
Kod:
int CHARACTER::GetChannel() const{     return g_bChannel; }

arat
TPacketGGLogin p;


p.bHeader = HEADER_GG_LOGIN;
strlcpy(p.szName, GetName(), sizeof(p.szName));
p.dwPID = GetPlayerID();
p.bEmpire = GetEmpire();
p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(GetX(), GetY());
p.bChannel = g_bChannel;


P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGLogin));
değiştir
Kod:
TPacketGGLogin p;         p.bHeader = HEADER_GG_LOGIN;         strlcpy(p.szName, GetName(), sizeof(p.szName));         p.dwPID = GetPlayerID();         p.bEmpire = GetEmpire();         p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(GetX(), GetY());         p.bChannel = g_bChannel;         p.iLevel = GetLevel();         P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGLogin));

input_db.cpp

Arat:
TPacketGGLogin p;


p.bHeader = HEADER_GG_LOGIN;
strlcpy(p.szName, ch->GetName(), sizeof(p.szName));
p.dwPID = ch->GetPlayerID();
p.bEmpire = ch->GetEmpire();
p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(ch->GetX(), ch->GetY());
p.bChannel = g_bChannel;


P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGLogin));

Kod:
Değiştir:         TPacketGGLogin p;         p.bHeader = HEADER_GG_LOGIN;         strlcpy(p.szName, ch->GetName(), sizeof(p.szName));         p.dwPID = ch->GetPlayerID();         p.bEmpire = ch->GetEmpire();         p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(ch->GetX(), ch->GetY());         p.bChannel = g_bChannel;         p.iLevel = ch->GetLevel();         P2P_MANAGER::instance().Send(&p, sizeof(TPacketGGLogin));


packet.h

arat

typedef struct SPacketGGLogin
{
BYTE bHeader;
char szName[CHARACTER_NAME_MAX_LEN + 1];
DWORD dwPID;
BYTE bEmpire;
long lMapIndex;
BYTE bChannel;
} TPacketGGLogin;




Kod:
Değiştir:typedef struct SPacketGGLogin {     BYTE    bHeader;     char    szName[CHARACTER_NAME_MAX_LEN + 1];     DWORD    dwPID;     BYTE    bEmpire;     long    lMapIndex;     BYTE    bChannel;     int        iLevel; } TPacketGGLogin;

p2p.cpp


Arat (void P2P_MANAGER::Boot(LPDESC d)):
p.bHeader = HEADER_GG_LOGIN;
strlcpy(p.szName, ch->GetName(), sizeof(p.szName));
p.dwPID = ch->GetPlayerID();
p.bEmpire = ch->GetEmpire();
p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(ch->GetX(), ch->GetY());
p.bChannel = g_bChannel;
d->Packet(&p, sizeof(p));



Değiştir:
Kod:
p.bHeader = HEADER_GG_LOGIN;         strlcpy(p.szName, ch->GetName(), sizeof(p.szName));         p.dwPID = ch->GetPlayerID();         p.bEmpire = ch->GetEmpire();         p.lMapIndex = SECTREE_MANAGER::instance().GetMapIndex(ch->GetX(), ch->GetY());         p.bChannel = g_bChannel;         p.iLevel = ch->GetLevel();         d->Packet(&p, sizeof(p));
[/CODE]

Arat (void P2P_MANAGER::Login(LPDESC d, const TPacketGGLogin * p)):
pkCCI->lMapIndex = p->lMapIndex;
pkCCI->pkDesc = d;
pkCCI->bChannel = p->bChannel;
sys_log(0, "P2P: Login %s", pkCCI->szName);


CGuildManager::instance().P2PLoginMember(pkCCI->dwPID);
CPartyManager::instance().P2PLogin(pkCCI->dwPID, pkCCI->szName);

Kod:
Değiştir:     pkCCI->lMapIndex = p->lMapIndex;     pkCCI->pkDesc = d;     pkCCI->bChannel = p->bChannel;     pkCCI->iLevel = p->iLevel;     sys_log(0, "P2P: Login %s", pkCCI->szName);     CGuildManager::instance().P2PLoginMember(pkCCI->dwPID);     CPartyManager::instance().P2PLogin(pkCCI->dwPID, pkCCI->szName);

p2p.h

Arat:
typedef struct _CCI
{
char szName[CHARACTER_NAME_MAX_LEN + 1];
DWORD dwPID;
BYTE bEmpire;
long lMapIndex;
BYTE bChannel;


LPDESC pkDesc;
} CCI;

Kod:
Değiştir: typedef struct _CCI {     char    szName[CHARACTER_NAME_MAX_LEN + 1];     DWORD    dwPID;     BYTE    bEmpire;     long    lMapIndex;     BYTE    bChannel;     LPDESC    pkDesc;     int        iLevel; } CCI;



cmd_general.cpp
müsait biryere ekleyin
Kod:
ACMD(do_bilgial){     char arg1[256];     one_argument(argument, arg1, sizeof(arg1));     if (!*arg1)         return;     int iTargetEmpire = 0;     int iTargetLevel = 0;     int iTargetChannel = 0;     LPCHARACTER tch = CHARACTER_MANAGER::instance().FindPC(arg1);     if (tch)     {         iTargetEmpire = (int)tch->GetEmpire();         iTargetLevel = tch->GetLevel();         iTargetChannel = tch->GetChannel();     }     else {         CCI * pkCCI = P2P_MANAGER::instance().Find(arg1);         if (pkCCI)         {             iTargetEmpire = (int)pkCCI->bEmpire;             iTargetLevel = pkCCI->iLevel;             iTargetChannel = (int)pkCCI->bChannel;         }         else {             ch->ChatPacket(CHAT_TYPE_INFO, "Hedef oyuncu: %s suan offline", arg1);             return;         }     }     ch->ChatPacket(CHAT_TYPE_COMMAND, "bilgiver %s %d %d %d", arg1, iTargetEmpire, iTargetLevel, iTargetChannel); } Arat Cmd.cpp ACMD(do_refine_rod); altına [CODE]ACMD(do_bilgial);


---


{ "joy", do_emotion, 0, POS_FIGHTING, GM_PLAYER },

altınada
Kod:
{ "bilgial",  do_bilgial, 0, POS_DEAD, GM_PLAYER },



Client/userinterface/pythonnetworkstreamcommand.cpp
arat

else if (!strcmpi(szCmd, "mobile_auth"))
{
PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnMobileAuthority", Py_BuildValue("()"));
}

Kod:
Ekle:     else if (!strcmpi(szCmd, "bilgiver"))     {         if (5 != TokenVector.size())         {             TraceError("CPythonNetworkStream::ServerCommand(c_szCommand=%s) - Strange Parameter Count : %d", c_szCommand, TokenVector.size());             return;         }         const std::string & c_rstrName = TokenVector[1].c_str();         int iEmpire = atoi(TokenVector[2].c_str());         int iLevel = atoi(TokenVector[3].c_str());         int iChannel = atoi(TokenVector[4].c_str());         PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "BINARY_BilgiIsle", Py_BuildValue("(siii)", c_rstrName.c_str(), iEmpire, iLevel, iChannel));     }



/root
game.py
Arat:

def BINARY_UpdateLovePoint(self, lovePoint):
if self.interface.wndMessenger:
self.interface.wndMessenger.OnUpdateLovePoint(lovePoint)
if self.affectShower:
self.affectShower.OnUpdateLovePoint(lovePoint)

Kod:
Ekle:     def BINARY_BilgiIsle(self, targetName, targetEmpire, targetLevel, targetChannel):         self.interface.BilgileriEkle(targetName, targetEmpire, targetLevel, targetChannel)

interfaceModule.py

Arat:
def MinimizeWhisperDialog(self, name):


if 0 != name:
self.__MakeWhisperButton(name)


self.CloseWhisperDialog(name)

Kod:
Altına ekle:     def BilgileriEkle(self, name, empire, level, channel):         try:             dlgWhisper = self.whisperDialogDict[name]             dlgWhisper.SetToolTipForBilgi(name, empire, level, channel)         except:             import dbg, sys             (type, msg, tb)=sys.exc_info()             dbg.TraceError("interface.BilgileriEkle - Failed to find key | %s:%s" % (type, msg))
whisperdialog.py
Arat:
{
"name" : "titlename",
"type" : "text",


"x" : 3,
"y" : 3,


"text" : uiScriptLocale.WHISPER_NAME,
},
Kod:
Üstüne ekle:                         {                             "name" : "hiddenbutton",                             "type" : "button",                             "x" : 0,                             "y" : 0,                             "text" : "",                             "default_image" : "d:/ymir work/ui/public/hidden.tga",                             "over_image" : "d:/ymir work/ui/public/hidden.tga",                             "down_image" : "d:/ymir work/ui/public/hidden.tga",                         },





uiwhisper.py
Kod:
importların altına ekle:import uiToolTip empireList = ["NULL", "Shinsoo", "Chunjo", "Jinno"]

Arat:
self.titleName = GetObject("titlename")

Kod:
Altına ekle:             self.titleHiddenButton = GetObject("hiddenbutton")

Arat:
def OpenWithTarget(self, targetName):
chat.CreateWhisper(targetName)
chat.SetWhisperBoxSize(targetName, self.GetWidth() - 60, self.GetHeight() - 90)
self.chatLine.SetFocus()
self.titleName.SetText(targetName)
self.targetName = targetName
self.textRenderer.SetTargetName(targetName)
self.titleNameEdit.Hide()
self.ignoreButton.Show()
self.reportButton.Show()
self.acceptButton.Hide()
self.gamemasterMark.Hide()
self.minimizeButton.Show()

Kod:
Altına ekle:         self.SetToolTipForBilgi(targetName, 0, 0, 0)         net.SendChatPacket("/bilgial %s" % targetName)

Arat:
def OpenWithoutTarget(self, event):
self.eventAcceptTarget = event
self.titleName.SetText("")
self.titleNameEdit.SetText("")
self.titleNameEdit.SetFocus()
self.targetName = 0
self.titleNameEdit.Show()
self.ignoreButton.Hide()
self.reportViolentWhisperButton.Hide()
self.acceptButton.Show()
self.minimizeButton.Hide()

Kod:
Altına ekle:         self.titleHiddenButton.Hide()

Arat:
def AcceptTarget(self):
name = self.titleNameEdit.GetText()
if len(name) <= 0:
self.Close()
return


if None != self.eventAcceptTarget:
self.titleNameEdit.KillFocus()
self.eventAcceptTarget(name)

Kod:
Değiştir:     def AcceptTarget(self):         name = self.titleNameEdit.GetText()         if len(name) <= 0:             self.Close()             return         if None != self.eventAcceptTarget:             self.titleNameEdit.KillFocus()             self.eventAcceptTarget(name)         if not self.titleHiddenButton.IsShow():             self.titleHiddenButton.Show()         self.SetToolTipForBilgi(name, 0, 0, 0)         net.SendChatPacket("/bilgial %s" % name)

Arat:
def Close(self):

Kod:
Üstüne ekle:     def __CreateGameTypeToolTip(self, name, empire, level, channel):         tooltipItem = uiToolTip.ToolTip()         tooltipItem.ClearToolTip()         if not empire and not level and not channel:             tooltipItem.AppendTextLine("Oyuncu %s'in bilgileri henuz hazir degil." % name)         else:             tooltipItem.AppendTextLine("Krallik: %s Kralligi" % empireList[empire])             tooltipItem.AppendTextLine("Seviye: %d" % level)             tooltipItem.AppendTextLine("Kanal: %d" % channel)         return tooltipItem     def SetToolTipForBilgi(self, name, empire, level, channel):         self.titleHiddenButton.SetToolTipWindow(self.__CreateGameTypeToolTip(name, empire, level, channel))







anlatımda blok ve hata gibi bir problem varsa rardan indirip ekleyebilirsiniz




[/FONT]
R3Vo9n.jpg

Metin2 Lobby'da PM Bilgi Sistemi Nedir?


Metin2 özel sunucularında oyun deneyimini zenginleştirmek için geliştirilen pek çok sistem vardır. Bu sistemlerden biri de PM (Private Message) Bilgi Sistemi'dir. Bu sistem sayesinde oyuncular kendi aralarında özel mesajlaşabilir, bilgi alışverişi yapabilir veya sunucu yöneticileri ile doğrudan iletişim kurabilirler. Bu yazıda Metin2 Lobby üzerinden PM bilgi sisteminin ne olduğunu, nasıl çalıştığını ve neden önemli olduğunu detaylıca ele alacağız.

PM Bilgi Sistemi Nedir?
PM, yani Özel Mesaj (Private Message), kullanıcıların birbirleriyle özel olarak mesajlaşma imkanı sunan bir sistemdir. Metin2 özel sunucularında bu sistem genellikle oyuncuların birbirlerine item, hesap bilgileri gibi hassas verileri güvenli bir şekilde iletmesi için kullanılır. Ancak bu sistemin sadece mesajlaşma değil, aynı zamanda bilgi toplama ve sunucu içi bildirim sistemi olarak da kullanılması mümkündür.

PM Bilgi Sisteminin Özellikleri
Metin2 özel sunucularında geliştirilen PM Bilgi Sistemi şu temel özellikleri içerir:

- Oyuncuların birbirleriyle özel mesajlaşabilmesi
- Yönetici veya bot aracılığıyla otomatik bilgilendirme gönderimi
- Sunucu içi etkinlik duyurularının hızlıca iletilmesi
- Günlük görev, ödül ve ceza bildirimlerinin kullanıcıya ulaşması

C++ ve Python ile PM Sistem Geliştirme
Metin2 özel sunucularında PM sistemleri genellikle C++ tabanlı sunucu kaynak kodları üzerinde geliştirilir. Bu sistemler, auth ve game sunucusu arasında çalışan bir yapıya sahiptir. Ayrıca, bazı sistemlerde Python tabanlı GUI arayüzler de entegre edilerek yönetim kolaylığı sağlanır. Bu tür sistemlerde Py Root ve Py GUI gibi yapılar kullanılır.

PM Sisteminin DB Entegrasyonu
PM sistemlerinin veritabanı (DB) ile entegrasyonu büyük önem taşır. Gönderilen mesajlar, tarihleri, gönderen ve alan kullanıcılar gibi bilgiler DB üzerinde tutulur. Bu sayede mesaj geçmişi korunur ve gerekirse denetim yapılabilir. Martysama gibi gelişmiş sistemlerde bu yapı daha da detaylandırılmıştır.

Metin2 PM Sisteminin Avantajları
Bu sistem, hem oyuncular hem de sunucu yöneticileri için birçok avantaj sağlar:

- Güvenli mesajlaşma ortamı
- Sunucu içi etkinliklere hızlı erişim
- Oyuncu ile yöneticiler arasında doğrudan iletişim
- Hata ve sorunların hızlıca iletilmesi

PM Sisteminin Geliştirilmesi ve Kaynak Kodlar
Metin2 özel sunucularında PM sisteminin geliştirilmesi için genellikle açık kaynak kodlu projeler kullanılır. Bu projeler C++ Server SRC dosyaları üzerinde çalıştırılır. Geliştiriciler, bu sistemleri Source Edit yaparak kendi sunucularına özel ihtiyaçlara göre uyarlayabilirler. Metin2Dev ve benzeri platformlarda bu konuda örnekler bulmak mümkündür.

Sonuç
PM Bilgi Sistemi, Metin2 özel sunucularında kullanıcı deneyimini artırmak ve sunucu yöneticileri ile oyuncular arasında sağlıklı bir iletişim kanalı kurmak için oldukça etkili bir yöntemdir. Doğru uygulandığında, hem oyun içi etkileşimleri artırır hem de sunucu güvenliğini destekler. Metin2 Lobby olarak, bu tür sistemlerin geliştirilmesi ve yaygınlaştırılması için sürekli çalışıyoruz.


What is the PM Information System on Metin2 Lobby?


In Metin2 private servers, there are numerous systems developed to enhance the gaming experience. One of these systems is the PM (Private Message) Information System. This system allows players to privately communicate with each other, exchange information, or directly contact server administrators. In this article, we will examine what the PM information system is, how it works, and why it is important via Metin2 Lobby.

What is the PM Information System?
PM, or Private Message, is a system that allows users to privately communicate with one another. In Metin2 private servers, this system is often used for securely transmitting sensitive information such as items, account details, etc., between players. However, this system can also be used not only for messaging but also as an information gathering and in-game notification system.

Features of the PM Information System
The PM Information System developed in Metin2 private servers includes the following key features:

- Allowing players to privately message each other
- Automated information delivery via administrators or bots
- Rapid transmission of in-game event announcements
- Delivery of daily quests, rewards, and penalty notifications to users

Developing PM Systems with C++ and Python
In Metin2 private servers, PM systems are typically developed on C++ based server source codes. These systems operate through a structure working between the auth and game servers. Additionally, in some systems, Python-based GUI interfaces are integrated to ease management. Structures like Py Root and Py GUI are used in such systems.

Database Integration of the PM System
The integration of PM systems with databases (DB) is of great importance. Information such as sent messages, timestamps, sender and receiver IDs are stored within the database. This ensures that message history is preserved and can be audited if necessary. In advanced systems like Martysama, this structure is further detailed.

Benefits of the Metin2 PM System
This system offers many advantages for both players and server administrators:

- Secure messaging environment
- Quick access to in-game events
- Direct communication between players and admins
- Fast reporting of errors and issues

Development of the PM System and Source Codes
Developing a PM system in Metin2 private servers usually involves using open-source projects. These projects run on C++ Server SRC files. Developers can customize these systems by Source Editing them according to their server's specific needs. Examples can be found on platforms like Metin2Dev.

Conclusion
The PM Information System is a highly effective method for enhancing user experience and establishing a healthy communication channel between server administrators and players in Metin2 private servers. When properly implemented, it increases in-game interactions and supports server security. At Metin2 Lobby, we continuously work towards developing and promoting such systems.
 

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

Benzer konular

Geri
Üst Alt