Commit
This commit is contained in:
@@ -600,6 +600,7 @@ namespace ReallifeGamemode.Server.Commands
|
||||
|
||||
ChatService.SendMessage(target, "~r~KICKINFO: ~w~Du wurdest von " + adminPlayername + " vom Server gekickt: " + reason);
|
||||
target.Kick();
|
||||
|
||||
ChatService.Broadcast("~y~INFO: ~w~" + targetPlayername + " wurde von " + player.GetUser().AdminLevel.GetName() + " " + adminPlayername + " gekickt: " + reason);
|
||||
}
|
||||
|
||||
@@ -2525,8 +2526,6 @@ namespace ReallifeGamemode.Server.Commands
|
||||
dbContext.Users.Where(u => u.Id == nearHouse.OwnerId).First().HouseId = null;
|
||||
}
|
||||
|
||||
dbContext.SaveChanges();
|
||||
|
||||
dbContext.Houses.Remove(nearHouse);
|
||||
dbContext.SaveChanges();
|
||||
|
||||
|
||||
@@ -5,6 +5,7 @@ using ReallifeGamemode.Server.Finance;
|
||||
using ReallifeGamemode.Server.Models;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System;
|
||||
|
||||
@@ -69,5 +70,6 @@ namespace ReallifeGamemode.Server.Commands
|
||||
ChatService.SendMessage(client, "~g~[PAYCHECK] -------------------------------------------------------");
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,8 @@ namespace ReallifeGamemode.Server.Events
|
||||
player.SetData("isLoggedIn", false);
|
||||
player.Position = new Vector3(-1883.736, -781.4911, -10);
|
||||
player.FreezePosition = true;
|
||||
|
||||
|
||||
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
if (!dbContext.WhitelistEntries.Any(w => w.SocialClubName.ToLower() == player.SocialClubName.ToLower()))
|
||||
@@ -38,6 +39,7 @@ namespace ReallifeGamemode.Server.Events
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if (IsPlayerBanned(player)) return;
|
||||
player.TriggerEvent("SERVER:Login_ShowBrowser");
|
||||
@@ -88,4 +90,4 @@ namespace ReallifeGamemode.Server.Events
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,6 +168,15 @@ namespace ReallifeGamemode.Server.Finance
|
||||
Paychecks[user.Id] = paycheck;
|
||||
ReleasePayDay(client, paycheck);
|
||||
}
|
||||
|
||||
private static int GetRentalFees(Client client)
|
||||
{
|
||||
using (var dbContext = new DatabaseContext())
|
||||
{
|
||||
User user = client.GetUser();
|
||||
return dbContext.HouseRentals.Where(h => h.UserId == user.Id).Include(h => h.House).Sum(h => h.House.RentalFee);
|
||||
}
|
||||
}
|
||||
|
||||
private static int GetRentalFees(Client client)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
<Configurations>Debug;Release;ServerBuild</Configurations>
|
||||
<LangVersion>7.3</LangVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Remove="Migrations\20190721184931_FactionWeaponsRemovedHash.cs" />
|
||||
<Compile Remove="Migrations\20190721184931_FactionWeaponsRemovedHash.Designer.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="meta.xml">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
@@ -37,6 +41,6 @@
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<Target Name="PostBuild" AfterTargets="PostBuildEvent" Condition="'$(ConfigurationName)' != 'ServerBuild'">
|
||||
<Exec Command="powershell.exe .\Scripts\moveItems.ps1 -outDir $(OutDir) -outFile $(TargetFileName)" />
|
||||
<Exec Command="powershell.exe -executionpolicy bypass .\Scripts\moveItems.ps1 -outDir $(OutDir) -outFile $(TargetFileName)" />
|
||||
</Target>
|
||||
</Project>
|
||||
120
ReallifeGamemode.Server/Report/Report.cs
Normal file
120
ReallifeGamemode.Server/Report/Report.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
using GTANetworkAPI;
|
||||
using ReallifeGamemode.Server.Entities;
|
||||
using ReallifeGamemode.Server.Extensions;
|
||||
using ReallifeGamemode.Server.Finance;
|
||||
using ReallifeGamemode.Server.Models;
|
||||
using ReallifeGamemode.Server.Services;
|
||||
using ReallifeGamemode.Server.Util;
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace ReallifeGamemode.Server.Report
|
||||
{
|
||||
class Report : Script
|
||||
{
|
||||
public static List<ReportManage> listReports = new List<ReportManage>();
|
||||
|
||||
[Command("report", "~m~Benutzung: ~s~/report")]
|
||||
public void CmdUserReport(Client client, String message)
|
||||
{
|
||||
User user = client.GetUser();
|
||||
|
||||
client.TriggerEvent("showReportType");
|
||||
//ChatService.BroadcastAdmin("Eingehendes Ticket von " + client.Name + ": " + message + " (Benutze /showtickets)", AdminLevel.ADMIN);
|
||||
ReportManage ticket = new ReportManage(client.Name, message);
|
||||
listReports.Add(ticket);
|
||||
}
|
||||
|
||||
[Command("showtickets", "~m~Benutzung: ~s~/showtickets")]
|
||||
public void CmdAdminShowtickets(Client client)
|
||||
{
|
||||
if (!client.GetUser()?.IsAdmin(AdminLevel.ADMIN) ?? true)
|
||||
{
|
||||
ChatService.NotAuthorized(client);
|
||||
return;
|
||||
}
|
||||
|
||||
if (listReports.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
User user = client.GetUser();
|
||||
List<String> listPlayers = new List<string>();
|
||||
List<String> listTicketnames = new List<string>();
|
||||
|
||||
for (int a=0; a< listReports.Count; a++)
|
||||
{
|
||||
ReportManage temp = listReports[a];
|
||||
|
||||
listPlayers.Add(temp.getUser());
|
||||
listTicketnames.Add(temp.getReporttext());
|
||||
}
|
||||
//ChatService.SendMessage(client, JsonConvert.SerializeObject(listPlayers));
|
||||
client.TriggerEvent("showReportMenu", JsonConvert.SerializeObject(listPlayers), JsonConvert.SerializeObject(listTicketnames));
|
||||
|
||||
}
|
||||
|
||||
|
||||
[RemoteEvent("acceptReport")]
|
||||
public void AcceptReport(Client admin, string client)
|
||||
{
|
||||
Client player = ClientService.GetClientByNameOrId(client);
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
ChatService.SendMessage(player, "Admin " + admin.Name + " hat dein Ticket angenommen!");
|
||||
ChatService.BroadcastAdmin(admin.Name + " hat das Ticket von " + player.Name + " angenommen", AdminLevel.ADMIN);
|
||||
|
||||
for (int a = 0; a < listReports.Count; a++)
|
||||
{
|
||||
ReportManage temp = listReports[a];
|
||||
if (temp.getUser().Equals(player.Name))
|
||||
{
|
||||
listReports[a].setAdmin(admin.Name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("requestReport")]
|
||||
public void RequestReport(Client user, dynamic data)
|
||||
{
|
||||
ChatService.BroadcastAdmin("JA MAN!" + ", " + data, AdminLevel.ADMIN);
|
||||
}
|
||||
|
||||
[RemoteEvent("sendReport")]
|
||||
public void SendReport(Client user, string type)
|
||||
{
|
||||
if (type.Equals("Quick Report"))
|
||||
{
|
||||
ChatService.BroadcastAdmin("Quick Report von " + user.Name, AdminLevel.ADMIN);
|
||||
} else if (type.Equals("Ticket Report"))
|
||||
{
|
||||
ChatService.BroadcastAdmin("Ticket Report von " + user.Name, AdminLevel.ADMIN);
|
||||
user.TriggerEvent("textbox");
|
||||
}
|
||||
}
|
||||
|
||||
[RemoteEvent("deleteReport")]
|
||||
public void DeleteReport(Client user, string name)
|
||||
{
|
||||
Client player = ClientService.GetClientByNameOrId(name);
|
||||
if (player == null)
|
||||
return;
|
||||
|
||||
for (int a = 0; a < listReports.Count; a++)
|
||||
{
|
||||
ReportManage temp = listReports[a];
|
||||
|
||||
if (temp.getUser().Equals(player.Name))
|
||||
{
|
||||
ChatService.Broadcast("Ticket von " + player.Name + " gelöscht!");
|
||||
listReports.Remove(temp);
|
||||
}
|
||||
}
|
||||
ChatService.BroadcastAdmin(user.Name + " hat das Ticket von " + player.Name + " gelöscht", AdminLevel.ADMIN);
|
||||
}
|
||||
}
|
||||
}
|
||||
34
ReallifeGamemode.Server/Report/ReportManage.cs
Normal file
34
ReallifeGamemode.Server/Report/ReportManage.cs
Normal file
@@ -0,0 +1,34 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
||||
namespace ReallifeGamemode.Server.Report
|
||||
{
|
||||
class ReportManage
|
||||
{
|
||||
private String user;
|
||||
private String admin;
|
||||
private String reportText;
|
||||
|
||||
public ReportManage (String nUser, string nReportText)
|
||||
{
|
||||
this.user = nUser;
|
||||
this.admin = "N/A";
|
||||
this.reportText = nReportText;
|
||||
}
|
||||
|
||||
public void setAdmin(String nAdmin)
|
||||
{
|
||||
this.admin = nAdmin;
|
||||
}
|
||||
|
||||
public String getUser()
|
||||
{
|
||||
return this.user;
|
||||
}
|
||||
public String getReporttext()
|
||||
{
|
||||
return this.reportText;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user