Cleanup & Fixes for .NET 5 (#309)
- [X] Fixes several bugs - [X] Updates more ordinal issues - [X] Cleans up the code a bit - [X] Turns classes static that should have been - [X] Changes TcpServer.Instances to a HashSet Bumps release version
This commit is contained in:
parent
4ad8811df2
commit
525cda5413
266 changed files with 1348 additions and 1800 deletions
|
|
@ -800,7 +800,7 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (!m_Bomb.m_Flying && m_Bomb.Map != Map.Internal)
|
||||
{
|
||||
Effects.SendLocationEffect(m_Bomb.GetWorldLocation(), m_Bomb.Map, 0x377A, 16, 10, m_Bomb.Hue, 0);
|
||||
Effects.SendLocationEffect(m_Bomb.GetWorldLocation(), m_Bomb.Map, 0x377A, 16, 10, m_Bomb.Hue);
|
||||
}
|
||||
|
||||
if (m_Bomb.Location != m_Bomb.m_Game.Controller.BombHome)
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ namespace Server.Engines.ConPVP
|
|||
hasAppended = true;
|
||||
}
|
||||
|
||||
sb.Append(".");
|
||||
sb.Append('.');
|
||||
|
||||
part.AddLog(sb.ToString());
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,5 @@
|
|||
using System;
|
||||
using System.Linq;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Text;
|
||||
|
|
@ -25,7 +26,7 @@ namespace Server.Engines.ConPVP
|
|||
private const int BlackColor32 = 0x000008;
|
||||
private const int LabelColor32 = 0xFFFFFF;
|
||||
private readonly Mobile m_From;
|
||||
private readonly List<object> m_List;
|
||||
private List<object> m_List;
|
||||
private readonly object m_Object;
|
||||
private readonly int m_Page;
|
||||
private readonly Tournament m_Tournament;
|
||||
|
|
@ -279,9 +280,8 @@ namespace Server.Engines.ConPVP
|
|||
AddPage(0);
|
||||
AddBackground(0, 0, 300, 300, 9380);
|
||||
|
||||
var pList = m_List != null
|
||||
? Utility.CastListCovariant<object, TourneyParticipant>(m_List)
|
||||
: new List<TourneyParticipant>(tourney.Participants);
|
||||
var pList = m_List?.CastListCovariant<object, TourneyParticipant>()
|
||||
?? new List<TourneyParticipant>(tourney.Participants);
|
||||
|
||||
AddLeftArrow(25, 11, ToButtonID(0, 0));
|
||||
AddHtml(25, 35, 250, 20, Center($"{pList.Count} Participant{(pList.Count == 1 ? "" : "s")}"));
|
||||
|
|
@ -440,7 +440,7 @@ namespace Server.Engines.ConPVP
|
|||
}
|
||||
|
||||
var matchesList = m_List != null
|
||||
? Utility.CastListCovariant<object, TourneyMatch>(m_List)
|
||||
? m_List.CastListCovariant<object, TourneyMatch>()
|
||||
: new List<TourneyMatch>(level.Matches);
|
||||
|
||||
AddRightArrow(
|
||||
|
|
@ -522,31 +522,14 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (m_Tournament.ParticipantsPerMatch == 4)
|
||||
{
|
||||
var name = "(null)";
|
||||
|
||||
switch (j)
|
||||
var name = j switch
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "Minax";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "Council of Mages";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "True Britannians";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "Shadowlords";
|
||||
break;
|
||||
}
|
||||
}
|
||||
0 => "Minax",
|
||||
1 => "Council of Mages",
|
||||
2 => "True Britannians",
|
||||
3 => "Shadowlords",
|
||||
_ => "(null)"
|
||||
};
|
||||
|
||||
txt = $"{name} ({part.Players.Count})";
|
||||
}
|
||||
|
|
@ -658,31 +641,14 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (m_Tournament.ParticipantsPerMatch == 4)
|
||||
{
|
||||
var name = "(null)";
|
||||
|
||||
switch (i)
|
||||
var name = i switch
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "Minax";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "Council of Mages";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "True Britannians";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "Shadowlords";
|
||||
break;
|
||||
}
|
||||
}
|
||||
0 => "Minax",
|
||||
1 => "Council of Mages",
|
||||
2 => "True Britannians",
|
||||
3 => "Shadowlords",
|
||||
_ => "(null)"
|
||||
};
|
||||
|
||||
AddRightArrow(
|
||||
25,
|
||||
|
|
|
|||
|
|
@ -478,7 +478,7 @@ namespace Server.Engines.ConPVP
|
|||
hasAppended = true;
|
||||
}
|
||||
|
||||
sb.Append(".");
|
||||
sb.Append('.');
|
||||
|
||||
if (TourneyType == TourneyType.Standard)
|
||||
{
|
||||
|
|
@ -784,35 +784,14 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (m_ParticipantsPerMatch == 4)
|
||||
{
|
||||
var name = "(null)";
|
||||
|
||||
switch (Pyramid.Levels[0]
|
||||
.Matches[0]
|
||||
.Participants.IndexOf(
|
||||
winner
|
||||
))
|
||||
var name = Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) switch
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "Minax";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "Council of Mages";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "True Britannians";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "Shadowlords";
|
||||
break;
|
||||
}
|
||||
}
|
||||
0 => "Minax",
|
||||
1 => "Council of Mages",
|
||||
2 => "True Britannians",
|
||||
3 => "Shadowlords",
|
||||
_ => "(null)"
|
||||
};
|
||||
|
||||
Alert("The tournament has completed!", $"The {name} team has won!");
|
||||
}
|
||||
|
|
@ -940,33 +919,14 @@ namespace Server.Engines.ConPVP
|
|||
{
|
||||
if (m_ParticipantsPerMatch == 4)
|
||||
{
|
||||
var name = "(null)";
|
||||
|
||||
switch (Pyramid.Levels[0]
|
||||
.Matches[0]
|
||||
.Participants.IndexOf(winner))
|
||||
var name = Pyramid.Levels[0].Matches[0].Participants.IndexOf(winner) switch
|
||||
{
|
||||
case 0:
|
||||
{
|
||||
name = "Minax";
|
||||
break;
|
||||
}
|
||||
case 1:
|
||||
{
|
||||
name = "Council of Mages";
|
||||
break;
|
||||
}
|
||||
case 2:
|
||||
{
|
||||
name = "True Britannians";
|
||||
break;
|
||||
}
|
||||
case 3:
|
||||
{
|
||||
name = "Shadowlords";
|
||||
break;
|
||||
}
|
||||
}
|
||||
0 => "Minax",
|
||||
1 => "Council of Mages",
|
||||
2 => "True Britannians",
|
||||
3 => "Shadowlords",
|
||||
_ => "(null)"
|
||||
};
|
||||
|
||||
Alert("The tournament has completed!", $"The {name} team has won!");
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue