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!

[Solved]rz_item_equip fix for updated sources

Status
Not open for further replies.
Newbie Spellweaver
Joined
Sep 1, 2012
Messages
31
Reaction score
1
Hi !

I'm working on the updated sources provided by Jose Lucas, but i can't figure out how to fix the item equipment thing: everytime i try to equip an item, i get this error:

Code:
[06/18 11:56:26]        DB 11 ERROR : DBTASK ID : 63, DB STATE : NUM(0), NativeErr:1, SQLSTATE[42883], StateInfo:ERROR: function rz_item_equip(integer, integer, integer, integer, boolean, integer, integer, integer) does not exist;
Error while executing the query
[06/18 11:56:26] DB ERROR : TRACING PROC(0, U) = {CALL RZ_ITEM_EQUIP (1, 0, 11, 30, FALSE, 255, -1, 0)}
[06/18 11:56:26] DB ERROR : TRACING PROC(0, A) = {CALL RZ_ITEM_EQUIP (1, 0, 11, 30, FALSE, 255, -1, 0)}

But the function exists, and data types are correct, so i wonder if anyone around know how to fix this ?

Thanks ! :)
 
Last edited:
Newbie Spellweaver
Joined
Oct 20, 2013
Messages
67
Reaction score
15
Re: rz_item_equip fix for updated sources

The solution is in the error already. I don't know what the parameters for the RZ_ITEM_EQUIP are but they seem to be passed through, I guess it's the sql query failing. Check your db for the item you're trying to equip or check the sql query itself if it executes at the right db. You might also have passed too many or too less arguments too. If you would post the function and query itself next time it would be easier to help, kinda hard without having the stuff you used. Anyways, do what I've written above and post your result.
 
Newbie Spellweaver
Joined
Sep 1, 2012
Messages
31
Reaction score
1
Re: rz_item_equip fix for updated sources

Thanks for your answer,

this is the query code:
Code:
create function rz_item_equip(p_owner_sn bigint,
                                p_eq_from_slot_num smallint,
                                p_eq_to_slot_num smallint,
                                p_eq_item_durability smallint,
                                p_eq_item_tied boolean,
                                p_uneq_from_slot_num smallint ,
                                p_uneq_to_slot_num smallint ,
                                p_uneq_item_durability smallint DEFAULT 0) returns void
LANGUAGE plpgsql
AS $$
DECLARE
  c_rz_inventory CONSTANT integer NOT NULL DEFAULT rz_user_item_place_to_slot_type('INVENTORY');
  c_rz_equipment CONSTANT integer NOT NULL DEFAULT rz_user_item_place_to_slot_type('EQUIPMENT');
  
BEGIN
  PERFORM rz_item_move(p_owner_sn,
                       c_rz_inventory,
                       p_eq_from_slot_num,
                       p_owner_sn,
                       c_rz_equipment,
                       p_eq_to_slot_num);
                        
  UPDATE rz_user_item
     SET durability = p_eq_item_durability,
         tied       = p_eq_item_tied
   WHERE item_sn = (SELECT rz_item_sn_get_with_exception(p_owner_sn, c_rz_equipment, p_eq_to_slot_num));
                                   
  -- 255: SH_ITEM_SLOT::ITEMSLOT_NONE
  IF p_uneq_from_slot_num <> 255 THEN
    PERFORM rz_item_move(p_owner_sn,
                         c_rz_equipment,
                         p_uneq_from_slot_num,
                         p_owner_sn,
                         c_rz_inventory,
                         p_uneq_to_slot_num);
                         
    UPDATE rz_user_item
       SET durability = p_uneq_item_durability
     WHERE item_sn = (SELECT rz_item_sn_get_with_exception(p_owner_sn, c_rz_inventory, p_uneq_to_slot_num));
  END IF;
END;
$$;

Parameters looks ok too, and i've already check the db (11 is for gameDB), but it seems that everything which deals with items fail (craft, equip, drop) except delete.
"Check your db for the item you're trying to equip" -> items are stored in DB? I though they were only stored in the xitem.xml file !

For the query, here it is:
Code:
wchar_t g_szDB_ITEM_EQUIP[] = L"{CALL RZ_ITEM_EQUIP (%I64d, %d, %d, %d, %s, %d, %d, %d)}";

	strSQL.Format(g_szDB_ITEM_EQUIP, 
		data.nCID, [B]-> integer[/B]
		data.equip.m_nSlotID, [B]-> integer[/B]
		data.equip.m_nToSlotID, [B]-> integer[/B]
		data.equip.m_nDura, [B]-> integer[/B]
		mdb::MDBBoolUtil::ToWString(data.equip.m_bClaimed), [B]->bool (return "TRUE" or "FALSE" text)[/B]
		data.unequip2.m_nSlotID, [B]-> integer[/B]
		data.unequip2.m_nToSlotID, [B]-> integer[/B]
		data.unequip2.m_nDura); [B]-> integer[/B]
 
