@Override
	public void onMessage(String strmsg) {
		//System.out.println(strmsg);
		// pos updates	
		try {
			JSONObject jsmsg = new JSONObject(strmsg);
			JSONObject data = jsmsg.getJSONObject("Data");
			switch(jsmsg.getInt("Type")) {
			case 1: //disconnection
				String discoUserName = data.getString("n");
				this.onlineUsers.remove(discoUserName);
				//System.out.println("Bot "+ this.botId +" : removed user " + discoUserName + " from local game state");
				break;

			case 2: //pos update
				this.numPosMsgReceived ++;
				JSONObject pos = data.getJSONObject("p");
				int t = pos.getInt("t");
				int l = pos.getInt("l");
				if(t == this.topToWatch && l == this.leftToWatch) { // msg tracked to determine client-to-client latency
					this.latency = (int) (System.currentTimeMillis() - this.latencyStart);
				}
				// add user to my local collection of users
				String coUserName2 = data.getString("n");
				if(! (this.onlineUsers.contains(coUserName2))) {
					this.onlineUsers.add(coUserName2);
					//System.out.println("Bot "+ this.botId +" : added user " + coUserName2 + " to local game state");
				}

				break;
			case 3: //on connect: list of all connected users
				JSONArray users = data.getJSONArray("Users");
				JSONObject user;
				String coUserName3;
				for(int i = 0; i < users.length(); i++) {
					user = users.getJSONObject(i);
					coUserName3 = user.getString("n");
					if(! (this.onlineUsers.contains(coUserName3))) {
						this.onlineUsers.add(coUserName3);
						//System.out.println("Bot "+ this.botId +" : added user " + coUserName3 + " to local game state");
					}
				}
				break;
			default:
				System.out.println("Error: Type in JSON msg was neither 1, 2, or 3");
			}
		} catch (JSONException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}		
	}