This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* Check if a user can perform an action (with its value in "flag") of a specific roleset (named with "roleset".) | |
* Optionally, may check for if the user is a superadmin (with "shouldWeCareIfThisUserIsSuperadmin") as if the user | |
* is a superadmin, this function will return true no matter what since superadmins have every permission. | |
*/ | |
bool may(string roleset, string flag, bool shouldWeCareIfThisUserIsSuperadmin) { | |
// (1). Because users that are superadmin has every permission regardless of their roleset permission, check for that. | |
if (!shouldWeCareIfThisUserIsSuperadmin && this.isSuperAdmin()) { | |
return true; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// null values can be anything | |
let envelope = { | |
"Mode": "GameServer", | |
"Settings": { | |
"PlaceId": placeId, | |
"PlaceFetchUrl": `http://${domain}/${null}/`, | |
"UniverseId": universeId, | |
"MatchmakingContextId": 1, | |
"CreatorId": userId, | |
"CreatorType": "User", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Drawing; | |
class NameColors | |
{ | |
private static Color[] BasePalette = { | |
Color.FromArgb(107, 50, 124), | |
Color.FromArgb(218, 133, 65), | |
Color.FromArgb(245, 205, 48), | |
Color.FromArgb(232, 186, 200), |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var basePalette = [ | |
{ "r": 107, "g": 50, "b": 124 }, | |
{ "r": 218, "g": 133, "b": 65 }, | |
{ "r": 245, "g": 205, "b": 48 }, | |
{ "r": 232, "g": 186, "b": 200 }, | |
{ "r": 215, "g": 197, "b": 154 } | |
] | |
var modernPalette = [ | |
{ "r": 253, "g": 41, "b": 67 }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const rcctalk = require("rcctalk") | |
const path = require("path") | |
const uuid = require("uuid") | |
// If you omit the WSDL, then rcctalk will assume that the RCCService instance is a RCCService from 2018 or higher that does not use SOAP and instead uses the newer JSON format. | |
var client = rcctalk.connect({ ip: "127.0.0.1", port: 64989, wsdl: path.join(__dirname, "RCCServiceSoap.wsdl") }) | |
/* HelloWorld */ | |
if (await client.hello() != "Hello World") { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
gfx.font_rendering.cleartype_params.enhanced_contrast = 0 | |
gfx.font_rendering.cleartype_params.rendering_mode = 5 | |
gfx.font_rendering.cleartype_params.force_gdi_classic_for_families = "" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// See: https://en.wikipedia.org/wiki/MD5#Collision_vulnerabilities | |
$x = "d131dd02c5e6eec4693d9a0698aff95c2fcab58712467eab4004583eb8fb7f8955ad340609f4b30283e488832571415a085125e8f7cdc99fd91dbdf280373c5bd8823e3156348f5bae6dacd436c919c6dd53e2b487da03fd02396306d248cda0e99f33420f577ee8ce54b67080a80d1ec69821bcb6a8839396f9652b6ff72a70"; | |
$y = "d131dd02c5e6eec4693d9a0698aff95c2fcab50712467eab4004583eb8fb7f8955ad340609f4b30283e4888325f1415a085125e8f7cdc99fd91dbd7280373c5bd8823e3156348f5bae6dacd436c919c6dd53e23487da03fd02396306d248cda0e99f33420f577ee8ce54b67080280d1ec69821bcb6a8839396f965ab6ff72a70"; | |
$x = hex2bin($x); | |
$y = hex2bin($y); | |
echo("MD5 Hash of X: " . md5($x) . "\n"); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require("fs") | |
const crypto = require("crypto") | |
const folder = "./Sort" | |
const files = fs.readdirSync(folder) | |
for (var i = 0; i < files.length; i++) { | |
let oldname = files[i] | |
let newname = ((crypto.randomBytes(16).toString("hex")) + "." + (oldname.substring(oldname.lastIndexOf(".") + 1))) | |
fs.rename(`${folder}/${oldname}`, `${folder}/${newname}`, (error) => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function parse_response_headers($headers) | |
{ | |
$head = []; | |
foreach ($headers as $key => $value) | |
{ | |
$type = explode(":", $value, 2); | |
if (isset($type[1])) | |
{ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function lua_mod($a, $b) | |
{ | |
return ($a - floor($a / $b) * $b); | |
} | |
function compute_name_color($name, $modern_colors = true) | |
{ | |
$base_palette = [ | |
[ "R" => 107, "G" => 50, "B" => 124 ], |
NewerOlder