Fix ChatService.BroadcastFaction(string, List<int>)
This commit is contained in:
@@ -2,6 +2,7 @@
|
|||||||
using ReallifeGamemode.Server.Entities;
|
using ReallifeGamemode.Server.Entities;
|
||||||
using ReallifeGamemode.Server.Extensions;
|
using ReallifeGamemode.Server.Extensions;
|
||||||
using ReallifeGamemode.Server.Job;
|
using ReallifeGamemode.Server.Job;
|
||||||
|
using ReallifeGamemode.Server.Models;
|
||||||
using ReallifeGamemode.Server.Util;
|
using ReallifeGamemode.Server.Util;
|
||||||
using System;
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
@@ -105,9 +106,12 @@ namespace ReallifeGamemode.Server.Services
|
|||||||
job.GetUsersInJob().ForEach(c => ChatService.SendMessage(c, message));
|
job.GetUsersInJob().ForEach(c => ChatService.SendMessage(c, message));
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static void BroadcastFaction(string v, List<int> list)
|
internal static void BroadcastFaction(string message, List<int> factionIds)
|
||||||
{
|
{
|
||||||
throw new NotImplementedException();
|
using(var dbContext = new DatabaseContext())
|
||||||
|
{
|
||||||
|
BroadcastFaction(message, dbContext.Factions.Where(f => factionIds.Contains(f.Id)).ToList());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -42,18 +42,17 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
{
|
{
|
||||||
if (cop.GetData<bool>("duty") && copClient.Position.DistanceTo2D(client.Position) <= 200 && (!copClient.HasData("isDead") || copClient.GetData("isDead") != true))
|
if (cop.GetData<bool>("duty") && copClient.Position.DistanceTo2D(client.Position) <= 200 && (!copClient.HasData("isDead") || copClient.GetData("isDead") != true))
|
||||||
{
|
{
|
||||||
|
int jailTime = user.Wanteds * 54; ;
|
||||||
using (var dbContext = new DatabaseContext())
|
using (var dbContext = new DatabaseContext())
|
||||||
{
|
{
|
||||||
if(!client.HasData("isDead") || client.GetData("isDead") == false)
|
if (!client.HasData("isDead") || client.GetData("isDead") == false)
|
||||||
{
|
{
|
||||||
client.GetUser(dbContext).JailTime = (user.Wanteds * 54) / 2; // 54 sec for each wanted star -> in total 45min for 50 Wanteds
|
jailTime /= 2;
|
||||||
Jailtime[user.Id] = (user.JailTime * 54) / 2; // 54 sec for each wanted star -> in total 45min for 50 Wanteds
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
client.GetUser(dbContext).JailTime = user.Wanteds * 54;
|
|
||||||
Jailtime[user.Id] = user.JailTime * 54; // 54 sec for each wanted star -> in total 45min for 50 Wanteds
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
client.GetUser(dbContext).JailTime = jailTime;
|
||||||
|
Jailtime[user.Id] = jailTime; // 54 sec for each wanted star -> in total 45min for 50 Wanteds
|
||||||
|
|
||||||
client.GetUser(dbContext).Wanteds = 0;
|
client.GetUser(dbContext).Wanteds = 0;
|
||||||
dbContext.SaveChanges();
|
dbContext.SaveChanges();
|
||||||
}
|
}
|
||||||
@@ -75,9 +74,9 @@ namespace ReallifeGamemode.Server.Wanted
|
|||||||
client.Health = 100;
|
client.Health = 100;
|
||||||
|
|
||||||
|
|
||||||
ChatService.BroadcastFaction("~r~HQ: " + user.Name + " wurde im Gefängnis zugewiesen.", new List<int>() {1,3});
|
ChatService.BroadcastFaction("~r~HQ: " + user.Name + " wurde im Gefängnis zugewiesen.", new List<Faction>() { , 3 });
|
||||||
|
|
||||||
ChatService.SendMessage(client, "Du bist im Gefängnis für " + user.JailTime + " Sekunden.");
|
ChatService.SendMessage(client, "Du bist im Gefängnis für " + jailTime + " Sekunden.");
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user