Jump to content

Soul binding system problem..


Recommended Posts

Can someone help?


Cache.cpp: In member function 'virtual void CItemCache::OnFlush()':
Cache.cpp:94:61: error: 'TPlayerItem' has no member named 'soul'
    p->id, p->owner, p->window, p->pos, p->count, p->vnum,p->soul,p->soulTime);
                                                             ^
Cache.cpp:94:69: error: 'TPlayerItem' has no member named 'soulTime'
    p->id, p->owner, p->window, p->pos, p->count, p->vnum,p->soul,p->soulTime);
                                                                     ^
Cache.cpp:96:55: error: 'TPlayerItem' has no member named 'soul'
    p->owner, p->window, p->pos, p->count, p->vnum, p->soul, p->soulTime);
                                                       ^
Cache.cpp:96:64: error: 'TPlayerItem' has no member named 'soulTime'
    p->owner, p->window, p->pos, p->count, p->vnum, p->soul, p->soulTime);
                                                                ^
compile ClientManagerBoot.cpp
gmake: *** [.obj/Cache.o] Error 1
gmake: *** Waiting for unfinished jobs....
ClientManagerPlayer.cpp: In function 'bool CreateItemTableFromRes(MYSQL_RES*, std::vector<SPlayerItem>*, DWORD)':
ClientManagerPlayer.cpp:59:22: error: 'TPlayerItem' has no member named 'soul'
   str_to_number(item.soul, row[cur++]);
                      ^
ClientManagerPlayer.cpp:60:22: error: 'TPlayerItem' has no member named 'soulTime'
   str_to_number(item.soulTime, row[cur++]);
                      ^
gmake: *** [.obj/ClientManagerPlayer.o] Error 1
 

Link to comment
Share on other sites

  • 1 month later...
  • Active Member

Hey guys :) I have this problem:

Spoiler

char_item.cpp:4752: error: 'to_string' is not a member of 'std'
char_item.cpp:4758: error: 'to_string' is not a member of 'std'
char_item.cpp:4764: error: 'to_string' is not a member of 'std'

Function:

Spoiler

case USE_UNBIND:
                                {
                                    if (!item2->IsBindedTo())
                                    {
                                        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("This item is not binded!"));
                                        return false;
                                    }

                                    if (item2->GetBindingLeft() != 1)
                                    {
                                        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Your item is still unbinding..."));
                                        return false;
                                    }

                                    item2->SetBinding(false, item->GetValue(0));

                                    unsigned int hours = item->GetValue(0) / 3600;
                                    unsigned int minutes = (item->GetValue(0) - hours * 3600) / 60;
                                    unsigned int seconds = item->GetValue(0) - hours * 3600 - minutes*60;

                                    std::string rTime = LC_TEXT("Your item will be unbinded in ");
                                    if (hours > 0)
                                        rTime += std::to_string(hours) + "h";

                                    if (minutes > 0 && hours > 0)
                                        rTime += " ";

                                    if (minutes > 0)
                                        rTime += std::to_string(minutes) + "m";

                                    if (minutes > 0 && (hours > 0 || minutes > 0))
                                        rTime += " ";

                                    if (seconds > 0)
                                        rTime += std::to_string(seconds) + "s";

                                    ChatPacket(CHAT_TYPE_INFO, rTime.c_str());

                                    item->SetCount(item->GetCount() - 1);
                                    break;
                                }
 

Red lines are the problem

Thanks in advance :)

Link to comment
Share on other sites

  • Honorable Member

Maybe like this?

									char tmpBuf[64+1];
									std::string rTime = LC_TEXT("Your item will be unbinded in ");
									if (hours > 0)
									{
										snprintf(tmpBuf, sizeof(tmpBuf), "%uh", hours);
										rTime += tmpBuf;
									}

									if (minutes > 0 && hours > 0)
										rTime += " ";

									if (minutes > 0)
									{
										snprintf(tmpBuf, sizeof(tmpBuf), "%um", minutes);
										rTime += tmpBuf;
									}

									if (seconds > 0 && (hours > 0 || minutes > 0))
										rTime += " ";

									if (seconds > 0)
									{
										snprintf(tmpBuf, sizeof(tmpBuf), "%us", seconds);
										rTime += tmpBuf;
									}

 

  • Love 1
Link to comment
Share on other sites

16 hours ago, Mind Rapist said:

Hey guys :) I have this problem:

  Hide contents

char_item.cpp:4752: error: 'to_string' is not a member of 'std'
char_item.cpp:4758: error: 'to_string' is not a member of 'std'
char_item.cpp:4764: error: 'to_string' is not a member of 'std'

Function:

  Hide contents

case USE_UNBIND:
                                {
                                    if (!item2->IsBindedTo())
                                    {
                                        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("This item is not binded!"));
                                        return false;
                                    }

                                    if (item2->GetBindingLeft() != 1)
                                    {
                                        ChatPacket(CHAT_TYPE_INFO, LC_TEXT("Your item is still unbinding..."));
                                        return false;
                                    }

                                    item2->SetBinding(false, item->GetValue(0));

                                    unsigned int hours = item->GetValue(0) / 3600;
                                    unsigned int minutes = (item->GetValue(0) - hours * 3600) / 60;
                                    unsigned int seconds = item->GetValue(0) - hours * 3600 - minutes*60;

                                    std::string rTime = LC_TEXT("Your item will be unbinded in ");
                                    if (hours > 0)
                                        rTime += std::to_string(hours) + "h";

                                    if (minutes > 0 && hours > 0)
                                        rTime += " ";

                                    if (minutes > 0)
                                        rTime += std::to_string(minutes) + "m";

                                    if (minutes > 0 && (hours > 0 || minutes > 0))
                                        rTime += " ";

                                    if (seconds > 0)
                                        rTime += std::to_string(seconds) + "s";

                                    ChatPacket(CHAT_TYPE_INFO, rTime.c_str());

                                    item->SetCount(item->GetCount() - 1);
                                    break;
                                }
 

