Fix ChatService.BroadcastFaction(string, List<int>)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
using ReallifeGamemode.Server.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Job;
|
||||
using ReallifeGamemode.Server.Models;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
@@ -105,9 +106,12 @@ namespace ReallifeGamemode.Server.Services
|
||||
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))
|
||||
{
|
||||
int jailTime = user.Wanteds * 54; ;
|
||||
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[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
|
||||
jailTime /= 2;
|
||||
}
|
||||
|
||||
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;
|
||||
dbContext.SaveChanges();
|
||||
}
|
||||
@@ -74,11 +73,11 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
Medic.RemoveTaskFromList(task);
|
||||
client.Health = 100;
|
||||
|
||||
|
||||
ChatService.BroadcastFaction("~r~HQ: " + user.Name + " wurde im Gefängnis zugewiesen.", new List<int>() {1,3});
|
||||
|
||||
ChatService.SendMessage(client, "Du bist im Gefängnis für " + user.JailTime + " Sekunden.");
|
||||
|
||||
|
||||
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 " + jailTime + " Sekunden.");
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -134,7 +133,7 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
if (user != null && player.Position.DistanceTo2D(new Vector3(458.9842, -997.2126, 24.91485)) > 7 && Jailtime.ContainsKey(user.Id))
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
{
|
||||
user = player.GetUser(dbContext);
|
||||
user.JailTime = 0;
|
||||
user.GiveWanteds(null, 50, "Knast-Ausbruch");
|
||||
@@ -199,6 +198,6 @@ namespace ReallifeGamemode.Server.Wanted
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user