//Map whiteboardObj = (Map) whiteboardObjParam;
// Check if this User is the Mod:
IConnection current = Red5.getConnectionLocal();
RoomClient currentClient = this.clientListManager.getClientByStreamId(current.getClient().getId());
if (currentClient == null) {
return;
}
Long room_id = currentClient.getRoom_id();
//log.debug("***** sendVars: " + whiteboardObj);
//Store event in list
String action = whiteboardObj.get(2).toString();
if (action.equals("deleteMindMapNodes")) {
//Simulate Single Delete Events for z-Index
List actionObject = (List) whiteboardObj.get(3);
List<List> itemObjects = (List) actionObject.get(3);
Map whiteboardTempObj = new HashMap();
whiteboardTempObj.put(2,"delete");
for (List itemObject : itemObjects) {
List<Object> tempActionObject = new LinkedList<Object>();
tempActionObject.add("mindmapnode");
tempActionObject.add(itemObject.get(0)); //z-Index -8
tempActionObject.add(null); //simulate -7
tempActionObject.add(null); //simulate -6
tempActionObject.add(null); //simulate -5
tempActionObject.add(null); //simulate -4
tempActionObject.add(null); //simulate -3
tempActionObject.add(null); //simulate -2
tempActionObject.add(itemObject.get(1)); //Object-Name -1
whiteboardTempObj.put(3, tempActionObject);
WhiteboardManagement.getInstance().addWhiteBoardObjectById(room_id, whiteboardTempObj, whiteboardId);
}
} else {
WhiteboardManagement.getInstance().addWhiteBoardObjectById(room_id, whiteboardObj, whiteboardId);
}
int numberOfUsers = 0;
//This is no longer necessary
//boolean ismod = currentClient.getIsMod();
//log.debug("*..*ismod: " + ismod);
//if (ismod) {
Map<String,Object> sendObject = new HashMap<String,Object>();
sendObject.put("id", whiteboardId);
sendObject.put("param", whiteboardObjParam);
Configuration conf = Configurationmanagement.getInstance().getConfKey(3, "show.whiteboard.draw.status");
boolean showDrawStatus = conf != null && "1".equals(conf.getConf_value());
//Notify all Clients of that Scope (Room)
Collection<Set<IConnection>> conCollection = current.getScope().getConnections();
for (Set<IConnection> conset : conCollection) {
for (IConnection conn : conset) {
if (conn != null) {
if (conn instanceof IServiceCapableConnection) {
RoomClient rcl = this.clientListManager.getClientByStreamId(conn.getClient().getId());
if ((rcl == null) || (rcl.getIsScreenClient() != null && rcl.getIsScreenClient())) {
continue;
} else {
//log.debug("*..*idremote: " + rcl.getStreamid());
//log.debug("*..* sendVars room_id IS EQUAL: " + currentClient.getStreamid() + " asd " + rcl.getStreamid() + " IS eq? " +currentClient.getStreamid().equals(rcl.getStreamid()));
if (!currentClient.getStreamid().equals(rcl.getStreamid())) {
((IServiceCapableConnection) conn).invoke("sendVarsToWhiteboardById", new Object[] { showDrawStatus ? currentClient : null, sendObject },this);
//log.debug("sending sendVarsToWhiteboard to " + conn + " rcl " + rcl);
numberOfUsers++;
}
}