<commit_before><?php
/**
 * This code is free software; you can redistribute it and/or modify it under
 * the terms of the new BSD License.
 *
 * @author     <NAME>
 * @license    http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @package    Steam Condenser (PHP)
 * @subpackage Packets
 */

require_once STEAM_CONDENSER_PATH . 'steam/packets/S2A_INFO_BasePacket.php';

/**
 * @package Steam Condenser (PHP)
 * @subpackage Packets
 */
class S2A_INFO2_Packet extends S2A_INFO_BasePacket
{
	/**
	 *
	 */
	public function __construct($data)
	{
		parent::__construct(SteamPacket::S2A_INFO2_HEADER, $data);

		$this->networkVersion = $this->contentData->getByte();
		$this->serverName = $this->contentData->getString();
		$this->mapName = $this->contentData->getString();
		$this->gameDir = $this->contentData->getString();
		$this->gameDesc = $this->contentData->getString();
		$this->appId = $this->contentData->getShort();
		$this->playerNumber = $this->contentData->getByte();
		$this->maxPlayers = $this->contentData->getByte();
		$this->botNumber = $this->contentData->getByte();
		$this->dedicated = chr($this->contentData->getByte());
		$this->operatingSystem = chr($this->contentData->getByte());
		$this->passwordProtected = $this->contentData->getByte() == 1;
		$this->secureServer = $this->contentData->getByte() == 1;
		$this->gameVersion = $this->contentData->getString();

		if($this->contentData->remaining() > 0)
		{
			$extraDataFlag = $this->contentData->getByte();
			 
			if($extraDataFlag & 0x80)
			{
				$this->serverPort = $this->contentData->getShort();
			}

            if($extraDataFlag & 0x10) {
                $this->serverId = $this->contentData->getLong() | ($this->contentData->getLong() << 32);
            }

			if($extraDataFlag & 0x40)
			{
				$this->tvPort = $this->contentData->getShort();
				$this->tvName = $this->contentData->getString();
			}
			 
			if($extraDataFlag & 0x20)
			{
				$this->serverTags = $this->contentData->getString();
			}
		}
	}
}
?>
<commit_msg>PHP: Server IDs should be unsigned<commit_after><?php
/**
 * This code is free software; you can redistribute it and/or modify it under
 * the terms of the new BSD License.
 *
 * @author     <NAME>
 * @license    http://www.opensource.org/licenses/bsd-license.php New BSD License
 * @package    Steam Condenser (PHP)
 * @subpackage Packets
 */

require_once STEAM_CONDENSER_PATH . 'steam/packets/S2A_INFO_BasePacket.php';

/**
 * @package Steam Condenser (PHP)
 * @subpackage Packets
 */
class S2A_INFO2_Packet extends S2A_INFO_BasePacket
{
	/**
	 *
	 */
	public function __construct($data)
	{
		parent::__construct(SteamPacket::S2A_INFO2_HEADER, $data);

		$this->networkVersion = $this->contentData->getByte();
		$this->serverName = $this->contentData->getString();
		$this->mapName = $this->contentData->getString();
		$this->gameDir = $this->contentData->getString();
		$this->gameDesc = $this->contentData->getString();
		$this->appId = $this->contentData->getShort();
		$this->playerNumber = $this->contentData->getByte();
		$this->maxPlayers = $this->contentData->getByte();
		$this->botNumber = $this->contentData->getByte();
		$this->dedicated = chr($this->contentData->getByte());
		$this->operatingSystem = chr($this->contentData->getByte());
		$this->passwordProtected = $this->contentData->getByte() == 1;
		$this->secureServer = $this->contentData->getByte() == 1;
		$this->gameVersion = $this->contentData->getString();

		if($this->contentData->remaining() > 0)
		{
			$extraDataFlag = $this->contentData->getByte();

			if($extraDataFlag & 0x80)
			{
				$this->serverPort = $this->contentData->getShort();
			}

            if($extraDataFlag & 0x10) {
                $this->serverId = $this->contentData->getUnsignedLong() | ($this->contentData->getUnsignedLong() << 32);
            }

			if($extraDataFlag & 0x40)
			{
				$this->tvPort = $this->contentData->getShort();
				$this->tvName = $this->contentData->getString();
			}

			if($extraDataFlag & 0x20)
			{
				$this->serverTags = $this->contentData->getString();
			}
		}
	}
}
?>

{'fraction_non_alphanumeric': 0.18268525311812178, 'fraction_numerical': 0.011249694301785278, 'mean_word_length': 3.9158653846153846, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 135, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3001235', 'n_tokens_mistral': 1500, 'n_tokens_neox': 1352, 'n_words': 217}