Jump to content

Game - Client / Client - Game communication with Packets


Recommended Posts

Some one know how send here other table from player.player?

void CHARACTER::SendTitleSystem() // test client-game 
{
	if (!GetDesc())
	{
		return;
	}
 
	TPacketGCMetin2Dev Metin2DevGC;
 
	Metin2DevGC.byHeader = HEADER_GC_METIN2DEV;
	Metin2DevGC.M2int = GetPlayerID(); // change here to a new table from player.player

	GetDesc()->Packet(&Metin2DevGC, sizeof(TPacketGCMetin2Dev));
}

for example a new table created , named "test"???

Thanks.

  • 1 month later...
  • Premium

 I tried (ctrl+c, ctrl+v) the client-game communication, but doesn't works for me  :huh:

 

The sysser write this:

Analyze: login phase does not handle this packet! header 58

 

What i doing wrong?
 
thanks for helping me!
  • 2 months later...

Hi Sanchez

I have a problem ...

I see the "none" (I posted a type of children in text), but directly after clicking on the button, I have a black screen ...

I have to force quit

I use the event function:

vid = net.SendM2DevPacket(player.GetTargetVID())
self.test.SetText(str(vid))

 

Thanks !

Edited by Kodii

Push ...

(I'm just getting disconnected when I press the test button.) My function (53 is a test):

net.SendM2DevPacket(53)


I have an error in the sysser when my crash client ...:

SYSERR: Jun 24 21:11:11.804832 :: Process: UNKNOWN HEADER: 44, LAST HEADER: 0(0), REMAIN BYTES: 6, fd: 25

Header 44: Header CG Pong
Regarding the condition:

bool CPythonNetworkStream::SendMetin2DevOrgPacket(int data)
{
    TPacketCGMetin2DevOrg M2DevPacket;
    M2DevPacket.byHeader = HEADER_CG_METIN2DEVORG;
    M2DevPacket.data = data;

    if (!Send(sizeof(M2DevPacket), &M2DevPacket))
        return false;

    LogBox("test");
    return SendSequence();
}

The fonction return SendSequence and not false !
I did a test to see if the packet is received by the game:

        case HEADER_CG_METIN2DEVORG:
            sys_log(0, "TEST");
            Metin2DevReceivePacket(ch, c_pData);
            break;

But I have nothing in the syslog.
The packet is not received.

I don't understand at all what the problem is ....

  • 1 month later...
  • Former Staff

net.SendM2DevPacket(53

Push ...

(I'm just getting disconnected when I press the test button.) My function (53 is a test):

net.SendM2DevPacket(53)


I have an error in the sysser when my crash client ...:

SYSERR: Jun 24 21:11:11.804832 :: Process: UNKNOWN HEADER: 44, LAST HEADER: 0(0), REMAIN BYTES: 6, fd: 25

Header 44: Header CG Pong
Regarding the condition:

bool CPythonNetworkStream::SendMetin2DevOrgPacket(int data)
{
    TPacketCGMetin2DevOrg M2DevPacket;
    M2DevPacket.byHeader = HEADER_CG_METIN2DEVORG;
    M2DevPacket.data = data;

    if (!Send(sizeof(M2DevPacket), &M2DevPacket))
        return false;

    LogBox("test");
    return SendSequence();
}

The fonction return SendSequence and not false !
I did a test to see if the packet is received by the game:

        case HEADER_CG_METIN2DEVORG:
            sys_log(0, "TEST");
            Metin2DevReceivePacket(ch, c_pData);
            break;

But I have nothing in the syslog.
The packet is not received.

I don't understand at all what the problem is ....

 

replace this net.SendM2DevPacket(53) with this

net.SendM2DevPacket(self,53)

 
 
Edited by flygun
  • 4 months later...
  • 1 month later...
  • 2 months later...
  • 1 month later...
  • 3 months later...
  • 3 months later...

Is there any part of the game which uses UDP?

Also I'd like to point out that the code in the original post is bad, the structure should be packed to ensure that there is no padding - this is standard practise.

  • Love 1
  • 7 months later...
  • 4 months later...
  • 4 months later...

hello

in client src in 

PythonNetworkStreamPhaseGame.cpp

in this function

bool CPythonNetworkStream::RecvGuild()

 i see 

    switch (GuildPacket.subheader)
    {

case GUILD_SUBHEADER_GC_LIST:
        {

how to get TPacketGCGuildSubMember

from game this packet in game src  packet.h not found and 

when edit TGuildMemberPacketData in guild.h 

i have SYSERR: Unknown packet header: 102, last: 75 75 in client syserr 

  • 2 months later...
  • Active Member

You're the real MVP! Thanks a bunch mate, most appreciated!

  • Love 1
for brain_cells in xrange(brain):
  if brain_cells == 0:
    print("0x3703c7 Fatal error occurred. Please replace the brain.")
    break
  if brain_cells == "damaged":
    print("0x3703c7 Error occurred. Please repair damaged brain_cells")
    break
  
  print("brain_cells are at 100% capacity.")

 

  • 5 months later...
  • 1 year later...

Okay, so if you do all the steps in the first post you will NOT see any log box appering. This is not a bug or an error on your end. The problem(!) is very simple. We created the logic of what happens when we send our packet but we didn't send the packet at all. And since this is a new packet we've written the game will not send it for us. Let's say we want to send the packet when we pickup an item. To achieve that all we have to do is call "SendMetin2DevPacket" function inside PickupItem(DWORD dwVID) function. You can find the PickupItem function inside char_item.cpp file.

 

 

Edited by nefdulin
  • Good 1
  • 2 weeks later...
  • 2 months later...
On 5/12/2020 at 12:51 PM, KemppiOn said:

Just a question - Does what youre trying to do now comply with the terms of service/license agreement of this game?

As far as I know, It doesn't.

 

Thanks for the guide btw. Very helpful.

Edited by Finnael
On 5/12/2020 at 12:51 PM, KemppiOn said:

Just a question - Does what youre trying to do now comply with the terms of service/license agreement of this game?

And also, what is this WPE you mention?

WPE- Winsock packet editor 

http://www.packeteditor.com/?call=61626F7574

  • Metin2 Dev 1
  • Love 1
  • 6 months later...

 

On 2/23/2014 at 1:41 AM, Sanchez said:

def Button1_Event(self? net.SendM2DevPacket(player.GetTargetVID())

Hello, Ik its an old post, but on the last bit, with the button creation, can't see to figure out in which module (python file) to put the class method? And under what class? And also, who's "net", if anybody could help, would really appreciate it!

  • Love 1
  • 3 years later...
  • Active+ Member
On 2/16/2014 at 12:54 AM, Sanchez said:

 

Now add the last function to game.py, this will be called by the binary:

	def BINARY_M2DEV_Test(self, M2int):
		import dbg
		dbg.LogBox(str(M2int))

 
Finally, lets check how it works:
 
6XAnB.png
 
 

I can't understand this part. like how to check if it works? starting the server and login into the game nothing is happening. 

I've followed the "tutorial" as is, verifying it multiple times, but tbh nothing happens also, no errors. (using tmp4 base)

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.