mirror of
https://github.com/openbullet/openbullet.git
synced 2023-10-21 07:33:42 -05:00
Fixed same random number generation on different bots and runners.
This commit is contained in:
@@ -617,7 +617,7 @@ namespace RuriLib
|
||||
break;
|
||||
|
||||
case Function.RandomNum:
|
||||
outputString = (data.rand.Next(randomMin, randomMax)).ToString();
|
||||
outputString = (data.Random.Next(randomMin, randomMax)).ToString();
|
||||
break;
|
||||
|
||||
case Function.RandomString:
|
||||
@@ -634,21 +634,21 @@ namespace RuriLib
|
||||
outputString = localInputString;
|
||||
while (reserved.Any(r => outputString.Contains(r))){
|
||||
if (outputString.Contains("?l"))
|
||||
outputString = ReplaceFirst(outputString, "?l", lowercase[data.rand.Next(0, lowercase.Length)].ToString());
|
||||
outputString = ReplaceFirst(outputString, "?l", lowercase[data.Random.Next(0, lowercase.Length)].ToString());
|
||||
else if (outputString.Contains("?u"))
|
||||
outputString = ReplaceFirst(outputString, "?u", uppercase[data.rand.Next(0, uppercase.Length)].ToString());
|
||||
outputString = ReplaceFirst(outputString, "?u", uppercase[data.Random.Next(0, uppercase.Length)].ToString());
|
||||
else if (outputString.Contains("?d"))
|
||||
outputString = ReplaceFirst(outputString, "?d", digits[data.rand.Next(0, digits.Length)].ToString());
|
||||
outputString = ReplaceFirst(outputString, "?d", digits[data.Random.Next(0, digits.Length)].ToString());
|
||||
else if (outputString.Contains("?s"))
|
||||
outputString = ReplaceFirst(outputString, "?s", symbols[data.rand.Next(0, symbols.Length)].ToString());
|
||||
outputString = ReplaceFirst(outputString, "?s", symbols[data.Random.Next(0, symbols.Length)].ToString());
|
||||
else if (outputString.Contains("?h"))
|
||||
outputString = ReplaceFirst(outputString, "?h", hex[data.rand.Next(0, hex.Length)].ToString());
|
||||
outputString = ReplaceFirst(outputString, "?h", hex[data.Random.Next(0, hex.Length)].ToString());
|
||||
else if (outputString.Contains("?a"))
|
||||
outputString = ReplaceFirst(outputString, "?a", allchars[data.rand.Next(0, allchars.Length)].ToString());
|
||||
outputString = ReplaceFirst(outputString, "?a", allchars[data.Random.Next(0, allchars.Length)].ToString());
|
||||
else if (outputString.Contains("?m"))
|
||||
outputString = ReplaceFirst(outputString, "?m", udchars[data.rand.Next(0, udchars.Length)].ToString());
|
||||
outputString = ReplaceFirst(outputString, "?m", udchars[data.Random.Next(0, udchars.Length)].ToString());
|
||||
else if (outputString.Contains("?i"))
|
||||
outputString = ReplaceFirst(outputString, "?i", ludchars[data.rand.Next(0, ludchars.Length)].ToString());
|
||||
outputString = ReplaceFirst(outputString, "?i", ludchars[data.Random.Next(0, ludchars.Length)].ToString());
|
||||
|
||||
}
|
||||
break;
|
||||
@@ -711,7 +711,7 @@ namespace RuriLib
|
||||
break;
|
||||
|
||||
case Function.GetRandomUA:
|
||||
outputString = RandomUserAgent(data.rand);
|
||||
outputString = RandomUserAgent(data.Random);
|
||||
break;
|
||||
|
||||
case Function.AESEncrypt:
|
||||
|
||||
@@ -408,7 +408,7 @@ namespace RuriLib
|
||||
if (encodeContent)
|
||||
{
|
||||
// Very dirty but it works
|
||||
var nonce = data.rand.Next(1000000, 9999999);
|
||||
var nonce = data.Random.Next(1000000, 9999999);
|
||||
pData = pData.Replace("&", $"{nonce}&{nonce}").Replace("=", $"{nonce}={nonce}");
|
||||
pData = System.Uri.EscapeDataString(pData).Replace($"{nonce}%26{nonce}", "&").Replace($"{nonce}%3D{nonce}", "=");
|
||||
}
|
||||
|
||||
@@ -497,7 +497,7 @@ namespace RuriLib
|
||||
break;
|
||||
|
||||
case ListAction.Random:
|
||||
data.Variables.Set(new CVar(variableName, list[data.rand.Next(list.Count)], isCapture));
|
||||
data.Variables.Set(new CVar(variableName, list[data.Random.Next(list.Count)], isCapture));
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace RuriLib
|
||||
.Select(ext => Directory.GetCurrentDirectory() + "\\ChromeExtensions\\" + ext));
|
||||
if (data.ConfigSettings.DisableNotifications) chromeop.AddArgument("--disable-notifications");
|
||||
if (data.ConfigSettings.CustomCMDArgs != "") chromeop.AddArgument(data.ConfigSettings.CustomCMDArgs);
|
||||
if (data.ConfigSettings.RandomUA) chromeop.AddArgument("--user-agent=" + BlockFunction.RandomUserAgent(data.rand));
|
||||
if (data.ConfigSettings.RandomUA) chromeop.AddArgument("--user-agent=" + BlockFunction.RandomUserAgent(data.Random));
|
||||
else if (data.ConfigSettings.CustomUserAgent != "") chromeop.AddArgument("--user-agent=" + data.ConfigSettings.CustomUserAgent);
|
||||
|
||||
if (data.UseProxies) chromeop.AddArgument("--proxy-server=" + data.Proxy.Type.ToString().ToLower() + "://" + data.Proxy.Proxy);
|
||||
@@ -346,7 +346,7 @@ namespace RuriLib
|
||||
if (data.GlobalSettings.Selenium.Headless || data.ConfigSettings.ForceHeadless) fireop.AddArgument("--headless");
|
||||
if (data.ConfigSettings.DisableNotifications) fireprofile.SetPreference("dom.webnotifications.enabled", false);
|
||||
if (data.ConfigSettings.CustomCMDArgs != "") fireop.AddArgument(data.ConfigSettings.CustomCMDArgs);
|
||||
if (data.ConfigSettings.RandomUA) fireprofile.SetPreference("general.useragent.override", BlockFunction.RandomUserAgent(data.rand));
|
||||
if (data.ConfigSettings.RandomUA) fireprofile.SetPreference("general.useragent.override", BlockFunction.RandomUserAgent(data.Random));
|
||||
else if (data.ConfigSettings.CustomUserAgent != "") fireprofile.SetPreference("general.useragent.override", data.ConfigSettings.CustomUserAgent);
|
||||
|
||||
if (data.UseProxies)
|
||||
|
||||
Reference in New Issue
Block a user