Using ushort rather than keyword

I'm not so familiar with this syntax.
This commit is contained in:
Lauchlin 2014-11-05 02:04:33 +11:00
parent b90466447f
commit 466ad07b71

View file

@ -20,7 +20,7 @@ namespace MinecraftClient
public static string Username = "";
public static string Password = "";
public static string ServerIP = "";
public static unsigned short ServerPort = 25565;
public static ushort ServerPort = 25565;
public static string ServerVersion = "";
public static string SingleCommand = "";
public static string ConsoleTitle = "";
@ -90,7 +90,7 @@ namespace MinecraftClient
//Custom app variables and Minecraft accounts
private static Dictionary<string, string> AppVars = new Dictionary<string, string>();
private static Dictionary<string, KeyValuePair<string, string>> Accounts = new Dictionary<string, KeyValuePair<string, string>>();
private static Dictionary<string, KeyValuePair<string, unsigned short>> Servers = new Dictionary<string, KeyValuePair<string, unsigned short>>();
private static Dictionary<string, KeyValuePair<string, ushort>> Servers = new Dictionary<string, KeyValuePair<string, ushort>>();
private enum ParseMode { Default, Main, AppVars, Proxy, AntiAFK, Hangman, Alerts, ChatLog, AutoRelog, ScriptScheduler, RemoteControl };
@ -186,7 +186,7 @@ namespace MinecraftClient
{
//Backup current server info
string server_host_temp = ServerIP;
unsigned short server_port_temp = ServerPort;
ushort server_port_temp = ServerPort;
foreach (string server_line in File.ReadAllLines(argValue))
{
@ -198,7 +198,7 @@ namespace MinecraftClient
&& !server_data[0].Contains('.')
&& setServerIP(server_data[1]))
Servers[server_data[0]]
= new KeyValuePair<string, unsigned short>(ServerIP, ServerPort);
= new KeyValuePair<string, ushort>(ServerIP, ServerPort);
}
//Restore current server info
@ -432,7 +432,7 @@ namespace MinecraftClient
server = server.ToLower();
string[] sip = server.Split(':');
string host = sip[0];
unsigned short port = 25565;
ushort port = 25565;
if (sip.Length > 1)
{