Newbie Spellweaver
Joined
Oct 20, 2013
Messages
67
Reaction score
15
Re: rz_item_equip fix for updated sources

Code seems fine and yes items are stored in db too as well as I remember, check if there's any item in the db. I remember ppl having problems with items in general with that release. Is your character completely nacked? If yes the items are missing in the db. It's a pretty bad way of managing items though lol.
 
Newbie Spellweaver
Joined
Sep 1, 2012
Messages
31
Reaction score
1
Re: rz_item_equip fix for updated sources

Yeah, character is naked lol

But i don't see any table suitable for item definitions, and i can spawn them, so the server "knows" the items somehow, i can't find what's wrong :/
 
Newbie Spellweaver
Joined
Oct 20, 2013
Messages
67
Reaction score
15
Re: rz_item_equip fix for updated sources

Im pretty sure its missing in the DB, i remember a table containing information like ID, NAME, TIER, MESH_NAME, NODE_NAME and so on. A screen of the gamedb tables would be a big help, i dont have the stuff set up here. Rather more you should look at the tables again, im pretty sure there has to be a table related to items.
 
Newbie Spellweaver
Joined
Jun 18, 2017
Messages
9
Reaction score
1
Re: rz_item_equip fix for updated sources

That was a simple mistake an author made. The correct call must be:
Code:
CALL RZ_ITEM_EQUIP (%I64d, '%d', '%d', '%d', %s, '%d', '%d', '%d')
In PostgreSQL, a smallint argument must be represented as string literal (or explicitly casted).

Or you might need to replace entrie DB and source to get it work (take from attachment).
 

Attachments

You must be registered for see attachments list
Last edited:
Newbie Spellweaver
Joined
Sep 1, 2012
Messages
31
Reaction score
1
Re: rz_item_equip fix for updated sources

kokonuts yeah, with the original files there was a table which contained informations about all items, butit seems that it's not used in this files.
Here are all the tables i got :
rzmpyske Thanks for the tip, i'll try as fast as i can !

Thanks both of you for your help !



Thqnk you guys: problem solved ! :D

http://prntscr.com/flahfs

I really don't get why PostgreSQL does that ... Maybe i'm too used to MySQL ...
 
Newbie Spellweaver
Joined
Oct 20, 2013
Messages
67
Reaction score
15
Re: rz_item_equip fix for updated sources

So what was the fix, honestly if you want to work with rz don't use those vanilla experience released stuff, stick with cmb or bola release (cmbs is the only good ones though lol). And I'm not sure if it's a prop on my machine but postgresql seems to not perform that we'll, I'm running a 5820k though lol.
 
Newbie Spellweaver
Joined
Jun 18, 2017
Messages
9
Reaction score
1
Re: rz_item_equip fix for updated sources

@kokonuts yeah, with the original files there was a table which contained informations about all items, butit seems that it's not used in this files.
Here are all the tables i got :
@rzmpyske Thanks for the tip, i'll try as fast as i can !

Thanks both of you for your help !



Thqnk you guys: problem solved ! :D



I really don't get why PostgreSQL does that ... Maybe i'm too used to MySQL ...
That's because PostgreSQL supports function overloading. It's just same as other languages:
Code:
void foo( int a )
{
  std::cout << "abcd" << std::endl;
}

void foo( short a )
{
  std::cout << "efgh" << std::endl;
}

int main( int argc, char* argv[] )
{  
  foo(0);           // prints "abcd"
  foo((short)0); // prints "efgh"

  return 0;
}
 
Last edited:
Newbie Spellweaver
Joined
Oct 20, 2013
Messages
67
Reaction score
15
Re: rz_item_equip fix for updated sources

That's because PostgreSQL supports function overloading. It's just same as other languages:
Code:
void foo( int a )
{
  std::cout << "abcd" << std::endl;
}

void foo( short a )
{
  std::cout << "efgh" << std::endl;
}

int main( int argc, char* argv[] )
{  
  foo(0);           // prints "abcd"
  foo((short)0); // prints "efgh"

  return 0;
}

Thats not what I meant mate, I meant what the fix for him was since he didnt tell but its done now. Appreciate if the thread gets closed now.
 
Newbie Spellweaver
Joined
Sep 1, 2012
Messages
31
Reaction score
1
Re: rz_item_equip fix for updated sources

Srry for delayed answer.

The problem was the ' ' around the %d in the rz_item_equip query.
It was fixed by editing the function call in the sources with the correction provided by rzmpyske.

rzmpyske yeah but i'm working with another game, which currently use MySQL, and never had to put quotes to change the data type: an integer is an integer. Period :D

Thanks to both of you :)
 
Status
Not open for further replies.
Back
Top