RAGE Multiplayer 1.1.0-DP Update

/freeze was obselete and removed
/unfreeze was obselete and removed
/spectate was obselete and removed
This commit is contained in:
Siga
2020-02-24 21:18:54 +01:00
parent 0d5731fb11
commit edf06f4478
85 changed files with 804 additions and 643 deletions

View File

@@ -23,9 +23,9 @@ namespace ReallifeGamemode.Server.Gangwar
public int Att_Score { get; set; }
public int Def_Score { get; set; }
public string status { get; set; }
public List<Client> playerInside { get; set; }
public List<Player> playerInside { get; set; }
public Timer timer { get; set; }
public Client[] playerInGangwar { get; set; }
public Player[] playerInGangwar { get; set; }
public int timerCount;
@@ -40,7 +40,7 @@ namespace ReallifeGamemode.Server.Gangwar
this.Def_Score = 50;
this.status = "normal";
this.timer = null;
this.playerInside = new List<Client>();
this.playerInside = new List<Player>();
this.timerCount = 0;
}
@@ -95,8 +95,8 @@ namespace ReallifeGamemode.Server.Gangwar
/*
try
{
Client[] owners = NAPI.Pools.GetAllPlayers().Where(c => c.GetUser().Faction.Name == this.Owner).ToArray();
Client[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.GetUser().Faction.Name == this.Attacker).ToArray();
Player[] owners = NAPI.Pools.GetAllPlayers().Where(c => c.GetUser().Faction.Name == this.Owner).ToArray();
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.GetUser().Faction.Name == this.Attacker).ToArray();
}catch(NullReferenceException ex)
{
int i = 0;
@@ -115,7 +115,7 @@ namespace ReallifeGamemode.Server.Gangwar
this.Def_Score -= attackers.Length - owners.Length;
*/
#endregion
foreach (Client gangwarPlayer in this.playerInGangwar)
foreach (Player gangwarPlayer in this.playerInGangwar)
{
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, this.Att_Score, this.Def_Score);
}
@@ -131,7 +131,7 @@ namespace ReallifeGamemode.Server.Gangwar
{
if(this.Def_Score > this.Att_Score)
{
foreach (Client gangwarPlayer in this.playerInGangwar)
foreach (Player gangwarPlayer in this.playerInGangwar)
{
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0);
}
@@ -139,7 +139,7 @@ namespace ReallifeGamemode.Server.Gangwar
this.Att_Score = 0;
}else if(this.Def_Score < this.Att_Score)
{
foreach (Client gangwarPlayer in this.playerInGangwar)
foreach (Player gangwarPlayer in this.playerInGangwar)
{
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0);
}
@@ -149,7 +149,7 @@ namespace ReallifeGamemode.Server.Gangwar
}
else if(this.Def_Score == this.Att_Score)
{
foreach (Client gangwarPlayer in this.playerInGangwar)
foreach (Player gangwarPlayer in this.playerInGangwar)
{
gangwarPlayer.TriggerEvent("GangwarScore", this.Attacker, this.Owner, 0, 0);
}
@@ -161,14 +161,14 @@ namespace ReallifeGamemode.Server.Gangwar
}
}
public void enter(Client client)
public void enter(Player client)
{
if (this.status == "attack")
{
if (client.GetUser().Faction.Name != getOwner() && client.GetUser().Faction.Name != getAttacker())
return;
Client gClient = playerInGangwar.Where(c => c.GetUser().Id == client.GetUser().Id).FirstOrDefault();
if (gClient == null)
Player gPlayer = playerInGangwar.Where(c => c.GetUser().Id == client.GetUser().Id).FirstOrDefault();
if (gPlayer == null)
{
using (var dbContext = new DatabaseContext())
{
@@ -185,7 +185,7 @@ namespace ReallifeGamemode.Server.Gangwar
}
}
public void leave(Client client)
public void leave(Player client)
{
if(playerInside.Find(c => c == client) != null)
{
@@ -203,8 +203,8 @@ namespace ReallifeGamemode.Server.Gangwar
{
if (getOwner() == FactionName)
{
Client[] owners = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Owner).ToArray();
Client[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
Player[] owners = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Owner).ToArray();
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
foreach (var o in owners)
{
o.TriggerEvent("CLIENT:win");
@@ -219,8 +219,8 @@ namespace ReallifeGamemode.Server.Gangwar
else if (getOwner() != FactionName)
{
ChatService.BroadcastFaction("~y~[GANGWAR] ~w~Deine Fraktion konnte das Gebiet ~r~" + getName() + "~w~ nicht verteidigen.", dbContext.Factions.Where(f => f.Name == getOwner()).FirstOrDefault());
Client[] owners = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Owner).ToArray();
Client[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
Player[] owners = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Owner).ToArray();
Player[] attackers = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && c.GetUser().Faction.Name == this.Attacker).ToArray();
foreach (var o in owners)
{
o.TriggerEvent("CLIENT:loose");
@@ -247,7 +247,7 @@ namespace ReallifeGamemode.Server.Gangwar
}
this.playerInGangwar = null;
Gangwar.loadTurfs();
Gangwar.loadTurfs_ToAllClients();
Gangwar.loadTurfs_ToAllPlayers();
}
public void attack(string attacker)
@@ -263,9 +263,9 @@ namespace ReallifeGamemode.Server.Gangwar
this.status = "attack";
using (var context = new DatabaseContext())
{
List<Client> clientsInGangwar = new List<Client>();
List<Player> clientsInGangwar = new List<Player>();
Client[] usersInGangwar = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && (c.GetUser().Faction.Name == getOwner() || c.GetUser().Faction.Name == getAttacker())).ToArray();
Player[] usersInGangwar = NAPI.Pools.GetAllPlayers().Where(c => c.IsLoggedIn() && (c.GetUser().Faction.Name == getOwner() || c.GetUser().Faction.Name == getAttacker())).ToArray();
foreach (var u in usersInGangwar)
{
u.TriggerEvent("CLIENT:setAttackBlip", true, TurfID);