Çözüldü PlayerModule functions missing

  • Konuyu açan Konuyu açan Bachi
  • Açılış Tarihi Açılış Tarihi
  • Yanıt Yanıt 4
  • Gösterim Gösterim 109
Bu konu çözüme ulaştırılmıştır. Çözüm için konuya yazılan tüm yorumları okumayı unutmayın. Eğer konudaki yorumlar sorununuzu çözmediyse yeni bir konu açabilirsiniz.
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.

Bachi

Üye
Üye
Mesaj
2
Beğeni
0
Puan
38
Ticaret Puanı
0
Hi, I added Aura costume system but i have some errors in missing python player module functions like GetItemTypeBySlot, can you provide list of must have functions for client source? I can find the definitions but I don't know if all of them are neccessary :)
 
Çözüm
Hello, your problem will be solved if you follow the solution below completely.

PythonPlayer.cpp:
Genişlet Daralt Kopyala
Search:
DWORD CPythonPlayer::GetItemCount

add on top:
DWORD CPythonPlayer::GetItemAntiFlags(TItemPos Cell)
{
    if (!Cell.IsValidCell())
        return 0;

    const TItemData* pItem = GetItemData(Cell);
    assert(pItem != NULL);
    return pItem->anti_flags;
}

BYTE CPythonPlayer::GetItemTypeBySlot(TItemPos Cell)
{
    if (!Cell.IsValidCell())
        return 0;

    CItemData* pItemDataPtr = NULL;
    if (CItemManager::Instance().GetItemDataPointer(GetItemIndex(Cell), &pItemDataPtr))
        return pItemDataPtr->GetType();
    else
    {
        return 0;
    }
}

BYTE CPythonPlayer::GetItemSubTypeBySlot(TItemPos Cell)
{
    if (!Cell.IsValidCell())...
Merhaba,
Aldığınız hataları veya eksik fonksiyonları belirten mesaj ya da görsel eklerseniz. Size yardım etmemiz daha kolay olacak.
 
Hello, your problem will be solved if you follow the solution below completely.

PythonPlayer.cpp:
Genişlet Daralt Kopyala
Search:
DWORD CPythonPlayer::GetItemCount

add on top:
DWORD CPythonPlayer::GetItemAntiFlags(TItemPos Cell)
{
    if (!Cell.IsValidCell())
        return 0;

    const TItemData* pItem = GetItemData(Cell);
    assert(pItem != NULL);
    return pItem->anti_flags;
}

BYTE CPythonPlayer::GetItemTypeBySlot(TItemPos Cell)
{
    if (!Cell.IsValidCell())
        return 0;

    CItemData* pItemDataPtr = NULL;
    if (CItemManager::Instance().GetItemDataPointer(GetItemIndex(Cell), &pItemDataPtr))
        return pItemDataPtr->GetType();
    else
    {
        return 0;
    }
}

BYTE CPythonPlayer::GetItemSubTypeBySlot(TItemPos Cell)
{
    if (!Cell.IsValidCell())
        return 0;

    CItemData* pItemDataPtr = NULL;
    if (CItemManager::Instance().GetItemDataPointer(GetItemIndex(Cell), &pItemDataPtr))
        return pItemDataPtr->GetSubType();
    else
    {
        TraceError("FAILED\t\tCPythonPlayer::GetItemSubTypeBySlot()\t\tCell(%d, %d) item is null", Cell.window_type, Cell.cell);
        return 0;
    }
}

PythonPlayer.h:
Genişlet Daralt Kopyala
Search:
DWORD    GetItemCount

Add Below:
        DWORD    GetItemAntiFlags(TItemPos Cell);
        BYTE    GetItemTypeBySlot(TItemPos Cell);
        BYTE    GetItemSubTypeBySlot(TItemPos Cell);

PythonPlayerModule.cpp:
Genişlet Daralt Kopyala
Search:
void initPlayer()

add on top:
PyObject* playerIsAntiFlagBySlot(PyObject* poSelf, PyObject* poArgs)
{
    TItemPos Cell;
    int antiflag;
    switch (PyTuple_Size(poArgs))
    {
    case 2:
        if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell))
            return Py_BadArgument();
        if (!PyTuple_GetInteger(poArgs, 1, &antiflag))
            return Py_BadArgument();
        break;

    case 3:
        if (!PyTuple_GetInteger(poArgs, 0, &Cell.window_type))
            return Py_BadArgument();
        if (!PyTuple_GetInteger(poArgs, 1, &Cell.cell))
            return Py_BadArgument();
        if (!PyTuple_GetInteger(poArgs, 2, &antiflag))
            return Py_BadArgument();
        break;
    default:
        return Py_BuildException();
    }

    DWORD itemAntiFlags = CPythonPlayer::Instance().GetItemAntiFlags(Cell);
    return Py_BuildValue("i", IS_SET(itemAntiFlags, antiflag) != 0 ? TRUE : FALSE);
}

PyObject* playerGetItemTypeBySlot(PyObject* poSelf, PyObject* poArgs)
{
    TItemPos Cell;
    switch (PyTuple_Size(poArgs))
    {
    case 1:
        if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell))
            return Py_BadArgument();
        break;
    case 2:
        if (!PyTuple_GetByte(poArgs, 0, &Cell.window_type))
            return Py_BadArgument();
        if (!PyTuple_GetInteger(poArgs, 1, &Cell.cell))
            return Py_BadArgument();
        break;
    default:
        return Py_BuildException();
    }

    return Py_BuildValue("i", CPythonPlayer::Instance().GetItemTypeBySlot(Cell));
}

PyObject* playerGetItemSubTypeBySlot(PyObject* poSelf, PyObject* poArgs)
{
    TItemPos Cell;
    switch (PyTuple_Size(poArgs))
    {
    case 1:
        if (!PyTuple_GetInteger(poArgs, 0, &Cell.cell))
            return Py_BadArgument();
        break;
    case 2:
        if (!PyTuple_GetByte(poArgs, 0, &Cell.window_type))
            return Py_BadArgument();
        if (!PyTuple_GetInteger(poArgs, 1, &Cell.cell))
            return Py_BadArgument();
        break;
    default:
        return Py_BuildException();
    }

    return Py_BuildValue("i", CPythonPlayer::Instance().GetItemSubTypeBySlot(Cell));
}

Search:
{ NULL,                                                NULL,                                                    NULL         },

add on top:
        { "IsAntiFlagBySlot",                                playerIsAntiFlagBySlot,                                    METH_VARARGS },
        { "GetItemTypeBySlot",                                playerGetItemTypeBySlot,                                METH_VARARGS },
        { "GetItemSubTypeBySlot",                            playerGetItemSubTypeBySlot,                                METH_VARARGS },
 
Çözüm
Durum
İçerik kilitlendiği için mesaj gönderimine kapatıldı.
Geri
Üst