In the current system, MHServerModule uses MHClientInfo's output stream to send messages to the client. Here's my new idea:
- Move the send() method from MHServerModule into MHClientInfo.
- Extend MHClientInfo into MHLocalClientInfo and override the send() method to talk straight to MHLocalClient.
- When a client connects to MHServerModule, the method of connection will determine which version of the client info object is instantiated for that client. If it's a network connection, it will associate an MHClientInfo with that user. Otherwise, it will use MHLocalClientInfo instead.
- MHServerModule will continue to run the listener thread automatically so the same server can be used for local or networked play without modification or subclassing.
I can't wait to see if this idea is as great as I think it is. Of course I'll continue to post my progress here.
No comments:
Post a Comment