Bag Slot ID signed/or unsigned

EQ2Emulator Development forum.

Moderator: Team Members

Post Reply
User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Bag Slot ID signed/or unsigned

Post by Ememjr » Sun Mar 24, 2019 3:00 pm

i use greatbig 255 slot bags

now that it is starting to get fuller , i am getting errors when server is trying to write character items to the dbthat the 'slot' is of the wrong type and the values is a negative number

the db has slot as unsigned tinyint
the server has sint16 i think this is it

Code: Select all

struct ItemCore{ 
	int32	item_id;
	sint32	soe_id;
	int32	bag_id;
	sint32	inv_slot_id;
	sint16	slot_id;
	int8	index;
	int16	icon;
	int16	count;
	int8	tier;
	int8	num_slots;
	int32	unique_id;
	int8	num_free_slots;
	int16	recommended_level;
};
which is correct

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Bag Slot ID signed/or unsigned

Post by Jabantiz » Sun Mar 24, 2019 3:44 pm

slot_id should always be positive for stuff in your inventory, however for overflow it is negative. So signed is what the server needs but as it is a sint16 and the db is a uint8 they should never conflict.

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: Bag Slot ID signed/or unsigned

Post by Ememjr » Sun Mar 24, 2019 3:50 pm

well what should be and what is, is the problem,
itemsave.JPG
it is triying to save the item as -78
You do not have the required permissions to view the files attached to this post.

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Bag Slot ID signed/or unsigned

Post by Jabantiz » Sun Mar 24, 2019 4:03 pm

So the server has to be going over 255 in the slot, that is odd especially as that shouldn't happen if the bag has a max slots of 255...

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: Bag Slot ID signed/or unsigned

Post by Ememjr » Sun Mar 24, 2019 4:07 pm

isnt the range for int8 signed -128 to +128

Jabantiz
Lead Developer
Posts: 2912
Joined: Wed Jul 25, 2007 2:52 pm
Location: California

Re: Bag Slot ID signed/or unsigned

Post by Jabantiz » Sun Mar 24, 2019 4:16 pm

yes but the db uses the int8 and it is unsigned, the server uses the sint16, unless it is getting converted somewhere else in the code before it hits the db.

User avatar
Ememjr
Team Member
Posts: 975
Joined: Wed Mar 15, 2017 9:41 am
EQ2Emu Server: Perseverance

Re: Bag Slot ID signed/or unsigned

Post by Ememjr » Sun Mar 24, 2019 4:31 pm

ok i ll trace it back

Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests