Welcome!

Join our community of MMO enthusiasts and game developers! By registering, you'll gain access to discussions on the latest developments in MMO server files and collaborate with like-minded individuals. Join us today and unlock the potential of MMO server development!

Join Today!

[HELP] Dark Horse & Dark Raven levels reset when leaving the game .

Initiate Mage
Joined
Aug 6, 2014
Messages
67
Reaction score
12
Hello,
I own a s6.3 server which is based on zTeam s6.3 files - this repack .
As the title says i have a problem that when i leave the game or even just performing a character switch when i go back to the character the levels of the Dark Horse and Dark Raven returns to '0' .

Any idea what i can do about it ?
 
Initiate Mage
Joined
Aug 6, 2014
Messages
67
Reaction score
12
Maybe you dont have needed table in your database. Check dataserver logs.

Hay, thanks for your reply .
I have checked the logs and it seems like the right table is exist. according to the logs when the dark raven or horse level up it updates the 'T_PetItem_Info' table which exists in my database. The problem is the table is empty . so i've checked what happens when crafting a new dark raven or dark horse and it seems that there is no query execution to insert a new row to the table .

In the source there is a function to insert this row but i am not sure where i should add this function .
Any Idea ?

Thanks, Afik .
 
Upvote 0
Joined
Oct 8, 2006
Messages
740
Reaction score
289
You need to see what's the functions inside the dataserver corresponding to pets being saved in the DB table.
Then you can check if that query is existing or needs to be added.
Crafting is not the same as equipping a pet. Crafting is not inserting the item into the PetItem_Info table, but it's gonna insert it in your character Inventory table field.
Equipping it and leveling it should save the pet item info, because it's global information, not per player. If you're gonna trade the raven/horse, that data should exist further for the new owner.
 
Upvote 0
Initiate Mage
Joined
Aug 6, 2014
Messages
67
Reaction score
12
Maybe you dont have needed table in your database. Check dataserver logs.

You need to see what's the functions inside the dataserver corresponding to pets being saved in the DB table.
Then you can check if that query is existing or needs to be added.
Crafting is not the same as equipping a pet. Crafting is not inserting the item into the PetItem_Info table, but it's gonna insert it in your character Inventory table field.
Equipping it and leveling it should save the pet item info, because it's global information, not per player. If you're gonna trade the raven/horse, that data should exist further for the new owner.

Ok So i know what's the problem but i'm not sure how to solve it .
The 'T_PetItem_Info' table is the table which holds the pet info, this table have 3 columns : 'ItemSerial', 'Pet_Level', 'Pet_Exp' .
The problem is with the 'ItemSerial' column : the column is of type int and the value that is being sent from the GS is a bigger number than the type int can hold . To make sure that it's really the problem i've change the column type to bigint and hooray we got our first Dark Raven info saved in our database . But now i am encountering a new problem all 'ItemSerial' values of Dark Raven that are beeing sent from the GS are the same so all of the dark ravens overides each others, And this is where im stuck now . I have no clue what to do .

Any ideas?
 
Upvote 0
selling server files is against RZ rules
Joined
Feb 26, 2013
Messages
542
Reaction score
131
Ok So i know what's the problem but i'm not sure how to solve it .
The 'T_PetItem_Info' table is the table which holds the pet info, this table have 3 columns : 'ItemSerial', 'Pet_Level', 'Pet_Exp' .
The problem is with the 'ItemSerial' column : the column is of type int and the value that is being sent from the GS is a bigger number than the type int can hold . To make sure that it's really the problem i've change the column type to bigint and hooray we got our first Dark Raven info saved in our database . But now i am encountering a new problem all 'ItemSerial' values of Dark Raven that are beeing sent from the GS are the same so all of the dark ravens overides each others, And this is where im stuck now . I have no clue what to do .

Any ideas?

Try use normal server files )
 
Upvote 0
Joined
Oct 8, 2006
Messages
740
Reaction score
289
Seems a problem when the Raven/Horse is generated. By the way, how did you made the Raven/Horse? By editor or crafting it in-game?

The editor can make the same ItemSerial for your items created by it.

GS should generate a new ItemSerial for those items when created/crafted, not when placed with the help of an Mu Editor.
 
Upvote 0
Initiate Mage
Joined
Aug 6, 2014
Messages
67
Reaction score
12
Seems a problem when the Raven/Horse is generated. By the way, how did you made the Raven/Horse? By editor or crafting it in-game?

