Jump to content

[SOLVED] Gaming and UPDATE LOW_PRIORITY


Crusader

Recommended Posts

Would using an "UPDATE LOW_PRIORITY" have any negative effects on a game?

 

I'm storing user positions in the database and updating their row whenever they move to a different area (which would be a lot).

 

UPDATE LOW_PRIORITY `players` 
SET `sector` = ?, `galaxy` = ?, `x` = ?, `y` = ? 
WHERE `game` = ? AND `player_id` = ? 
LIMIT 1

 

Before calling that statement this is initially run at the start of every page.

 

SELECT * 
FROM `players` 
WHERE `user_id` = ? AND `game` = ? 
LIMIT 1

 

Would this result in nobody being able to move until someone else has completed theirs? I don't want that to happen and am not sure how to test this. ???

 

Note: I believe table locking is set to off on mysqld.

Link to comment
https://forums.phpfreaks.com/topic/130826-solved-gaming-and-update-low_priority/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.