Jump to content

Game - Client / Client - Game communication with Packets


Recommended Posts

  • Bronze

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.

Link to comment
Share on other sites

  • 1 month later...
  • 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
Link to comment
Share on other sites

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 ....

Link to comment
Share on other sites

  • 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
Link to comment
Share on other sites

  • 4 months later...
  • 1 month later...
  • 2 months later...
  • 1 month later...
  • 3 months later...
  • 3 months later...
  • 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 

Link to comment
Share on other sites

  • 2 months later...

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.")

 

Link to comment
Share on other sites

  • 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
Link to comment
Share on other sites

  • 2 weeks later...
  • 2 months later...
  • 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!

Link to comment
Share on other sites

Announcements



×
×
  • 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.