Accessing various attributes from outside Application

Not sure if this is the right forum, but don't know where else to put it.



I currently have a component based setup. Here I have the main application, which extends SimpleApplication. This all works no problem. I have a seperate component for the GUI and this component has no direct contact with the main application component. The iudea behind this is that it would be easier to switch out parts of the application as needed.



Now I need to create a NiftyJME3Display in my GUI component. But this needs some variables which are only availlable on the SimpleApplication. Is there a decent way to access these variables? I tried static methods on my main application class, but this doesn't work.

So are you saying that there are two separate Main classes running at the same time?  If that’s the case, you may want to look into Remote Method Invocation via localhost.

No, I have 1 jvm, with 1 main class, the Application. In this main class, i startup a message bus which in turn starts up all the various components. (Plugin Framework for Java download | SourceForge.net). My Nifty component is a plugin in that framework. Since I'm working on sometihng others could also use in their game, I wanted the different parts (GUI, Network, etc.) to be easily changeable. This framework provides for that.



But I figured it out. I created a GuiContainer with a static reference to itself. In here, I just store all the stuff I need.



What I'm working on is an Open Game Finder. This will be something used in multiplayer games to match players. Like a lobby system. You will be able to enter the lobby, search for open multiplayer games, chat, setup VOICE chat (maybe). And the idea is to set it up in such a way that people can plug it into any multiplayer game without much trouble.since both the client and the server will be standardized and extendable. Once I have something worth showing, I'll let you guys know and I'll post on the projects forum.

Ah ok, this makes a bit more sense.  Keep us posted!

Well, the current code is here:

http://www.ractoc.com/opengamefinder/svn/



I finished the login / registration screens. I am currently waiting on Lars from SpiderMonkey to fix me up a workable version so I can connect the login to the server, but for now I just accept anything. I am currently working on a chat / lobby screen. This will be the main screen from where you can go and find a game, start a server of your own etc.



The eventual OGF will support a lobby, player run servers, remote servers, and if Lars can make it work VOICE chat as well. Because of the plugin framework I’m using, people can replace those parts of the code they need to incorporate it into their own game.



I’ll see if I can put up a nice post in the projects forum now…