Jump to content

Recommended Posts

  • Active+ Member

M2 Download Center

This is the hidden content, please
( Internal )

.gif

 
Tutorial:

PythonNetworkStreamModule.cpp

Search:

PyObject* netSendMessengerAddByNamePacket(PyObject* poSelf, PyObject* poArgs)

 

Add it upper:

PyObject* netSendHackPacket(PyObject* poSelf, PyObject* poArgs)
{
	char * szMsg;
	if (!PyTuple_GetString(poArgs, 0, &szMsg))
		return Py_BuildException();

	CPythonNetworkStream& rns=CPythonNetworkStream::Instance();
	rns.__SendHack(szMsg);
	
	return Py_BuildNone();
}

 

.gif

 

Search:

		{ "RegisterErrorLog",						netRegisterErrorLog,						METH_VARARGS },
		

Add it under:

		{ "HackReport",								netSendHackPacket,							METH_VARARGS },

 

.gif

 

PythonNetworkStream.h

 

Search:

bool __SendHack(const char* c_szMsg);

 

Add it upper:

public:

 

.gif

 

Usage:

Python:

net.HackReport("explanation_in_here")

C++:

Without Client Source:

void SendReport(char* why){
	PyObject* args = PyTuple_New(1);
	PyTuple_SetItem(args, 0, PyString_FromString(why));
	PyObject* ret = PyObject_Call(PyObject_GetAttrString(PyImport_ImportModule("net"), "HackReport"), args, NULL);

	Py_XDECREF(ret);
	Py_XDECREF(args);
}
SendReport("explanation_in_here");

Client Source:

#include "PythonNetworkStream.h"

CPythonNetworkStream netStream;
netStream.__SendHack("explanation_in_here");

 

  • Metin2 Dev 6
  • Good 3
  • Love 7
Link to comment
https://metin2.dev/topic/7381-activate-hack-report-function-system/
Share on other sites

  • Replies 4
  • Created
  • Last Reply

Top Posters In This Topic

Everything is ok but why are you try to call functions from external? It was a little bit strange. What ever thanks for share.

// Edit

I don't like part of serverside. I wait good things from ymir/webzen games. That's my function for this.

void CInputMain::Hack(LPCHARACTER ch, const char * c_pData)
{
        TPacketCGHack * p = (TPacketCGHack *)c_pData;
        
        if (ch && ch->GetDesc())
        {
                sys_log(0, "HACK REPORT SENT BY %s", ch->GetName());
                LogManager::instance().HackLog(p->szBuf, ch);
        }
}

Kind Regards

Ken

Edited by Ken

Do not be sorry, be better.

  • Active+ Member

Everything is ok but why are you try to call functions from external? It was a little bit strange. What ever thanks for share.

// Edit

I don't like part of serverside. I wait good things from ymir/webzen games. That's my function for this.

void CInputMain::Hack(LPCHARACTER ch, const char * c_pData)
{
        TPacketCGHack * p = (TPacketCGHack *)c_pData;
        
        if (ch && ch->GetDesc())
        {
                sys_log(0, "HACK REPORT SENT BY %s", ch->GetName);
                LogManager::instance().HackLog(p->szBuf, ch);
        }
}

Kind Regards

Ken

D​irect log is dangerous so have potential sql injection risk

  • 10 years later...

Hello are you still here? 
 

Client Source:

#include "PythonNetworkStream.h" CPythonNetworkStream netStream; netStream.__SendHack("explanation_in_here");

In which file?  I have the table in Log but they are empty because I think I am missing to implement your code.

 

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.