Code: Select all
package roomcreatepzextension;
import com.smartfoxserver.v2.core.SFSEventType;
import com.smartfoxserver.v2.extensions.SFSExtension;
public class RoomCreatePzExtension extends SFSExtension {
@Override
public void init() {
trace("initialization method started...-----------------------------------------");
addEventHandler(SFSEventType.SERVER_READY,RoomCreationHandler.class);
trace("initialization method started 2222...-----------------------------------------");
}
}
Code: Select all
package roomcreatepzextension;
import com.smartfoxserver.v2.api.CreateRoomSettings;
import com.smartfoxserver.v2.core.ISFSEvent;
import com.smartfoxserver.v2.entities.Room;
import com.smartfoxserver.v2.exceptions.SFSCreateRoomException;
import com.smartfoxserver.v2.exceptions.SFSException;
import com.smartfoxserver.v2.extensions.BaseServerEventHandler;
class RoomCreationHandler extends BaseServerEventHandler {
@Override
public void handleServerEvent(ISFSEvent isfse) throws SFSException {
trace("in the handle server event ----------------------------------------------------");
CreateRoomSettings cfg = new CreateRoomSettings();
cfg.setName("Myroom876");
cfg.setMaxUsers(50);
cfg.setDynamic(true);
trace("above the try method in RoomCreationHandler--------------------------------------");
try
{
Room myNewRoom = getApi().createRoom( getParentExtension().getParentZone(), cfg, null);
trace("Room Created MyRoom876--------------------------------------------------");
}
catch (SFSCreateRoomException ex)
{
trace(ex);
}
}
}
errors:
>> Zone: secondZone
::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
19:26:03,758 INFO [main] Extensions - {createRoomPz}: initialization method started...-----------------------------------------
19:26:03,758 INFO [main] Extensions - {createRoomPz}: initialization method started 2222...-----------------------------------------
19:26:03,759 INFO [main] managers.SFSZoneManager -
19:26:03,819 WARN [SFSWorker:Ext:2] Extensions - {createRoomPz}: Illegal access for handler class: java.lang.IllegalAccessException: Class com.smartfoxserver.v2.extensions.SFSHandlerFactory can not access a member of class roomcreatepzextension.RoomCreationHandler with modifiers ""
Can someone trace why the error is coming .