Fixed some errors in library.
This commit is contained in:
@@ -73,7 +73,8 @@ namespace ErgometerLibrary
|
||||
else
|
||||
throw new FormatException("Error in NetCommend: " + com[1] + " is not a valid session.");
|
||||
|
||||
string[] args = (string[]) com.Skip(2);
|
||||
string[] args = com;
|
||||
Array.Clear(args, 0, 2);
|
||||
|
||||
switch (comType)
|
||||
{
|
||||
@@ -134,7 +135,7 @@ namespace ErgometerLibrary
|
||||
|
||||
private static NetCommand ParseLoginRequest(int session, string[] args)
|
||||
{
|
||||
bool doctor = bool.Parse(args[1]);
|
||||
bool doctor = bool.Parse(args[3]);
|
||||
if (doctor && args.Length != 5)
|
||||
throw new MissingFieldException("Error in NetCommand: Doctor login is missing arguments");
|
||||
else if(args.Length != 4)
|
||||
@@ -142,9 +143,9 @@ namespace ErgometerLibrary
|
||||
|
||||
NetCommand temp = new NetCommand(CommandType.LOGIN, session);
|
||||
temp.IsDoctor = doctor;
|
||||
temp.DisplayName = args[0];
|
||||
temp.DisplayName = args[2];
|
||||
if (doctor)
|
||||
temp.Password = args[2];
|
||||
temp.Password = args[4];
|
||||
|
||||
return temp;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user