On Wed, 2010-11-17 at 11:07 +0100, Xavier Antoviaque wrote: > > Proppy would be better suited for the advices here, but I can try to > > help - Vlad, can you describe the issues you've encountered? > [vlad] a good exaqmple would be this: my game_session class is a > singleton because i need to make sure there's only one instance > throught the script execution
I'm going to forward this to Proppy, to see if he has any advices - I don't know the best way to do this here. While we are at it, would you be able to list all the other issues or questions you have with tests? This way if proppy has the time, we can try to solve everything at once. > [vlad] right now, i have the class_mission_action class that plays the > role of mission engine and fits with the observer pattern > And then i have the mission abstract class and the missions > themselves. I'll try to move the functions that were not used by the > mission scripts. Yup, that would be perfect! > I know that i got some problems when i first tried to do that and > that's why i decided to keep them in the ebstract class, but this was > before using the game_session as a singleton, so i'll have to take > another look and see how i can accomplish that Alright - let me know if you need any help. > > - Some problems with tabs and spaces - see for example > http://bazaar.launchpad.net/~vlad-dragu/hackit/alpha2.0/annotate/124/simpletest/test/hackit_user_class.php to see what I mean. You may want to run http://pear.php.net/manual/en/package.php.php-codesniffer.php to ensure compliance with PEAR standards. > [vlad] ok, probably i should do it afteri do the other modifications Yup, sounds good. I'll also add it to "make check", this way it would allow to automate that part too. (Btw, did you see my email about the Makefile? http://farsides.com/forum/index.php?t=msg&goto=10943#msg_10943 ) > [vlad] no, i didn't do it. Is there any way to do it after the fact? > So, after i renamed it, can i run this command or is it too late? I'm no baazar guru, but I think once it's commited it's too late, as I don't know any way to rollback a previous version of a single file. But it's ok here, it's more to let you know that the "bzr mv" command exists for the next times. > [vlad] that GET var is not coming from client input. When the player > does an action in the game, i use an ajax call to alert the mission > engine that an action has been taken. The ajax call is a post call > actually and that's where the var comes from. I get the hack results > from the game session Could you show me where this is handled in the code? Do you check what you get from the client ajax call? Even if it is not coming from player input in the browser, would a player be able to craft an HTTP request that would make the mission engine believe the hack was a success when it was actually a failure? > > - Need to remove the "return true" from mission file - this should > be > > the default, no need to add an extra line - we can just put "return > > false" when needed. You should also clear out the commented code in > > FirstMission.php. > [vlad] understood, i'll do that Thanks Vlad! 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/

