Jump to content

Recommended Posts

  • Premium

Hello everyone,

This is my first system release here on this forum, aimed at supporting server owners. This system helps you track hackers or any suspicious activity that a GM should know about.The system allows you to send direct messages (DM) to any GM online. For example, if someone attempts a hack or fails to solve a captcha, it sends a DM to the GM to alert them. The GM can then move to the player to investigate. Here is the system I use the system in CShield protection and you can  :

Spoiler


log.cpp :


add 
#include "p2p.h"


for me i use CShield protaction so i put the code on it :
in CShield protaction use this faction to write events in DB so i do as you see in the code if any one not solve cpatcha the System is alert the GM  
in void LogManager::CShieldLog(LPCHARACTER ch, const DWORD errorcode, const bool kickPlayer) :  
add under     Query("INSERT INTO cshield_log%s (time, accountid, name, level, mapIndex, x, y, ip, errorcode, why) VALUES(NOW(), %u, '%s', %d, %ld, %ld, %ld, '%s', %u, '%s')", get_table_postfix(), d->GetAccountTable().id, ch->GetName(), ch->GetLevel(), ch->GetMapIndex(), ch->GetX(), ch->GetY(), d->GetHostName(), errorcode, MapErrorCode(errorcode).c_str());

	
	if (errorcode == 10007) {
		TPacketGGGMNotification p;
		p.bHeader = HEADER_GG_GM_NOTIFICATION;
		p.dwErrorCode = errorcode;
		snprintf(p.szMessage, sizeof(p.szMessage), "CShield captcha not solve  for : %s", ch->GetName());
		
		P2P_MANAGER::instance().Send(&p, sizeof(p));
	}	

in input_p2p.cpp :

In int CInputP2P::Analyze(LPDESC d, BYTE bHeader, const char* c_pData), at the end of the function, add:


at the end of faction above 

	}

	return (iExtraLen);

add this code :
	case HEADER_GG_GM_NOTIFICATION:
	{
		const TPacketGGGMNotification* p = reinterpret_cast<const TPacketGGGMNotification*>(c_pData);
		
		const auto& desc_set = DESC_MANAGER::instance().GetClientSet();
		for (const auto& desc : desc_set)
		{
			LPCHARACTER gmChar = desc->GetCharacter();
			
			if (gmChar && gmChar->GetGMLevel() == GM_IMPLEMENTOR)
			{
				char message[CHAT_MAX_LEN];
				snprintf(message, sizeof(message), "%s", p->szMessage);
				
				TPacketGCWhisper whisperPacket;
				memset(&whisperPacket, 0, sizeof(TPacketGCWhisper));
				whisperPacket.bHeader = HEADER_GC_WHISPER;
				whisperPacket.bType = WHISPER_TYPE_SYSTEM;
				whisperPacket.wSize = sizeof(TPacketGCWhisper) + strlen(message) + 1;
				strncpy(whisperPacket.szNameFrom, "System", sizeof(whisperPacket.szNameFrom));
				
				gmChar->GetDesc()->BufferedPacket(&whisperPacket, sizeof(whisperPacket));
				gmChar->GetDesc()->Packet(message, strlen(message) + 1);
			}
		}
	}
	break;


in packet.h add this code in enum GG_HEADERS :


    HEADER_GG_GM_NOTIFICATION	= 43, // Adjust the value as needed change the number 


also at the end above this code :

#endif


#pragma pack()
#endif // __INC_PACKET_H__


add this code :

struct TPacketGGGMNotification {
    BYTE    bHeader;
    DWORD   dwErrorCode;
    char    szMessage[256];
};


 packet_info.cpp in this code CPacketInfoGG::CPacketInfoGG() add  :


    Set(HEADER_GG_GM_NOTIFICATION, sizeof(TPacketGGGMNotification), "GMNotification", false);

 


This setup should help GMs be instantly notified about any suspicious activities or issues, allowing them to take appropriate action swiftly.

  • Metin2 Dev 5

───────────────────────────────────────────
— Development & Research —
Metin2 Systems • Client/Server • Reverse Engineering

Discord:  saudidos

If I helped you, consider leaving a like. ✦
───────────────────────────────────────────
 

Link to comment
https://metin2.dev/topic/32832-gm-notification-system/
Share on other sites

Don't use any images from : imgur, turkmmop, freakgamers, inforge, hizliresim... Or your content will be deleted without notice...
Use : https://metin2.download/media/add/

Please use https://metin2.download/ when uploading files smaller than 100MB, otherwise the approval will take longer due to manual upload.

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.