<commit_before>/// <reference path="Photon/Photon-Javascript_SDK.d.ts"/> 
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};

var Languages = [
	"Unsupported",
	"Arabic",
	"Brazilian Portuguese",
	"Chinese Simplified",
	"Chinese Traditional",
	"Czech",
	"Danish",
	"Dutch",
	"English",
	"Finnish",
	"French",
	"German",
	"Hungarian",
	"Italian",
	"Japanese",
	"Korean",
	"LATAM Spanish",
	"Norwegian",
	"Polish",
	"Portuguese",
	"Russian",
	"Spanish",
	"Swedish",
	"Turkish",
	"Count"
];

var startRegion = "us";
var lobbyCount = 0;
var allLobbyCount = 0;
var lobbiesGotten = false;

var DemoWss = this["AppInfo"] && this["AppInfo"]["Wss"];
var DemoAppId = this["AppInfo"] && this["AppInfo"]["AppId"] ? this["AppInfo"]["AppId"] : "<no-app-id>";
var DemoAppVersion = this["AppInfo"] && this["AppInfo"]["AppVersion"] ? this["AppInfo"]["AppVersion"] : "1.0";
var DemoMasterServer = this["AppInfo"] && this["AppInfo"]["MasterServer"];
var DemoFbAppId = this["AppInfo"] && this["AppInfo"]["FbAppId"];
var ConnectOnStart = false;
var DemoLoadBalancing = (function (_super) {
    __extends(DemoLoadBalancing, _super);
    function DemoLoadBalancing() {
        _super.call(this, DemoWss ? Photon.ConnectionProtocol.Wss : Photon.ConnectionProtocol.Ws, DemoAppId, DemoAppVersion);
        this.logger = new Exitgames.Common.Logger("Demo:");
        this.logger.info("Init", this.getNameServerAddress(), DemoAppId, DemoAppVersion);
        this.setLogLevel(Exitgames.Common.Logger.Level.DEBUG);
    }
    DemoLoadBalancing.prototype.start = function () {
		this.connectOptions.lobbyName = "Lobo Lobby";
		this.connectOptions.lobbyType = 2;
		this.connectOptions.sqlLobbyFilter = "";
		this.connectToRegionMaster(startRegion);
    };
    DemoLoadBalancing.prototype.onError = function (errorCode, errorMsg) {
        this.output("Error " + errorCode + ": " + errorMsg);
    };

    DemoLoadBalancing.prototype.onRoomListUpdate = function (rooms, roomsUpdated, roomsAdded, roomsRemoved) {
        this.onRoomList(rooms);
    };
	
	DemoLoadBalancing.prototype.onStateChange = function (state) {
		var statusElem = document.getElementById("connectStatus");
		if (state == 5)
		{
			statusElem.innerHTML = "Connected";
			statusElem.style.color = "green";
		}
		else if (state > 0 && state < 10)
		{
			statusElem.innerHTML = "Connecting...";
			statusElem.style.color = "#757575";
		}
		else
		{
			statusElem.innerHTML = "Disconnected (Try refreshing)";
			statusElem.style.color = "red";
		}
	};
	
    DemoLoadBalancing.prototype.onRoomList = function (roomInfos) {
		lobbiesGotten = true;
		var rooms = [];
		lobbyCount = roomInfos.length;
		if (roomInfos.length > 0)
		{
			for (var i = 0; i < roomInfos.length; i++) {
				var spectatorString = "";
				if (roomInfos[i].playerCount > 8)
				{
					spectatorString = " (+" + (roomInfos[i].playerCount - 8) + ")";
					roomInfos[i].playerCount = 8;
				}
				
				var room = {
					"Name": roomInfos[i].name.split("-")[0],
					"Players": roomInfos[i].playerCount + "/8" + spectatorString,
					"Language": Languages[roomInfos[i].getCustomProperty("C0")]
				};
				rooms.push(room);
			}
		}
		else
		{
			var room = {
				"Name": "No servers...",
				"Players": "",
				"Language": ""
			};
			rooms.push(room);
		}
		
		var col = [];
		for (var i = 0; i < rooms.length; i++) {
			for (var key in rooms[i]) {
				if (col.indexOf(key) === -1) {
					col.push(key);
				}
			}
		}

		var table = document.createElement("table");<commit_msg>Changed "Players" to use the provided NumPlayers and NumSpectator to be more accurate.<commit_after>/// <reference path="Photon/Photon-Javascript_SDK.d.ts"/> 
var __extends = (this && this.__extends) || function (d, b) {
    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
    function __() { this.constructor = d; }
    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};

var Languages = [
	"Unsupported",
	"Arabic",
	"Brazilian Portuguese",
	"Chinese Simplified",
	"Chinese Traditional",
	"Czech",
	"Danish",
	"Dutch",
	"English",
	"Finnish",
	"French",
	"German",
	"Hungarian",
	"Italian",
	"Japanese",
	"Korean",
	"LATAM Spanish",
	"Norwegian",
	"Polish",
	"Portuguese",
	"Russian",
	"Spanish",
	"Swedish",
	"Turkish",
	"Count"
];

var startRegion = "us";
var lobbyCount = 0;
var allLobbyCount = 0;
var lobbiesGotten = false;

var DemoWss = this["AppInfo"] && this["AppInfo"]["Wss"];
var DemoAppId = this["AppInfo"] && this["AppInfo"]["AppId"] ? this["AppInfo"]["AppId"] : "<no-app-id>";
var DemoAppVersion = this["AppInfo"] && this["AppInfo"]["AppVersion"] ? this["AppInfo"]["AppVersion"] : "1.0";
var DemoMasterServer = this["AppInfo"] && this["AppInfo"]["MasterServer"];
var DemoFbAppId = this["AppInfo"] && this["AppInfo"]["FbAppId"];
var ConnectOnStart = false;
var DemoLoadBalancing = (function (_super) {
    __extends(DemoLoadBalancing, _super);
    function DemoLoadBalancing() {
        _super.call(this, DemoWss ? Photon.ConnectionProtocol.Wss : Photon.ConnectionProtocol.Ws, DemoAppId, DemoAppVersion);
        this.logger = new Exitgames.Common.Logger("Demo:");
        this.logger.info("Init", this.getNameServerAddress(), DemoAppId, DemoAppVersion);
        this.setLogLevel(Exitgames.Common.Logger.Level.DEBUG);
    }
    DemoLoadBalancing.prototype.start = function () {
		this.connectOptions.lobbyName = "Lobo Lobby";
		this.connectOptions.lobbyType = 2;
		this.connectOptions.sqlLobbyFilter = "";
		this.connectToRegionMaster(startRegion);
    };
    DemoLoadBalancing.prototype.onError = function (errorCode, errorMsg) {
        this.output("Error " + errorCode + ": " + errorMsg);
    };

    DemoLoadBalancing.prototype.onRoomListUpdate = function (rooms, roomsUpdated, roomsAdded, roomsRemoved) {
        this.onRoomList(rooms);
    };
	
	DemoLoadBalancing.prototype.onStateChange = function (state) {
		var statusElem = document.getElementById("connectStatus");
		if (state == 5)
		{
			statusElem.innerHTML = "Connected";
			statusElem.style.color = "green";
		}
		else if (state > 0 && state < 10)
		{
			statusElem.innerHTML = "Connecting...";
			statusElem.style.color = "#757575";
		}
		else
		{
			statusElem.innerHTML = "Disconnected (Try refreshing)";
			statusElem.style.color = "red";
		}
	};
	
    DemoLoadBalancing.prototype.onRoomList = function (roomInfos) {
		lobbiesGotten = true;
		var rooms = [];
		lobbyCount = roomInfos.length;
		if (roomInfos.length > 0)
		{
			for (var i = 0; i < roomInfos.length; i++) {
				var spectatorString = "";
				var spectatorCount = roomInfos[i].getCustomProperty("C6");
				if (spectatorCount > 0)
				{
					spectatorString = " (+" + spectatorCount + ")";
				}
				
				var room = {
					"Name": roomInfos[i].name.split("-")[0],
					"Players": roomInfos[i].getCustomProperty("C1") + "/8" + spectatorString,
					"Language": Languages[roomInfos[i].getCustomProperty("C0")]
				};
				rooms.push(room);
			}
		}
		else
		{
			var room = {
				"Name": "No servers...",
				"Players": "",
				"Language": ""
			};
			rooms.push(room);
		}
		
		var col = [];
		for (var i = 0; i < rooms.length; i++) {
			for (var key in rooms[i]) {
				if (col.indexOf(key) === -1) {
					col.push(key);
				}
			}
		}

		var table = document.createElement("table");
{'fraction_non_alphanumeric': 0.17326002413839345, 'fraction_numerical': 0.006705109293281481, 'mean_word_length': 3.735238095238095, 'pattern_counts': {'":': 14, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '541027', 'n_tokens_mistral': 2934, 'n_tokens_neox': 2599, 'n_words': 499}