System.err.println("Room tuple not found");
System.err.println("No users in room: " + roomUrl);
    public void eventReceived(SienaObject e) {	String fromComponent = e.getFromComponent();	String method = e.getMethod();	System.err.println("ET New Events Received.");	System.err.println("from_component: " + fromComponent );	System.err.println("method: " + method);	String protocol = e.getProtocol();	String data = e.getData();	System.err.println("$$$$$$$$$$$$$$$$$$$The Data sent is: " + data);	StringTokenizer st = new StringTokenizer(data," ");	// client Call	if (fromComponent.equals("client")) {	    // method: c_connect	    if (method.equals("c_connect")) {		System.err.println("METHOD CALL: CLIENT.C_CONNECT");	       if (st.countTokens() < 3)		   return;	       st.nextToken();	       String user = st.nextToken();	       addRoomTuple("default", user);	       System.err.println("END OF METHOD CALL PROCESS.");	    }	    // method: c_moveObject	    else if (method.equals("c_moveObject")) {		System.err.println("METHOD CALL: CLIENT.C_MOVEOBJECT");		if (st.countTokens() < 5) {			System.err.println("Not enough tokens supplied to c_moveObject");		    return;		}		String roomUrl = st.nextToken();		String url = st.nextToken();		double x = 0;		double y = 0;		double z = 0;		try {		    x = Double.parseDouble(st.nextToken());		    y = Double.parseDouble(st.nextToken());		    z = Double.parseDouble(st.nextToken());		} catch (Exception ex) {		    System.err.println(ex);		}		addMovementTuple(roomUrl, url, 0, 0, 0, x, y, z);		// propagate the info		e.setFromComponent("event_tracer");		e.setMethod("s_moveObject");		try {		    Vector v = findRoomTuple(roomUrl);		    if (v == null) {				System.err.println("Room tuple not found");				return;			}			//commenting this out... no need to publish for every user to see		    //for (int idx=0; idx < v.size(); idx++) {			//e.setUsername(((RoomTuple)(v.elementAt(idx))).getUser());			e.publish();		} catch (Exception ex) {		    System.err.println(ex);		    return;		}		System.err.println("END OF METHOD CALL PROCESS.");	    }	    // method: c_enteredRoom	    else if (method.equals("c_enteredRoom")) {		System.err.println("METHOD CALL: CLIENT.C_ENTEREDROOM");		if (st.countTokens() < 2)		    return;		String user = st.nextToken();		String roomUrl = st.nextToken();		// notify users in the old room		String oldRoom = null;		Vector v = null;		String roommate;		oldRoom = findUserRoom(user);		if (oldRoom != null && !oldRoom.equals("default")) {		    v = findRoomTuple(oldRoom);		    e.setMethod("s_leftRoom");		    try {			if (v!=null) {			    for (int idx=0; idx<v.size(); idx++) {				roommate = ((RoomTuple)v.elementAt(idx)).getUser();				if (!roommate.equals(user)) {				    e.setUsername(roommate);				    e.setData(user + " " + oldRoom);				    e.publish();				}			    }			}		    } catch (Exception ex) {			System.err.println(ex);			return;		    }		}		// add user to the new room		addRoomTuple(roomUrl, user);		// notify the new user about its roommates		// notify the roomates about the new user		v = null;		roommate = null;		v = findRoomTuple(roomUrl);		e.setMethod("s_enteredRoom");		try {		    if (v!=null) {			for (int idx=0; idx<v.size(); idx++) {			    roommate = ((RoomTuple)v.elementAt(idx)).getUser();			    if (!roommate.equals(user)) {				e.setUsername(roommate);				e.setData(user + " " + roomUrl);				e.publish();				e.setUsername(user);				e.setData(roommate + " " + roomUrl);				e.publish();			    }			}		    }		} catch (Exception ex) {		    System.err.println(ex);		    return;		}		System.err.println("END OF METHOD CALL PROCESS.");	    }	    // method: c_subscribeRoom	    else if (method.equals("c_subscribeRoom")) {		System.err.println("METHOD CALL: CLIENT.C_SUBSCRIBEROOM");	    	if (st.countTokens() < 2)		    return;		String user = st.nextToken();		String roomUrl = st.nextToken();		// add user to the new room		addRoomTuple(roomUrl, user);		System.err.println("END OF METHOD CALL PROCESS.");	    }	    // method: s_leftRoom	    else if (method.equals("c_leftRoom")) {		System.err.println("METHOD CALL: CLIENT.C_LEFTROOM");		if (st.countTokens() < 2)		    return;		String user = st.nextToken();		String roomUrl = st.nextToken();		// notify users in the old room		String oldRoom = null;		Vector v = null;		String roommate;		oldRoom = findUserRoom(user);		if (oldRoom != null && !oldRoom.equals("default")) {		    v = findRoomTuple(oldRoom);		    e.setMethod("s_leftRoom");		    try {			if (v!=null) {			    for (int idx=0; idx<v.size(); idx++) {				roommate = ((RoomTuple)v.elementAt(idx)).getUser();				if (!roommate.equals(user)) {				    e.setUsername(roommate);				    e.setData(user + " " + oldRoom);				    e.publish();				}			    }			}		    } catch (Exception ex) {			System.err.println(ex);			return;		    }		}		System.err.println("END OF METHOD CALL PROCESS.");	    }	    // method: c_unsubscribeRoom	    else if (method.equals("c_unsubscribeRoom")) {		System.err.println("METHOD CALL: CLIENT.C_UNSUBSCRIBEROOM");	    	if (st.countTokens() < 2)		    return;		String user = st.nextToken();		String roomUrl = st.nextToken();		// remove user from the old room		removeUser(roomUrl, user);		System.err.println("END OF METHOD CALL PROCESS.");	    }	    // method: c_disconnect	    else if (method.equals("c_disconnect")) {		System.err.println("METHOD CALL: CLIENT.C_DISCONNECT");		if (st.countTokens() < 1)		    return;		String user = st.nextToken();		// notify users in the old room		String oldRoom = null;		Vector v = null;		String roommate;		oldRoom = findUserRoom(user);		if (oldRoom != null && !oldRoom.equals("default")) {		    v = findRoomTuple(oldRoom);		    e.setMethod("s_leaveRoom");		    try {			if (v!=null) {			    for (int idx=0; idx<v.size(); idx++) {				roommate = ((RoomTuple)v.elementAt(idx)).getUser();				if (!roommate.equals(user)) {				    e.setUsername(roommate);				e.setData(user + " " + oldRoom);				e.publish();				}			    }			}		    } catch (Exception ex) {			System.err.println(ex);			return;		    }		}		// remove user from the old room		removeUser(user);		System.err.println("END OF METHOD CALL PROCESS.");	    }	    else if (method.equals("c_moveUser")) {			System.err.println("METHOD CALL: CLIENT.C_MOVEUSER");				if (st.countTokens() < 5) {					System.err.println("Not enough args");					return;				}			String roomUrl = st.nextToken();			String user = st.nextToken();			double x = 0;			double y = 0;			double z = 0;			try {			    x = Double.parseDouble(st.nextToken());			    y = Double.parseDouble(st.nextToken());			    z = Double.parseDouble(st.nextToken());			} catch (Exception ex) {			    System.err.println(ex);			}			addMovementTuple(roomUrl, user, 0, 0, 0, x, y, z);			// propagate the info			e.setFromComponent("event_tracer");			e.setMethod("s_moveUser");			try {			    Vector v = findRoomTuple(roomUrl);			    if (v == null) {					System.err.println("Room tuple not found");					return;				}				e.publish();			} catch (Exception ex) {			    System.err.println(ex);			    return;			}			System.err.println("END OF METHOD CALL PROCESS.");	    }	}    }