Update values
This commit is contained in:
parent
9110fabfcf
commit
a9b87b625a
@ -3,7 +3,7 @@
|
||||
public enum BotType
|
||||
{
|
||||
assault = 1,
|
||||
pmcBot = 2,
|
||||
pmcbot = 2,
|
||||
marksman = 3,
|
||||
bossbully = 4,
|
||||
bossgluhar = 5,
|
||||
@ -24,12 +24,12 @@
|
||||
sectantpriest = 20,
|
||||
sectantwarrior = 21,
|
||||
usec = 22,
|
||||
exUsec = 23,
|
||||
exusec = 23,
|
||||
gifter = 24,
|
||||
bossknight = 25,
|
||||
followerbirdeye = 26,
|
||||
followerbigpipe = 27,
|
||||
bossZryachiy = 28,
|
||||
followerZryachiy = 29
|
||||
bosszryachiy = 28,
|
||||
followerzryachiy = 29
|
||||
}
|
||||
}
|
||||
|
@ -68,15 +68,14 @@ public static class BotParser
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!parsedBotsDict.ContainsKey(bot._id))
|
||||
if (parsedBotsDict.ContainsKey(bot._id))
|
||||
{
|
||||
parsedBotsDict.Add(bot._id, bot);
|
||||
}
|
||||
else
|
||||
{
|
||||
var existingBot = parsedBotsDict[bot._id];
|
||||
//var existingBot = parsedBotsDict[bot._id];
|
||||
dupeCount++;
|
||||
continue;
|
||||
}
|
||||
|
||||
parsedBotsDict.Add(bot._id, bot);
|
||||
}
|
||||
|
||||
totalDupeCount += dupeCount;
|
||||
|
31
Common/Extensions/ParallelExtensions.cs
Normal file
31
Common/Extensions/ParallelExtensions.cs
Normal file
@ -0,0 +1,31 @@
|
||||
using System.Collections.Concurrent;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Common.Extensions
|
||||
{
|
||||
public static class ParallelExtensions
|
||||
{
|
||||
public static Task ParallelForEachAsync<T>(this IEnumerable<T> source, int dop, Func<T, Task> body)
|
||||
{
|
||||
async Task AwaitPartition(IEnumerator<T> partition)
|
||||
{
|
||||
using (partition)
|
||||
{
|
||||
while (partition.MoveNext())
|
||||
{
|
||||
await Task.Yield(); // prevents a sync/hot thread hangup
|
||||
await body(partition.Current);
|
||||
}
|
||||
}
|
||||
}
|
||||
return Task.WhenAll(
|
||||
Partitioner
|
||||
.Create(source)
|
||||
.GetPartitions(dop)
|
||||
.AsParallel()
|
||||
.Select(p => AwaitPartition(p)));
|
||||
}
|
||||
}
|
||||
}
|
@ -180,7 +180,7 @@ namespace Generator
|
||||
if (name.Length > 1)
|
||||
{
|
||||
// Add lastnames to all bots except raiders
|
||||
if (botToUpdate.botType != BotType.pmcBot)
|
||||
if (botToUpdate.botType != BotType.pmcbot)
|
||||
{
|
||||
botToUpdate.lastName.AddUnique(name[1]);
|
||||
}
|
||||
|
@ -114,7 +114,7 @@ namespace Generator.Helpers.Gear
|
||||
case BotType.bosssanitar:
|
||||
botToUpdate.chances.mods["mod_scope"] = 100;
|
||||
break;
|
||||
case BotType.pmcBot:
|
||||
case BotType.pmcbot:
|
||||
botToUpdate.chances.mods["mod_stock"] = 100;
|
||||
break;
|
||||
case BotType.followerbully:
|
||||
@ -140,8 +140,10 @@ namespace Generator.Helpers.Gear
|
||||
botToUpdate.chances.mods["mod_scope"] = 100;
|
||||
botToUpdate.chances.mods["mod_stock"] = 100;
|
||||
break;
|
||||
case BotType.exUsec:
|
||||
case BotType.exusec:
|
||||
botToUpdate.chances.mods["mod_stock"] = 100;
|
||||
botToUpdate.chances.mods["mod_stock_000"] = 100;
|
||||
botToUpdate.chances.mods["mod_stock_001"] = 100;
|
||||
break;
|
||||
|
||||
}
|
||||
@ -243,7 +245,7 @@ namespace Generator.Helpers.Gear
|
||||
min = 0;
|
||||
max = 0;
|
||||
break;
|
||||
case BotType.exUsec:
|
||||
case BotType.exusec:
|
||||
min = 2;
|
||||
max = 4;
|
||||
break;
|
||||
|
@ -70,7 +70,7 @@ namespace Generator.Helpers.Gear
|
||||
{
|
||||
case BotType.assault:
|
||||
break;
|
||||
case BotType.pmcBot:
|
||||
case BotType.pmcbot:
|
||||
break;
|
||||
case BotType.marksman:
|
||||
break;
|
||||
|
Loading…
x
Reference in New Issue
Block a user