Skip to content

Instantly share code, notes, and snippets.

@sprite2005
Created June 27, 2013 21:43
Show Gist options
  • Save sprite2005/5880671 to your computer and use it in GitHub Desktop.
Save sprite2005/5880671 to your computer and use it in GitHub Desktop.
I have a table for matchmaking where there may or may not be "games waiting for an opponent". I am planning to just use UPDATE tablename SET guid = [some GUID created by client], waiting_on_match_since = NULL WHERE waiting_on_match_since IS NOT NULL ORDER BY waiting_on_match_since LIMIT 1. Then querying for the GUID to see if we joined a game that was waiting for a match or if we should create one. Is this an ok approach for this or a complete hack?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment