yeah I'm not surprised it turned out to be there. That part of the code has given me more problems than all the rest combined.
I used to have a debug message in that code that would have helped diagnose it further but I took it out after i thought it was fixed.
Here is the code for the function that is most likely crashing. (not that it will help much)
- void CRecvPACKET::Recv_gsv_QUEST_DATA() //0x071b
- {
- ClientLog(LOG_DEBUG,"Receive quest data packet received"); //this packet also includes the wishlist
- CGame& refGame = CGame::GetInstance();
-
- memcpy( &refGame.m_QuestData, &m_pRecvPacket->m_gsv_QUEST_DATA, sizeof( m_pRecvPacket->m_gsv_QUEST_DATA ) );
-
- //ClientLog(LOG_DEBUG,"first item of wishlist. Type: %i number: %i",m_pRecvPacket->m_gsv_QUEST_DATA.m_WishLIST.m_WishITEM[0].m_cType, m_pRecvPacket->m_gsv_QUEST_DATA.m_WishLIST.m_WishITEM[0].m_nItemNo);
-
- g_EUILobby.CloseAvataListDlg();
-
- CGame::GetInstance().CreateSelectedAvata();
-
-
- gsv_TELEPORT_REPLY data;
- data.m_nZoneNO = refGame.m_SelectedAvataInfo.m_nZoneNO;
- data.m_PosWARP.x = refGame.m_SelectedAvataInfo.m_PosSTART.x;
- data.m_PosWARP.y = refGame.m_SelectedAvataInfo.m_PosSTART.y;
-
-
- refGame.SetLoadingData( data );
- //ClientLog(LOG_DEBUG,"Running GS_MOVE_MAIN.");
- refGame.ChangeState( CGame::GS_MOVEMAIN );
-
- }
What is the build date on trose.exe in your client? I'm looking in the "wibble wibble" repo master on my computer and it looks like the ones in the bin folders are really old. 2014 or something equally ancient.
In the root folder there is one that was built in september 2016. make sure you are using that one.
I haven't worked on this source in a while since nobody seemed to give a crap about it. It seems that lately there are a few people interested in it again so it may be worth my while to rebuild everything again and try to figure out a few of these bugs
That 0x071b packet is a frickin pain in the ass though.
the basic structure seems ok. It goes like this
- 0x071b Initial Quest data uploaded to client. Also includes wishlist for player shops. (seems like a weird place to put that)
- void CRecvPACKET::Recv_gsv_QUEST_DATA()
- struct gsv_QUEST_DATA : public t_PACKETHEADER
- {
- tagQuestData m_Quests; See Sub_Structures page for more information on these structures
- tagWishLIST m_WishLIST; See Sub_Structures page for more information on these structures
- } ;
-
Doesn't look so bad does it?
How about when we actually look at the structure of tagQuestData?
-
- tagQuestData
- struct tagQuestData
- {
- short m_nEpisodeVAR[ QUEST_EPISODE_VAR_CNT ];
- short m_nJobVAR [ QUEST_JOB_VAR_CNT];
- short m_nPlanetVAR [ QUEST_PLANET_VAR_CNT ];
- short m_nUnionVAR [ QUEST_UNION_VAR_CNT ];
- CQUEST m_QUEST [ QUEST_PER_PLAYER ];
- WORD m_wID;
- DWORD m_dwExpirationTIME;
- t_qstvar m_pVAR[ QUEST_VAR_PER_QUEST ]; (0-9)
- Union BYTE m_btSWITCHES[ QUEST_SWITCH_PER_QUEST/8 ]; (0 - 3)
- DWORD m_dwSWITCHES;
- tagBaseITEM m_ITEMs[ QUEST_ITEM_PER_QUEST ]; (0 - 5)
- Union DWORD m_dwSWITCHES [ QUEST_SWITCH_CNT/32 ]; array of 16 groups of flags. Used for deleting or setting entire groups (QSD)
- BYTE m_btSWITCHES [ QUEST_SWITCH_CNT/8 ]; array of 64 bytes containing 512 bit-switches
- short m_nClanWarVAR [QUEST_CLANWAR_VAR_CNT ];
- };
-
and here is tagWishList
- tagWishLIST
- #define MAX_WISH_ITEMS 30
- struct tagWishLIST
- {
- tagITEM m_WishITEM[ MAX_WISH_ITEMS ];
- } ;
-
which of course contains tagITEM
- #define tagITEM tagBaseITEM Just to keep things fun they decided to cast tagITEM as tagBaseITEM. Yeesh….
-
Which as it turns out is actually cast as another structure, tagBaseITEM. Oh hell yeah.... It's like jumping down Alice's rabbit hole
So here is tagBaseITEM
- tagBaseITEM
- struct tagBaseITEM
- {
- byte m_cType;
- short m_nItemNo;
- byte m_bCreated;
- short m_nGEM_OP;
- byte m_cDurability;
- short m_nLife;
- byte m_bHasSocket;
- byte m_bIsAppraisal;
- byte m_cGrade;
- struct //PY added new stats structures
- {
- short m_UStat1;
- short m_UStat2;
- short m_UValue1;
- short m_UValue2;
- };
- struct // Timer related stuff. Typically send zeroes for this
- {
- DWORD dwPickOutTime;
- WORD wPeriod;
- };
- }
-
I kind of modified the hell out of that structure at an earlier stage in order to make some new functionality in the client so that makes it even more complicated. lol
It also used to be full of bit fields which i removed completely at the expense of making the packet slightly bigger. Way easier to work with now though
So anyhow, This is what I have to filter through to figure out what is wrong with that damn packet. lol
Almost forgot to add, the packet contains an array of 30 tagITEM objects
they are sent sequentially making it a rather large packet. Just as well it only gets used once during initial login.