Jump to content

increase yang binary part


Recommended Posts

  • Premium

hallo all

i was trying to increase yang  so the server part is ok , i use ULL also i make new packet for that

only 1 problem every time i try something i get big value like that : wHH8mIG.png

i'm useing


 

Spoiler

 

return PyLong_FromUnsignedLongLong( CPythonPlayer::Instance().GetStatus(POINT_GOLD));

PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnPickMoney", PyLong_FromUnsignedLongLong( PointChangeEx.amount));


 

 

 

i also try Py_BuildValue("(K)" and same bug

 

Edited by Metin2 Dev
Core X - External 2 Internal

If you're going to do something, then do it right.

Link to comment
Share on other sites

At first, you have to build a value for PyCallClassMemberFunc. You can't do this just like that.

				PyObject *args = PyTuple_New(1);
				PyTuple_SetItem(args, 0, PyLong_FromUnsignedLongLong(PointChangeEx.amount));
				PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnPickMoney", args);

Your codes should be just like that.

Kind Regards ~ Ken

  • Love 1

Do not be sorry, be better.

Link to comment
Share on other sites

  • Premium

i was try to make it unsigned long long in binary and long long in source,

now i make the binary long long and use PyLong_FromLongLong and same bug

also i test it with normal code

elk function :

Spoiler

DWORDLONG gold = CPythonPlayer::Instance().GetStatus(POINT_GOLD);
   return Py_BuildValue("L", gold);

 

the new function for the new packet

Spoiler

PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnPickMoney", Py_BuildValue("(i)", PointChangeEx.amount));

and

PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "OnPickMoney", Py_BuildValue("(L)", PointChangeEx.amount));

 

 

and same problem

If you're going to do something, then do it right.

Link to comment
Share on other sites

  • Premium
3 minutes ago, metin2team said:

since that I've done it a long time ago, I'm not sure what's the problem you're facing.

anyway, can you tell me what PointChangeEx.amount 's datatype is?

what is the type that this (GetStatus) function is returning?

long long , i had to make new packet for point gold and delete it from the old one
 

this one from the binary

Spoiler

 

typedef struct packet_point_change_ex
{
    int         header;

    DWORD        dwVID;
    BYTE        Type;

    LONGLONG        amount; // ¹ظ²ï °ھ
    LONGLONG        value;  // اِہç °ھ
} TPacketGCPointChangeEx;

 

 

If you're going to do something, then do it right.

Link to comment
Share on other sites

  • Premium

now i add in SPlayerStatus

Spoiler

            LONGLONG                m_alPointEx[POINT_MAX_NUM];
            void SetPointEx(UINT ePoint, LONGLONG lPoint);
            LONGLONG GetPointEx(UINT ePoint);

and the new function
 

Spoiler

 

const LONGLONG POINT_MAGIC_NUMBER_EX = 0xe73ac1da;

void CPythonPlayer::SPlayerStatus::SetPointEx(UINT ePoint, LONGLONG lPoint)

LONGLONG CPythonPlayer::SPlayerStatus::GetPointEx(UINT ePoint)

void CPythonPlayer::SetStatusEx(DWORD dwType, LONGLONG lValue)

int CPythonPlayer::GetStatusEx(DWORD dwType)


 

and new packet for packet_points_ex
 

Spoiler

 

bool CPythonNetworkStream::__RecvPlayerPointsEx()
{
    TPacketGCPointsEx PointsPacketEx;

    if (!Recv(sizeof(TPacketGCPointsEx), &PointsPacketEx))
        return false;

    CPythonPlayer::Instance().SetStatusEx(POINT_GOLD, PointsPacketEx.points[POINT_GOLD]);

    PyCallClassMemberFunc(m_apoPhaseWnd[PHASE_WINDOW_GAME], "RefreshStatusEx", Py_BuildValue("()"));
    return true;
}

 

 

but still same bug,

maybe the const LONGLONG POINT_MAGIC_NUMBER_EX = 0xe73ac1da; wrong ?

If you're going to do something, then do it right.

Link to comment
Share on other sites

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.