The editor can make the same ItemSerial for your items created by it.

GS should generate a new ItemSerial for those items when created/crafted, not when placed with the help of an Mu Editor.

Thanks for your reply, in both ways the same serial number is generated.
 
Upvote 0
Initiate Mage
Joined
Aug 6, 2014
Messages
67
Reaction score
12
Ok so it seems like there is a class that generates the serial numbers to all and not just pet item . And i think this class is broken since it is always generates the same serial number no matter what is the item . Even tho i have knowledge in code as a web developer i still couldn't understand anything from this class since it seems like it's using some library which idk because i dont usually use c++ libraries. If anyone have any idea what is going on here is the class, it's very simple but yet i couldn't understand it :
.cpp File :
Code:
CWzItemSerial gWzItemSerial;

CWzItemSerial::CWzItemSerial(): m_dwItemSerial(0), m_dwLastSerial(0)
{
    InitializeCriticalSection(&m_csItemSerial);
}

CWzItemSerial::~CWzItemSerial()
{
    DeleteCriticalSection(&m_csItemSerial);
}

int CWzItemSerial::MakeSerial()
{
    if( gGSDbSet.GetItemSerial(m_dwItemSerial, 3000) == FALSE )
    {
        return FALSE;
    }

    m_dwLastSerial = m_dwItemSerial + 3000;
    return 1;
}

DWORD CWzItemSerial::GetSerial()
{
    EnterCriticalSection(&m_csItemSerial);
    
    if ( m_dwItemSerial >= m_dwLastSerial )
    {
        MakeSerial();
    }

    DWORD retserial = m_dwItemSerial;

    m_dwItemSerial++;

    LeaveCriticalSection(&m_csItemSerial);

    return retserial;
}

.h File :
Code:
#if !defined(AFX_WZITEMSERIAL_H__5DA9C0E0_60FF_4252_A5D6_D9CFC2FFD80B__INCLUDED_)
#define AFX_WZITEMSERIAL_H__5DA9C0E0_60FF_4252_A5D6_D9CFC2FFD80B__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

class CWzItemSerial  
{
public:
    CWzItemSerial();
    virtual ~CWzItemSerial();
    
    int MakeSerial();
    DWORD GetSerial();

public:
    DWORD m_dwItemSerial;
    DWORD m_dwLastSerial;
    CRITICAL_SECTION m_csItemSerial;
};

extern CWzItemSerial gWzItemSerial;

Thanks in advanced !
 
Upvote 0
Joined
Oct 8, 2006
Messages
740
Reaction score
289
So mainly you need to lookup inside the GameServer.
There's a file called zzzitem.cpp

Here there are item generations happening.


In DataServer, look up at this:
Code:
case 0x55:    //-> GDPetItemCreate
{
WzRecvQ3.AddToQueue((LPBYTE)(recvbuf+lOfs), size, headcode, uIndex, g_DelayHandler.GetQuerySessionId());
}                break;

This is the code responsible to send data from GameServer to DataServer. This is when the pet item is created.

Code:
void GDPetItemCreate(LPSDHP_PET_ITEMCREATE lpMsg, int aIndex); --> GameServer to DataServer
void DGGetPetItemInfo(BYTE *lpRecv, int aIndex); --> DataServer to GameServer
void DGSetPetItemInfo(BYTE *lpRecv, int aIndex); --> DataServer to GameServer

These are the functions which are used to exchange data between GS and DS.



Code:
BOOL CPetDBSet::LoadPetInfo(DWORD number, int& Level, int& Exp)

qSQL.Format("SELECT Pet_Level, Pet_Exp FROM T_PetItem_Info WHERE ItemSerial=%u", number);

BOOL CPetDBSet::SavePetInfo(DWORD number, int Level, int Exp)

qSQL.Format("UPDATE T_PetItem_Info SET Pet_Level=%d, Pet_Exp=%d WHERE ItemSerial=%u", Level, Exp, number);

The queries are existing inside the DataServer.

Also the functions for setting and getting the pet info are existing too.

I'm really not sure what's happening in your server.

Some screenshots with the data from DB would help, even screenshots the DataServer app and GameServer app when the raven/horse is not working.
 
Last edited:
Upvote 0
Back
Top