-
Posts
404 -
Joined
-
Last visited
-
Days Won
20 -
Feedback
0%
Content Type
Forums
Store
Third Party - Providers Directory
Feature Plan
Release Notes
Docs
Events
Posts posted by Ikarus_
-
-
On 10/28/2020 at 4:55 PM, TokiSan said:
char.cpp:8086: error: request for member 'reset' in 'pkMsg', which is of non-class type 'SQLMsg*' char.cpp:8086: error: 'nullptr' was not declared in this scope
Uhm, yep, nullptr is not declared means you are not using c++11(+) and pkMsg is of non-class type SQLMsg* means you are using .reset on a raw pointer (and .reset is not needed even for smart ptr).
You solved differently but maybe someone is interested in knowing why errors are received when they are received, as well as knowing how to fix it.
On 11/7/2020 at 2:21 PM, developerares said:Is there a problem with this code? I have smart ptr.
No it is correct. std::unique_ptr<SQLMsg> will delete the memory from heap when its destructor is called.
smart pointers have the overload of the operator -> and this help to use them as classic (raw) pointers. (e.g. where you used Msg->Get())
-
What you posted It's not an error, just a LOG
-
1
-
-
please test it and report here the result. I'v not the time to test it for you.
into the function
void CHARACTER::AutoRecoveryItemProcess(const EAffectTypes type)
search for
if (avail > amount) { const int pct_of_used = amount_of_used * 100 / amount_of_full; const int pct_of_will_used = (amount_of_used + amount) * 100 / amount_of_full; bool bLog = false; if ((pct_of_will_used / 10) - (pct_of_used / 10) >= 1) bLog = true; pItem->SetSocket(idx_of_amount_of_used, amount_of_used + amount, bLog); } else { amount = avail; ITEM_MANAGER::instance().RemoveItem( pItem ); }
replace it with:
if (avail > amount) { const int pct_of_used = amount_of_used * 100 / amount_of_full; const int pct_of_will_used = (amount_of_used + amount) * 100 / amount_of_full; bool bLog = false; if ((pct_of_will_used / 10) - (pct_of_used / 10) >= 1) bLog = true; pItem->SetSocket(idx_of_amount_of_used, amount_of_used + amount, bLog); } else { amount = avail; if(pItem->GetCount() <= 1) ITEM_MANAGER::instance().RemoveItem( pItem ); else { pItem->SetCount(pItem->GetCount() - 1); pItem->SetSocket(1, 0); } }
-
you pasted all wrong, i suggest you to remove the system and install it again once
-
On 10/28/2020 at 4:55 PM, TokiSan said:
I try This and have this error:compile char.cpp char.cpp: In member function 'void CHARACTER::OpenShop(DWORD, const char*, bool)': char.cpp:8086: error: request for member 'reset' in 'pkMsg', which is of non-class type 'SQLMsg*' char.cpp:8086: error: 'nullptr' was not declared in this scope
nullptr is defined since c++11 and i guess you are using reset on a raw pointer (the reset wasn't really needed btw)
-
15 minutes ago, santa12 said:
I deleted the strip a long time ago
No symbol table info available.
Nope
-
I think you are trying to read a stripped file.
When game and db are linked they got all debug information used from gdb to read where is it crashing.
The process called stripping remove the debug symbols from the executable (and so reduce its size).
Unfortunately doesn't give any information try to read a db.core using a stripped db file.
You have to find the unstripped file and to read its symbol table.
You might have a "-s" flag to your linking commands in your makefile that strip the output file automatically. -
double AttBonusMin = static_cast<double>(pkItemAbsorbed->alValues[3] + pkItemAbsorbed->alValues[5]); AttBonusMin *= acceItem->GetSocket(ACCE_ABSORPTION_SOCKET); AttBonusMin /= 100; AttBonusMin += 0.5; //todebug if(ch->IsPhase(PHASE_GAME)) ch->ChatPacket(CHAT_TYPE_INFO, "Going to add to your attack : min(%0.2f) max(%0.2f) ", AttBonusMin, AttBonusMax); *pdamMax += static_cast<int>(AttBonusMax); *pdamMin += static_cast<int>(AttBonusMin);
They are just rounded to integer (throught static_cast<int>) after the chat packet, that's why you are getting them as float in your chat.
but the way you may add more chat packets in this function to check step by step how it is calculating the values
-
3
-
-
In my code i ve used the identical formula client-side and server-side, so the result values are equal.
Also in python the formula is identical, so why are u trying to change the formula?
16 hours ago, Shahin said:With normal round it should be : 20 and 27 & 45 and 53
Also you can't define what is a 'normal round' and what isn't.
for example a number like 15.5 can be consider in many cases as 15 and in other cases as 16. Doesn't exists a standard to apply in this case, that's why we have to add a + 0.5 every where, in order to round always to the upper integer number, both python and c++.
without the +0.5 we may find different values on python rouding and on c++ rounding.
-
1
-
-
On 11/2/2020 at 12:54 AM, Ikarus_ said:
double AttBonusMax = static_cast<double>(pkItemAbsorbed->alValues[4] + pkItemAbsorbed->alValues[5]); AttBonusMax *= acceItem->GetSocket(ACCE_ABSORPTION_SOCKET); AttBonusMax /= 100; AttBonusMax += 0.5; double AttBonusMin = static_cast<double>(pkItemAbsorbed->alValues[3] + pkItemAbsorbed->alValues[5]); AttBonusMin *= acceItem->GetSocket(ACCE_ABSORPTION_SOCKET); AttBonusMin /= 100; AttBonusMin += 0.5;
check how it is calculated and you will know why.
I ve just used the identical formula on c++ (serverside and clientside) and in python so all values now should be aligned.
-
1
-
-
I've updated the code at the first message about void CPythonPlayer::__UpdateBattleStatus()
copy it again from there and let me know.
I think i ve solved both the problem you reported
-
1
-
-
can i see your Status board (aka character window) while wearing the sash and without sash?
-
1
-
-
Ok so the bug is just a visual bug.
You have to wear a sash with att min and max and to read the client syserr.txt
Let's debug it. (look at //todebug comment)
void CPythonPlayer::__UpdateBattleStatus() { m_playerStatus.SetPoint(POINT_NONE, 0); m_playerStatus.SetPoint(POINT_EVADE_RATE, __GetEvadeRate()); m_playerStatus.SetPoint(POINT_HIT_RATE, __GetHitRate()); m_playerStatus.SetPoint(POINT_MIN_WEP, m_dwWeaponMinPower+m_dwWeaponAddPower); m_playerStatus.SetPoint(POINT_MAX_WEP, m_dwWeaponMaxPower+m_dwWeaponAddPower); m_playerStatus.SetPoint(POINT_MIN_MAGIC_WEP, m_dwWeaponMinMagicPower+m_dwWeaponAddPower); m_playerStatus.SetPoint(POINT_MAX_MAGIC_WEP, m_dwWeaponMaxMagicPower+m_dwWeaponAddPower); m_playerStatus.SetPoint(POINT_MIN_ATK, __GetTotalAtk(m_dwWeaponMinPower, m_dwWeaponAddPower)); m_playerStatus.SetPoint(POINT_MAX_ATK, __GetTotalAtk(m_dwWeaponMaxPower, m_dwWeaponAddPower)); #ifdef ENABLE_ACCE_SYSTEM //change it with your sash define auto ItemData = GetItemData({INVENTORY, c_Costume_Slot_Acce}); if (ItemData) { auto AbsorbedVnum = ItemData->alSockets[1]; if (AbsorbedVnum != 0 && CItemManager::Instance().SelectItemData(AbsorbedVnum)) { auto SelectedItemData = CItemManager::Instance().GetSelectedItemDataPointer(); if (SelectedItemData->GetType() == CItemData::ITEM_TYPE_WEAPON) { auto oldMinWep = m_playerStatus.GetPoint(POINT_MIN_WEP); auto oldMaxWep = m_playerStatus.GetPoint(POINT_MAX_WEP); auto oldMinMag = m_playerStatus.GetPoint(POINT_MIN_MAGIC_WEP); auto oldMaxMag = m_playerStatus.GetPoint(POINT_MAX_MAGIC_WEP); double sashAbsorbPerc = static_cast<double>(ItemData->alSockets[0]); auto sashMinWep = static_cast<double>(SelectedItemData->GetValue(3) + SelectedItemData->GetValue(5)) * (sashAbsorbPerc/100.0); auto sashMaxWep = static_cast<double>(SelectedItemData->GetValue(4) + SelectedItemData->GetValue(5)) * (sashAbsorbPerc/100.0); auto sashMinMag = static_cast<double>(SelectedItemData->GetValue(1) + SelectedItemData->GetValue(5)) * (sashAbsorbPerc/100.0); auto sashMaxMag = static_cast<double>(SelectedItemData->GetValue(2) + SelectedItemData->GetValue(5)) * (sashAbsorbPerc/100.0); //todebug TraceError("Going to add to your points : wep(min %f max %f) mag(min %f max%f)", sashMinWep, sashMaxWep, sashMinMag, sashMaxMag); m_playerStatus.SetPoint(POINT_MIN_WEP, oldMinWep + sashMinWep); m_playerStatus.SetPoint(POINT_MAX_WEP, oldMaxWep + sashMaxWep); m_playerStatus.SetPoint(POINT_MIN_MAGIC_WEP, oldMinMag + sashMinMag); m_playerStatus.SetPoint(POINT_MAX_MAGIC_WEP, oldMaxMag + sashMaxMag); } } } #endif }
We should replace the if statement with this:
if (SelectedItemData->GetType() == CItemData::ITEM_TYPE_WEAPON || (SelectedItemData->GetType() == CItemData::ITEM_TYPE_COSTUME && SelectedItemData->GetSubType() == CItemData::COSTUME_WEAPON))
-
1
-
-
-
-
Let's debug it one by one.
At first, the hit damage adjustments.
//todebug help you to find where i ve added debug
#ifdef ENABLE_ACCE_SYSTEM //replace it with your define for sash static void ApplyAcceAttackValue(LPITEM pkItem, int* pdamMin, int* pdamMax) { LPCHARACTER ch = pkItem ? pkItem->GetOwner() : NULL; if (!ch) return; LPITEM acceItem = ch->GetWear(WEAR_COSTUME_ACCE); if (!acceItem) return; TItemTable* pkItemAbsorbed = ITEM_MANAGER::instance().GetTable(acceItem->GetSocket(ACCE_ABSORBED_SOCKET)); if (!pkItemAbsorbed) return; if (pkItemAbsorbed->bType != ITEM_WEAPON) return; double AttBonusMax = static_cast<double>(pkItemAbsorbed->alValues[4] + pkItemAbsorbed->alValues[5]); AttBonusMax *= acceItem->GetSocket(ACCE_ABSORPTION_SOCKET); AttBonusMax /= 100; AttBonusMax += 0.5; double AttBonusMin = static_cast<double>(pkItemAbsorbed->alValues[3] + pkItemAbsorbed->alValues[5]); AttBonusMin *= acceItem->GetSocket(ACCE_ABSORPTION_SOCKET); AttBonusMin /= 100; AttBonusMin += 0.5; //todebug if(ch->IsPhase(PHASE_GAME)) ch->ChatPacket(CHAT_TYPE_INFO, "Going to add to your attack : min(%0.2f) max(%0.2f) ", AttBonusMin, AttBonusMax); *pdamMax += static_cast<int>(AttBonusMax); *pdamMin += static_cast<int>(AttBonusMin); }
You may need to add #include "desc.h" at the beginning of the file if you got errors on IsPhase line
In order to debug the code you need to use a sash with attack min and max as bonuses and to hit a mob
-
1
-
-
2 minutes ago, Shahin said:
The values for Magic attack for min and max are good now, but i don't get Normal Attack bonuses at all...
Can you please show me your void CPythonPlayer::__UpdateBattleStatus()
Can you please try to hit a mob with and without the sash to check if server-side the bonus are applied?
And last question, can you tell me if you changed the define with your one?
-
1
-
-
put them as static void
void ApplyAcceAttackValue(LPITEM pkItem, int* pdamMin, int* pdamMax)
i've changed in the code above
-
1
-
-
Nope thanks, i really prefer to write here what i ve to explain you, because i don't really do this for you, i do this for the whole community. I prefer my explanation to be accessible to all who have your problem.
I ve updated with the complete answer.
-
6
-
-
i ve updated the other post with the right answer, i ll update it soon with a complete answer.
-
1
-
-
19 hours ago, Ikarus_ said:
It's impossible to me to give you an exact cause of why your cache looks corrupted.
You can read more about dangling pointers here.
I ve already said that we don't have enoght information to know where the problem is.
I guess you might check all the parts where the m_map_itemCache is used and try to debug your code by adding sys_log and analyze what the code do.
-
Paste on pastebin your uitooltip.py
-
communications between your cores are likely to be down. Probably due to a packet causing an UNKNOWN_HEADER or UNKNOWN PACKET and this causes the connection between the cores to break.
Probably looking in the syserrs of your channels you will find some networking errors. -
Here it looks to be correct. It must work permanently.
I suspect the problem would be how you are 'stopping' the db core.
The changes (e.g. ch->SetRealPoint) are not immediatly saved into the player table, the db core has a cache which is flushed (and so saved) every X seconds (Where x is a variable number).
The value X is defined here:
CPlayerTableCache::CPlayerTableCache() { m_expireTime = MIN(1800, g_iPlayerCacheFlushSeconds); }
so it is a number between 0, and 1800.
By default this value of seconds is defined here :
int g_iPlayerCacheFlushSeconds = 60*7;
and it's 7 minutes (you may set it by defining it in the conf.txt by using the key PLAYER_CACHE_FLUSH_SECONDS)
Why i m explaning all about this?
Because i want to give you way to get what my theory consists.My theory is that you are killing the db process by using killall -9 db or some other command which interrupt the db process, instead of sending a normal stop signal that gives the db time to save changes (currently cached) to the table.
My suggestion is to check how your kill script of the channels/db is stopping them.
-
1
-
Mysql56 to Mysql8
in Community Support - Questions & Answers
Posted · Edited by Ikarus_
Are you compiling on a i386 machine? or an amd64?
Amd64 machines will install you the lib built in 64bit which are incompatible with your game and db executables (which you are building in 32bit).
Here you changed the -I and -L paths you are adding to LIBDIR and INCDIR, but can u find the lib in the directory you moved to?