I want to use rails to program a multiplayer game and want to use global variables to hold the game data. Since this data needs to be accessed and modified often to drive the game I want store it in global variables rather than go through the overhead of creating a model with a database table. Is there a simple way of creating global variables in rails that can change. If so how do you protect them so that they are only ever accessed by one thread at a time? Many thanks in advnace -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
If you game is popular, and needs to scale, you''ll be in big trouble if you use global variables rather than the DB. On Aug 23, 2006, at 5:43 AM, Peter Aszkenasy wrote:> > I want to use rails to program a multiplayer game and want to use > global > variables to hold the game data. Since this data needs to be accessed > and modified often to drive the game I want store it in global > variables > rather than go through the overhead of creating a model with a > database > table. Is there a simple way of creating global variables in rails > that > can change. If so how do you protect them so that they are only ever > accessed by one thread at a time? > Many thanks in advnace > > -- > Posted via http://www.ruby-forum.com/. > > >--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---
Tom Mornini wrote:> If you game is popular, and needs to scale, you''ll be in big trouble > if you use global variables rather than the DB.Its not a big game -- Posted via http://www.ruby-forum.com/. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk -~----------~----~----~----~------~----~------~--~---