On Tue, 2010-11-30 at 03:54 +0200, Vlad Dragu wrote: > For the code review i still have to move some code from the mission > abstract class to the mission engine class (now called mission > action). > this presents a problem which i'll describe here, maybe Xavier can > give his input: so, i have a mission engine which should be resposible > fror manipulating missions. In my mind this will also include the > process of serialization / deserialization of missions and read/write > the state to the db. In order for that to work, the mission must > contain information about the actions that its currently waiting on > (the action queue). But that's the exact code i must take out from the > mission class and move it to the mission engine class. If i do that, > then i will have to serialize the entire mission engine class which > doesn't seem like a good decision from the application design > standpoint. So at this point, i do not know if i still should move the > code and make the necessary adjustments or not? Xavier, what do you > think?
I agree with you, the mission engine should contain the process of serialization of missions and read/write the state on the database. That includes the information about the actions that all missions are waiting on: this should be stored in the database by the mission engine. The way it would work would be: 1) A mission waits on an event by calling $this->wait_for_action() 2) $this->wait_for_action calls the mission engine and asks to have one of its methods called back when the action is performed by the user 3) the mission engine adds a row in the database containing: the action to wait for, the user id of the player who has to perform the action, and the mission identifier 4) Right before the end of the request processing, the mission engine serializes the mission object and stores it Does it makes sense? > On the bugs: from the 2.1 i got some questions for the first 2 bugs > (they are on the bug tracker) I've had a look at the bugs today - if there are still some pending questions, give me the link of the bugs and I'll have a look. Xavier. _______________________________________________ Farsides mailing list - [email protected] Wiki: http://farsides.com/ List: http://farsides.com/ml/ Forum: http://farsides.com/forum/ Ideas: http://farsides.com/ideas/ Chat: http://farsides.com/chat/

