Jump to content
  • 0

twin ObjectUIDs


VentZer0

Question

Hi,
so this happened already twice:

Person bought a vehicle at a trader, drove off to their base ... restart person screams "admin why has my X turned into a Y?"
I investigate, turns out his vehicle is still at the trader. The other vehicle is from a different person alltogether but they have both the same ObjectUID.
ONLY the ObjectUID is the same for both, everything else Char ID, ObjectID ... is different.

How can this be o_O ?! Thoughts, solutions?

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

I guess technically it is possible since the data type of "objectUID" is BIGINT, and it's not set to be a unique key, at least, from the SQL structure I can see here. It doesn't enforce any integrity of ObjectUID. It could be possible that if the ID is calculated outside of SQL rather than inside it (i.e. Select COUNT(*) X and then +1) and doesn't have any integrity, then two people bought things at the same time and were assigned the same UID; since there's nothing in the SQL I can see that forces the ID to be unique (only "0" as default).

 

 

Current structure:

ObjectUID` bigint(24) NOT NULL DEFAULT '0',

Untested fix for this (I guess a patch would be fun.. :-)) -- do this on a test server.

ALTER TABLE my_object_table
ADD CONSTRAINT objuid_unique UNIQUE (ObjectUID)

Will make MySQL throw an error if this happens; not sure how the hive would handle it, would probably just cancel the transaction and retry. If not, erk,commit some code to epoch hive :)

 

 

From MySQL docs:

 

A UNIQUE index creates a constraint such that all values in the index must be distinct. An error occurs if you try to add a new row with a key value that matches an existing row.

Link to comment
Share on other sites

  • 0

The vehicles were not bought at the same time ... thats what is the weird thing about it.
I wonder if anyone had this bug before.

Do you know where the mod assigns the UID to the vehicle? If I can alter that it might be possible to avoid this error

Link to comment
Share on other sites

  • 0

What is the vehicle objectuid ?  I believe Arma provides the uid to apply. If bought close to a restart or during a heavy load on the server would be the only time I'd suspect duplicates and only if the default value was applied to it, probably zero.

 

Of course of course, what addons are messing with your traders? Fast trading? 

Link to comment
Share on other sites

  • 0

What is the vehicle objectuid ?  I believe Arma provides the uid to apply. If bought close to a restart or during a heavy load on the server would be the only time I'd suspect duplicates and only if the default value was applied to it, probably zero.

 

Of course of course, what addons are messing with your traders? Fast trading? 

was prolly when the server was under heavy load, and yep fast trading.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Advertisement
  • Discord

×
×
  • Create New...