Modernization Fixes & Updates to Default Values (#3)

This commit is contained in:
Kamron Batman 2018-10-28 00:33:16 -07:00 committed by GitHub
parent 445eddff68
commit dcf64091b1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
768 changed files with 10507 additions and 14196 deletions

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.IO;
using System.Text;
using Server.Accounting;
@ -15,7 +15,7 @@ namespace Server.RemoteAdmin
private const string DateFormat = "MMMM dd hh:mm:ss.f tt";
private static ArrayList m_Auth = new ArrayList();
private static List<NetState> m_Auth = new List<NetState>();
private static bool m_NewLine = true;
private static StringBuilder m_ConsoleData = new StringBuilder();
@ -99,7 +99,7 @@ namespace Server.RemoteAdmin
{
packet.Acquire();
for (int i = 0; i < m_Auth.Count; i++)
((NetState)m_Auth[i]).Send(packet);
m_Auth[i].Send(packet);
packet.Release();
}
@ -146,15 +146,15 @@ namespace Server.RemoteAdmin
}
}
private static void DelayedDisconnect(NetState state)
private static void DelayedDisconnect(NetState ns)
{
Timer.DelayCall(TimeSpan.FromSeconds(15.0), new TimerStateCallback(Disconnect), state);
Timer.DelayCall(TimeSpan.FromSeconds(15.0), () => Disconnect(ns));
}
private static void Disconnect(object state)
private static void Disconnect(NetState ns)
{
m_Auth.Remove(state);
((NetState)state).Dispose();
m_Auth.Remove(ns);
ns.Dispose();
}
public static void Authenticate(NetState state, PacketReader pvSrc)
@ -208,10 +208,10 @@ namespace Server.RemoteAdmin
private static void CleanUp()
{
//remove dead instances from m_Auth
ArrayList list = new ArrayList();
List<NetState> list = new List<NetState>();
for (int i = 0; i < m_Auth.Count; i++)
{
NetState ns = (NetState)m_Auth[i];
NetState ns = m_Auth[i];
if (ns.Running)
list.Add(ns);
}
@ -221,8 +221,7 @@ namespace Server.RemoteAdmin
public static Packet Compress(Packet p)
{
int length;
byte[] source = p.Compile(false, out length);
byte[] source = p.Compile(false, out int length);
if (length > 100 && length < 60000)
{

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Accounting;
using Server.Network;
@ -59,7 +59,7 @@ namespace Server.RemoteAdmin
term = term.ToUpper();
ArrayList list = new ArrayList();
List<Account> list = new List<Account>();
foreach (Account a in Accounts.GetAccounts())
{
@ -212,7 +212,7 @@ namespace Server.RemoteAdmin
"Editing Own Account"));
}
ArrayList list = new ArrayList();
List<string> list = new List<string>();
ushort length = pvSrc.ReadUInt16();
bool invalid = false;
for (int i = 0; i < length; i++)
@ -224,10 +224,7 @@ namespace Server.RemoteAdmin
invalid = true;
}
if (list.Count > 0)
a.IPRestrictions = (string[])list.ToArray(typeof(string));
else
a.IPRestrictions = new string[0];
a.IPRestrictions = list.ToArray();
if (invalid)
state.Send(new MessageBoxMessage(

View file

@ -1,5 +1,5 @@
using System;
using System.Collections;
using System.Collections.Generic;
using Server.Accounting;
using Server.Items;
using Server.Network;
@ -89,7 +89,7 @@ namespace Server.RemoteAdmin
public sealed class AccountSearchResults : Packet
{
public AccountSearchResults(ArrayList results) : base(0x05)
public AccountSearchResults(List<Account> results) : base(0x05)
{
EnsureCapacity(1 + 2 + 2);