Red lines are the problem

Thanks in advance :)

Removed.

Link to comment
Share on other sites

  • Active Member

Hi I installed it but I got this problem now:

https://metin2.download/picture/r3F9504x09DVmF8K988YXgTtGTP6KMUj/.gif

My ItemData.cpp

Spoiler

const char* CItemData::GetUseTypeString() const
{
    if (GetType() != CItemData::ITEM_TYPE_USE)
        return "NOT_USE_TYPE";

    switch (GetSubType())
    {
        case USE_TUNING:
            return DEF_STR(USE_TUNING);                
        case USE_DETACHMENT:
            return DEF_STR(USE_DETACHMENT);                            
        case USE_CLEAN_SOCKET:
            return DEF_STR(USE_CLEAN_SOCKET);
        case USE_CHANGE_ATTRIBUTE:
            return DEF_STR(USE_CHANGE_ATTRIBUTE);
        case USE_ADD_ATTRIBUTE:
            return DEF_STR(USE_ADD_ATTRIBUTE);        
        case USE_ADD_ATTRIBUTE2:
            return DEF_STR(USE_ADD_ATTRIBUTE2);        
        case USE_ADD_ACCESSORY_SOCKET:
            return DEF_STR(USE_ADD_ACCESSORY_SOCKET);        
        case USE_PUT_INTO_ACCESSORY_SOCKET:
            return DEF_STR(USE_PUT_INTO_ACCESSORY_SOCKET);
#ifdef USE_SOUL_BINDING
        case USE_BIND:
            return DEF_STR(USE_BIND);
        case USE_UNBIND:
            return DEF_STR(USE_UNBIND);
#endif
        case USE_PUT_INTO_BELT_SOCKET:
            return DEF_STR(USE_PUT_INTO_BELT_SOCKET);
        case USE_PUT_INTO_RING_SOCKET:
            return DEF_STR(USE_PUT_INTO_RING_SOCKET);
        case USE_CHANGE_COSTUME_ATTR:
            return DEF_STR(USE_CHANGE_COSTUME_ATTR);
        case USE_RESET_COSTUME_ATTR:
            return DEF_STR(USE_RESET_COSTUME_ATTR);
    }
    return "USE_UNKNOWN_TYPE";
}

My ItemData.h

Spoiler

        enum EUseSubTypes
        {
            USE_POTION,                    // 0
            USE_TALISMAN,
            USE_TUNING,
            USE_MOVE,
            USE_TREASURE_BOX,
            USE_MONEYBAG,
            USE_BAIT,
            USE_ABILITY_UP,
            USE_AFFECT,
            USE_CREATE_STONE,
            USE_SPECIAL,                // 10
            USE_POTION_NODELAY,
            USE_CLEAR,
            USE_INVISIBILITY,
            USE_DETACHMENT,
            USE_BUCKET,
            USE_POTION_CONTINUE,
            USE_CLEAN_SOCKET,
            USE_CHANGE_ATTRIBUTE,
            USE_ADD_ATTRIBUTE,
            USE_ADD_ACCESSORY_SOCKET,            // 20
            USE_PUT_INTO_ACCESSORY_SOCKET,
            USE_ADD_ATTRIBUTE2,
            USE_RECIPE,
            USE_CHANGE_ATTRIBUTE2,
            USE_BIND,
            USE_UNBIND,
            USE_TIME_CHARGE_PER,
            USE_TIME_CHARGE_FIX,                // 28
            USE_PUT_INTO_BELT_SOCKET,            // 29 벨트 소켓에 사용할 수 있는 아이템 
            USE_PUT_INTO_RING_SOCKET,            // 30 반지 소켓에 사용할 수 있는 아이템 (유니크 반지 말고, 새로 추가된 반지 슬롯)
            USE_CHANGE_COSTUME_ATTR,            // 31
            USE_RESET_COSTUME_ATTR,                // 32
        };

My uiInventory.py

Spoiler

USE_TYPE_TUPLE = ("USE_CLEAN_SOCKET", "USE_CHANGE_ATTRIBUTE", "USE_ADD_ATTRIBUTE", "USE_ADD_ATTRIBUTE2", "USE_ADD_ACCESSORY_SOCKET", "USE_PUT_INTO_ACCESSORY_SOCKET", "USE_BIND", "USE_UNBIND", "USE_PUT_INTO_BELT_SOCKET", "USE_PUT_INTO_RING_SOCKET", "USE_CHANGE_COSTUME_ATTR", "USE_RESET_COSTUME_ATTR")

Any ideas for this please?

Thanks in advance :)

EDIT: I forgot to pack locale folder, stupid of me :P

 

EDIT AGAIN

So I installed it the items are binding successfully but when I store them the "Soul binded" is gone and there is a message "Time left: 1794 days 30 mins" or something like that. When I remove the item from the storage the "Soul binded" comes back normally.

Also the unbinding has a problem too. There is no time it just unbinds but in the source there is time. And when I reboot the server the item is still binded, no time until unbind.

Can anybody help me? I don't know exactly what files or functions I need to paste here so you guys tell me and I will post

Thanks in advance :)

Edited by Metin2 Dev
Core X - External 2 Internal
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


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