[SOLVED] Create a RoomModule in Orbiter

All Union Platform questions, comments, feature requests, and bug reports.

Create a RoomModule in Orbiter  

Postby dkm000 » Mon 12 Nov 2012 00:22

How do I create a room module in Orbiter and then use in the createRoom() method call?
In Actionscript I would say:
var modules = new RoomModules();
modules.addModule("xxscript.js", "script");

but there does not seem to be a RoomModule class in Orbiter.
dkm000
 
Posts: 8
Joined: Wed 30 Nov 2011 00:05

Re: Create a RoomModule in Orbiter

Postby colin » Mon 12 Nov 2012 05:05

are you sure you're using Orbiter and not OrbiterMicro? Orbiter definitely has a RoomModules class. heres' some sample code:

ActionScript (Reactor):
Code: Select all
var modules:RoomModules = new RoomModules();
modules.addModule("com.business.StockTickerListener", ModuleType.CLASS);
reactor.getRoomManager().createRoom("someRoomID",
                             null,
                             null,
                             modules);


JavaScript (Orbiter):
Code: Select all
var modules = new net.user1.orbiter.RoomModules();
modules.addModule("com.business.StockTickerListener", net.user1.orbiter.ModuleType.CLASS);
orbiter.getRoomManager().createRoom("someRoomID",
                             null,
                             null,
                             modules);


JavaScript (OrbiterMicro):
Code: Select all
orbiter.getMessageManager().sendUPC(UPC.CREATE_ROOM, "someRoomID", "_DIE_ON_EMPTY|true|_MAX_CLIENTS|-1|_PASSWORD|", "", "class|com.business.StockTickerListener");


in all three cases, the code sends the server a "u24" UPC message that looks like this:

Code: Select all
<U><M>u24</M><L><A>someRoomID</A><A>_DIE_ON_EMPTY|true|_MAX_CLIENTS|-1|_PASSWORD|</A><A></A><A>class|com.business.StockTickerListener</A></L></U>


in fact, internally, the "createRoom()" call in both of the preceding Reactor and Orbiter examples ends up calling MessageManager's sendUPC() method. the Reactor and Orbiter calls are convenience APIs for the lower-level UPC message sending performed in the OrbiterMicro example. OrbiterMicro excludes the convenience APIs for the sake of a smaller file size in the codebase (which is ultimately downloaded by the end-user prior to execution).

colin
colin
 
Posts: 232
Joined: Mon 17 Oct 2011 18:47

Re: Create a RoomModule in Orbiter

Postby dkm000 » Mon 12 Nov 2012 05:55

Thanks - I should have tried that. But check the documentation for Orbiter - I could find no reference for RoomModule.
dkm000
 
Posts: 8
Joined: Wed 30 Nov 2011 00:05

Re: Create a RoomModule in Orbiter

Postby colin » Mon 12 Nov 2012 06:24

confirmed. RoomModules's jsdoc comment was missing. i've added it for next release.

thanks!
colin
colin
 
Posts: 232
Joined: Mon 17 Oct 2011 18:47


Return to Union Platform

Online

Users browsing this forum: No registered users and 1 guest