From: Erik V. <eri...@xs...> - 2012-02-15 23:24:17
|
No. The goal is to provide access to the current GameManager for objects that don't have a reference to it: via a thread property. That is what NDC provides. Originally GameManager was a singleton, and in those times it was easy. But at some point we decided that we should be prepared for multiple games running in the same JVM, and NDC was the only mechanism I knew about that could help me out to identify which GM any object would belong to. Currently the implementation is still rudimentary, as the GM key given to NDC is fixed. But in a multi-game server, that key should be derivable, for instance from the identity of the stream over which an incoming player action would arrive. I hope this is a bit clear... Erik. > -----Original Message----- > From: Frederick Weld [mailto:fre...@go...] > Sent: Wednesday, February 15, 2012 7:58 PM > To: Development list for Rails: an 18xx game > Subject: [Rails-devel] Game Initialization within the EDT / AWT EventQueue > > In RunGame, I've found the following comment: > "We have to run loadGame on an AWT EventQueue to make sure that NDC > will properly initialize game key so that GameManager instance can be > properly queried for. This is a consequence of NDC abuse." > > New games are also initialized within EDT since this is triggered by the button > pressed event. > > So my question to Erik/Stefan/Brett: > What is the goal of (ab)using the EDT? Is it that only one game may be started > at the same time? > > -- Frederick > > ---------------------------------------------------------------------------- -- > Virtualization & Cloud Management Using Capacity Planning Cloud computing > makes use of virtualization - but cloud computing also focuses on allowing > computing to be delivered as a service. > http://www.accelacomm.com/jaw/sfnl/114/51521223/ > _______________________________________________ > Rails-devel mailing list > Rai...@li... > https://lists.sourceforge.net/lists/listinfo/rails-devel |