[Pogamut-list] Using UCCWrapper

jacob.schrum pogamut-forum at diana.ms.mff.cuni.cz
Thu Jun 17 07:16:23 CEST 2010


Re: Using UCCWrapper

Author: jacob.schrum

I went ahead and copied my UT install to a directory with no spaces, so I can get the Wrapper to work. I would still like to see this problem fixed though.

Moving on to other issues, I'm now trying to make sure I'm using the Wrapper right, and shutting the server down properly (This is somewhat related to my other post on bot termination). Here's my code:
-----------------------------
        UCCWrapper.UCCWrapperConf config = new UCCWrapper.UCCWrapperConf();
        config.setMapName("DM-Junkyard");
        config.setGameType("BotDeathMatch");
        config.setOptions("?timelimit=0?fraglimit=0?GoalScore=0");
        UCCWrapper ucc = new UCCWrapper(config);

... launch the bots and evlauate until all bots execute their kill methods ...

        UT2004Server server = ucc.getUTServer();
        ObservableCollection agents = server.getAgents();
        for(IAgent bot: agents){
            // All of my bots have this superclass
            BaseBot baseBot = (BaseBot) bot;
            // getId() is available in my BaseBot method, but not in regular default bots
            server.getAct().act(new Kick(baseBot.getId()));
        }
        //What's the difference between stop and kill?
        server.stop(); 
        server.kill();
        ucc.stop();

----------------------------------------------------

This code is then repeated, essentially within a loop. Therefore, as soon as one server is taken down, I need to start another one. I feel as though I'm doing this in a very sloppy manner, and although I seem to be successfully launching new servers, I'm not entirely sure that I'm successfully closing the old ones. Can someone recommend a way of improving this?

-- 
Reply Link: <http://diana.ms.mff.cuni.cz/main/tiki-view_forum_thread.php?forumId=4&comments_reply_threadId=4&comments_parentId=233&post_reply=1#form>





More information about the Pogamut-list mailing list