formatted code
This commit is contained in:
@@ -15,7 +15,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
public void OnFactionRanksEdit(Client player, string jsonData)
|
||||
{
|
||||
FactionRankHelper helper = JsonConvert.DeserializeObject<FactionRankHelper>(jsonData);
|
||||
using(var context = new DatabaseContext())
|
||||
using (var context = new DatabaseContext())
|
||||
{
|
||||
Entities.Faction f = context.Factions.FirstOrDefault(x => x.Id == helper.FactionId);
|
||||
if (f == null)
|
||||
@@ -31,10 +31,10 @@ namespace ReallifeGamemode.Server.Events
|
||||
|
||||
List<int> found = new List<int>();
|
||||
|
||||
for(int i = 0; i < ranks.Count; i++)
|
||||
for (int i = 0; i < ranks.Count; i++)
|
||||
{
|
||||
Rank newRank = ranks[i];
|
||||
if(newRank.Id == 0)
|
||||
if (newRank.Id == 0)
|
||||
{
|
||||
context.FactionRanks.Add(new FactionRank
|
||||
{
|
||||
@@ -52,9 +52,9 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
|
||||
for(int i = 0; i < factionRanks.Count; i++)
|
||||
for (int i = 0; i < factionRanks.Count; i++)
|
||||
{
|
||||
if(!found.Contains(factionRanks[i].Id))
|
||||
if (!found.Contains(factionRanks[i].Id))
|
||||
{
|
||||
context.FactionRanks.Remove(factionRanks[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user