Jump to content

[Problem] Packet communication - Game -> Client


Recommended Posts

  • Premium

Hi guys, i am playing with packet but now i am stuck :D

i am sending packet to client

void CHARACTER::SendPacket()
{
    if (!GetDesc())
        return;

    TPacketGCInfo InfoGC;

    InfoGC.header = HEADER_GC_INFO;
    for (DWORD i = 0; i < 10; ++i)
     {

           InfoGC.equips.vnum[ i ] = 10;
           ChatPacket(CHAT_TYPE_INFO, "%d", i);
      }
     GetDesc()->Packet(&InfoGC, sizeof(InfoGC));
}

table structure:

typedef struct command_info_
{
    BYTE header;
    struct {
        DWORD vnum;
    } equips[10];
} TPacketGCInfo;

client - side

bool CPythonNetworkStream::RecvInfo()
{
    TPacketGCInfo InfoPacket;
    if (!Recv(sizeof(InfoPacket), &InfoPacket))
        return false;

    for (int i = 0; i < 10; ++i)
    {
        TInfo & rItemSet = InfoPacket.equips[ i ];
        TraceError("(size:%d)", rItemSet.vnum);
    }

    return true;
}

 

table strucutre:

typedef struct SInfo
{
    DWORD   vnum;
} TInfo ;

typedef struct command_info_
{
    BYTE header;
    TInfo equips[10];
} TPacketGCInfo;

But in syserr i have

Spoiler

[29.07 15:24:32920] :: SYSERR: (size:170436819)
[29.07 15:24:32920] :: SYSERR: (size:167772160)
[29.07 15:24:32921] :: SYSERR: (size:167772160)
[29.07 15:24:32921] :: SYSERR: (size:167772160)
[29.07 15:24:32921] :: SYSERR: (size:167772160)
[29.07 15:24:32921] :: SYSERR: (size:167772160)
[29.07 15:24:32921] :: SYSERR: (size:167772160)
[29.07 15:24:32921] :: SYSERR: (size:167772160)
[29.07 15:24:32921] :: SYSERR: (size:167772160)
[29.07 15:24:32921] :: SYSERR: (size:167772160)

 

instead of 10

Do you know where can be a problem? Thank you, i am only learning .. :/

Link to comment
Share on other sites

  • Replies 3
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

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.