@Override
	public int joinRoom(String roomName, short roomKind) throws RemoteException {
		// TODO Auto-generated method stub
		String check="";
		int roomID=-1;
		int i;
		for(i=0;i<rooms.size();i++)
		{
			check=(String) rooms.get(i).get(0);
			if(check.equals(roomName)==true)
			{
				roomID=i;
				i=rooms.size();
			}
		}
		if(roomID==-1)
		{
			if(roomKind==0)
			{
				for(i=0;i<rooms.size();i++)
				{
					String[] pseudos=roomName.split("privatechatwith");
					check=(String) rooms.get(i).get(0);
					if(check.startsWith(pseudos[1])==true && check.endsWith(pseudos[0])==true)
					{
						roomID=i;
						i=rooms.size();
					}
				}
			}
			if(roomID==-1)
			{
				rooms.add(new ArrayList<String>());
				rooms.get(i).add(roomName);
				roomID=i;
				if(roomKind==1)
				{
					publicRoomsName.add(roomName);
				}
				System.out.println("New room created : "+roomName+" with ID : "+roomID);
			}
		}
		return roomID;
	}