public boolean receivedUDP(ByteBuffer lbuf, String gamenameFilter, List<Integer> portFilter) {
		if(buf == null || udpSocket == null) {
			return false;
		}
		
		buf.clear(); //use buf to create our own packet
		lbuf.order(ByteOrder.LITTLE_ENDIAN);
		buf.order(ByteOrder.LITTLE_ENDIAN);

		lbuf.getShort(); //ignore header because this is from server directly
		lbuf.getShort(); //also ignore length

		buf.put((byte) 247); //W3GS
		buf.put((byte) 48); //GAMEINFO
		buf.putShort((short) 0); //packet size; do later

		byte[] addr = new byte[4];
		lbuf.get(addr); //lbuf is special packet that includes IP address (not in W3GS GAMEINFO but used for wc3connect)
		
		int productid = lbuf.getInt();
		buf.putInt(productid); //product ID
		lbuf.getInt(); //ignore version in packet
		buf.putInt(war3version); //version
		
		int hostCounter = lbuf.getInt(); //hostcounter
		buf.putInt(counter); //replace hostcounter with uid
		
		buf.putInt(lbuf.getInt()); //unknown

		String gamename = WCUtil.getTerminatedString(lbuf);
		
		//filter by gamename if desired
		if(gamenameFilter != null && gamenameFilter.length() > 4 && !gamename.contains(gamenameFilter)) {
			return false;
		}
		
		byte[] bytes = WCUtil.strToBytes(gamename);
		buf.put(bytes);
		buf.put((byte) 0); //null terminator

		buf.put(lbuf.get()); //unknown

		byte[] array = WCUtil.getTerminatedArray(lbuf);
		buf.put(array); //StatString
		buf.put((byte) 0); //null terminator
		
		buf.putInt(lbuf.getInt()); //slots total
		buf.putInt(lbuf.getInt()); //game type
		buf.putInt(lbuf.getInt()); //unknown
		buf.putInt(lbuf.getInt()); //slots open
		buf.putInt(lbuf.getInt()); //up time

		//get the sender's port, but use our own server's port
		int senderPort = WCUtil.unsignedShort(lbuf.getShort());
		buf.putShort((short) serverPort); //port
		
		//filter by port if desired
		if(portFilter != null && !portFilter.contains(senderPort)) {
			return false;
		}

		//assign length in little endian
		int length = buf.position();
		buf.putShort(2, (short) length);

		//get bytes
		byte[] packetBytes = new byte[length];
		buf.position(0);
		buf.get(packetBytes);
		
		//create new gameinfo
		GameInfo game = new GameInfo(counter++, addr, senderPort, hostCounter);
		
		synchronized(games) {
			games.add(game);
		}

		//cache the packet to later send on flush call
		main.log("[WCHost] Broadcasting with gamename [" + gamename + "]; version: " + war3version +
				"; productid: " + productid + "; senderport: " + senderPort);
		udpCached.add(packetBytes);
		
		return true;
	}