more more fixes in report system
This commit is contained in:
@@ -85,6 +85,7 @@ namespace ReallifeGamemode.Server.Report
|
|||||||
String username = "N/A";
|
String username = "N/A";
|
||||||
String adminname = "N/A";
|
String adminname = "N/A";
|
||||||
ReportManage temp = null;
|
ReportManage temp = null;
|
||||||
|
bool userIsAdmin = false;
|
||||||
|
|
||||||
//Für Admin
|
//Für Admin
|
||||||
if (client.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
if (client.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true)
|
||||||
@@ -99,34 +100,46 @@ namespace ReallifeGamemode.Server.Report
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!cont)
|
Client user = null;
|
||||||
|
if (cont)
|
||||||
{
|
{
|
||||||
return;
|
user = ClientService.GetClientByNameOrId(username);
|
||||||
|
|
||||||
|
if (text.Equals("quit"))
|
||||||
|
{
|
||||||
|
ChatService.SendMessage(user, "~y~[REPORT] Chat vom Admin beendet");
|
||||||
|
ChatService.SendMessage(client, "~y~[REPORT] Chat beendet");
|
||||||
|
|
||||||
|
for (int a = 0; a < listReports.Count; a++)
|
||||||
|
{
|
||||||
|
temp = listReports[a];
|
||||||
|
if (temp.getAdmin().Equals(client.Name))
|
||||||
|
{
|
||||||
|
listReports.Remove(temp);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ChatService.SendMessage(client, "~y~[REPORT] " + client.Name + ": " + text);
|
||||||
|
ChatService.SendMessage(user, "~y~[REPORT] " + client.Name + ": " + text);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
Client user = ClientService.GetClientByNameOrId(username);
|
|
||||||
|
|
||||||
if (text.Equals("quit"))
|
|
||||||
{
|
{
|
||||||
ChatService.SendMessage(user, "~y~[REPORT] Chat vom Admin beendet");
|
userIsAdmin = true;
|
||||||
ChatService.SendMessage(client, "~y~[REPORT] Chat beendet");
|
|
||||||
|
|
||||||
listReports.Remove(temp);
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
ChatService.SendMessage(client, "~y~[REPORT] " + client.Name + ": " + text);
|
|
||||||
ChatService.SendMessage(user, "~y~[REPORT] " + client.Name + ": " + text);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
//Für User
|
//Für User
|
||||||
else
|
if ((!client.GetUser()?.IsAdmin(AdminLevel.SUPPORTER) ?? true) || userIsAdmin)
|
||||||
{
|
{
|
||||||
cont = false;
|
cont = false;
|
||||||
for (int a = 0; a < listReports.Count; a++)
|
for (int a = 0; a < listReports.Count; a++)
|
||||||
{
|
{
|
||||||
temp = listReports[a];
|
temp = listReports[a];
|
||||||
if (temp.getUser().Equals(client.Name))
|
if (temp.getUser().Equals(client.Name) && !temp.getAdmin().Equals("N/A"))
|
||||||
{
|
{
|
||||||
cont = true;
|
cont = true;
|
||||||
adminname = listReports[a].getAdmin();
|
adminname = listReports[a].getAdmin();
|
||||||
@@ -153,7 +166,7 @@ namespace ReallifeGamemode.Server.Report
|
|||||||
listReports.Add(ticket);
|
listReports.Add(ticket);
|
||||||
}
|
}
|
||||||
if (type == "Quick Report")
|
if (type == "Quick Report")
|
||||||
ChatService.BroadcastAdmin("QR von " + user.Name + ": " + data, AdminLevel.ADMIN);
|
ChatService.BroadcastAdmin("QR von " + user.Name + ": " + data, AdminLevel.SUPPORTER);
|
||||||
}
|
}
|
||||||
|
|
||||||
[RemoteEvent("deleteReport")]
|
[RemoteEvent("deleteReport")]
|
||||||
@@ -166,8 +179,7 @@ namespace ReallifeGamemode.Server.Report
|
|||||||
for (int a = 0; a < listReports.Count; a++)
|
for (int a = 0; a < listReports.Count; a++)
|
||||||
{
|
{
|
||||||
ReportManage temp = listReports[a];
|
ReportManage temp = listReports[a];
|
||||||
|
|
||||||
ChatService.Broadcast("DEB: " + temp.getUser() + " + " + player.Name + " + " + user.Name);
|
|
||||||
if (temp.getUser().Equals(player.Name))
|
if (temp.getUser().Equals(player.Name))
|
||||||
{
|
{
|
||||||
ChatService.Broadcast("Ticket von " + player.Name + " gelöscht!");
|
ChatService.Broadcast("Ticket von " + player.Name + " gelöscht!");
|
||||||
|
|||||||
Reference in New Issue
Block a user