i++;
}
// 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);
}
// 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);
boolean showDrawStatus = getWhiteboardDrawStatus();
// 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) {
if (conn.getClient().getId()
.equals(current.getClient().getId())) {
continue;
}
RoomClient rcl = this.clientListManager
.getSyncClientByStreamId(conn.getClient()
.getId());
if (rcl == null) {
continue;
}
if (!currentClient.getStreamid().equals(
rcl.getStreamid())) {
((IServiceCapableConnection) conn).invoke(
"sendVarsToWhiteboardById",
new Object[] {
showDrawStatus ? currentClient
: null, sendObject },