Online Euchre - Schema Opinions - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23) +--- Thread: Online Euchre - Schema Opinions (/showthread.php?tid=20389) |
Online Euchre - Schema Opinions - El Forum - 07-08-2009 [eluser]slowgary[/eluser] Hi guys, Ok, so this isn't homework because I dropped out of school a long time ago. I've written a web based Euchre game a while back, but never fully completed it. I've learned a lot since then (plus I'm using CI now) and I've decided to pick it back up and start fresh. Where I have issues (as always) is creating the database schema, and I hope that maybe you or someone you know will be able to help. Euchre is a 4 player, 2 team, turn based card game for those that don't know. There's just so many ways to do this that I can't see through to what makes most sense. This is what I had previously, although most of it is garbage: Code: games table //stores data for active games The game did work for the most part, but I started having issues when it came time to create a lobby, and put players into a game. I planned to have a players table but when I originally wrote it I just passed a player id using JavaScript. So it did allow 4 people to play a game on different machines, but only 1 game at a time, no lobby, needed lots of work still. When a player threw a card, I basically just put the cards in order in the database, so that once all players threw their first card, that card would be in n1/e1/s1/w1 and I used the leader and trump fields to determine which of those cards deserved the trick. Then I used the tricks_x + tricks_y to determine how many cards should still appear in each players hand (plus turn for the current round). Now that I'm starting over I really need to revisit the database first, and that's where I'm at. I think I need to add a hash for each game, as well as one per player to assure that no one's throwing someone else's cards, or protect from CSRF cheating. I also think the rest of the schema needs a LOT of work. Reordering the cards seems silly but I don't see a better way at the moment. So basically if you're familiar with Euchre, and you were writing a web-based version, how would you do it? I really appreciate that you've even taken the time to read all this, and I value your opinion. Thanks. |