@Override
	public boolean handleEvent(ERGameEvent e, WrappedClient<ERGameEvent> source) {
		switch(e.eventType){
			case (ERGameEvent.EVENT_MESSAGE_C):
				String msg = (String) e.data[0];
			
				//if a command, parse it
				if(msg.charAt(0)=='\\'){
					parseChatCommand(msg);
				}
				//else do not
				else{
					network.dispatchEvent(ERGameEvent.EventMessage( objects.get(source.identifier).name , msg ));
				}
				return true;
				
			case (ERGameEvent.EVENT_UPDATE_C):
				float newx = (Float)(e.data[0]), //new destination x
					newy = (Float)(e.data[1]);//new destination y
				
				//limit motion requests to bounds of stage.
				if(newx<0){
					newx=0;
				} else if(newx>roomWidth){
					newx=roomWidth;
				}
				
				if(newy<0){
					newy=0;
				} else if(newy>roomHeight){
					newy=roomHeight;
				}
				
				this.objects.get(source.identifier).destx=newx;
				this.objects.get(source.identifier).desty=newy;
				network.dispatchEvent( ERGameEvent.EventUpdate( this.objects.get(source.identifier) ) );
				return true;
				
			case (ERGameEvent.EVENT_INTERACT_C):
				int targetID = (Integer) e.data[0];
				//if not in range, walk to object
				if( objects.get(source.identifier).getDistance( objects.get(targetID) ) > interactRange){
					objects.get(source.identifier).destx= objects.get(targetID).x;
					objects.get(source.identifier).destx= objects.get(targetID).y;
				}
				//otherwise, allow interaction to happen
				else{
					network.dispatchEvent(ERGameEvent.EventInteract(source.identifier, targetID));
				}
				return true;
			
			default:
				return false;
		}
	}