Strip out the rest of our pretty C#8 and C#9 niceness to bring back .NET framework support a little longer

This commit is contained in:
cinder
2022-11-20 00:46:46 -06:00
parent b73bca2c98
commit b85220d4e3
13 changed files with 109 additions and 74 deletions

View File

@@ -113,7 +113,10 @@ namespace OpenMetaverse.TestClient
}
// Otherwise, use the center of the named region
account.StartLocation ??= NetworkManager.StartLocation(args[3], 128, 128, 40);
if (account.StartLocation == null)
{
account.StartLocation = NetworkManager.StartLocation(args[3], 128, 128, 40);
}
}
}
@@ -137,8 +140,8 @@ namespace OpenMetaverse.TestClient
{
// Check if this client is already logged in
foreach (var c in Clients.Values.Where(
client => client.Self.FirstName == account.FirstName
&& client.Self.LastName == account.LastName))
tc => tc.Self.FirstName == account.FirstName
&& tc.Self.LastName == account.LastName))
{
Logout(c);
break;
@@ -146,8 +149,10 @@ namespace OpenMetaverse.TestClient
++PendingLogins;
TestClient client = new TestClient(this);
client.Settings.MFA_ENABLED = true;
TestClient client = new TestClient(this)
{
Settings = { MFA_ENABLED = true }
};
client.Network.LoginProgress +=
delegate(object sender, LoginProgressEventArgs e)
{

View File

@@ -9,7 +9,8 @@ namespace OpenMetaverse.TestClient
public class CloneCommand : Command
{
uint _serialNum = 2;
readonly CacheDictionary<UUID, AvatarAppearancePacket> Appearances = new(100, new LruRemovalStrategy<UUID>());
readonly CacheDictionary<UUID, AvatarAppearancePacket> Appearances =
new CacheDictionary<UUID, AvatarAppearancePacket>(100, new LruRemovalStrategy<UUID>());
public CloneCommand(TestClient testClient)
{

View File

@@ -111,7 +111,7 @@ namespace OpenMetaverse.TestClient
if (!primDone.WaitOne(10000, false))
return "Rez failed, timed out while creating the root prim.";
Client.Objects.SetPosition(Client.Network.CurrentSim, primsCreated[^1].LocalID, linkset.RootPrim.Position);
Client.Objects.SetPosition(Client.Network.CurrentSim, primsCreated[primsCreated.Count - 1].LocalID, linkset.RootPrim.Position);
state = ImporterState.RezzingChildren;
@@ -126,7 +126,7 @@ namespace OpenMetaverse.TestClient
if (!primDone.WaitOne(10000, false))
return "Rez failed, timed out while creating child prim.";
Client.Objects.SetPosition(Client.Network.CurrentSim, primsCreated[^1].LocalID, currentPosition);
Client.Objects.SetPosition(Client.Network.CurrentSim, primsCreated[primsCreated.Count - 1].LocalID, currentPosition);
}