Changed Sessiondata

This commit is contained in:
Aareschluchtje
2015-10-20 12:08:26 +02:00
parent a7f8039fba
commit f397b8a2db
+6 -5
View File
@@ -3,6 +3,7 @@ using System.Collections.Generic;
using System.Linq; using System.Linq;
using System.Text; using System.Text;
using System.Threading.Tasks; using System.Threading.Tasks;
using Microsoft.Win32;
namespace ErgometerLibrary namespace ErgometerLibrary
{ {
@@ -38,11 +39,11 @@ namespace ErgometerLibrary
} }
//SESSIONDATA //SESSIONDATA
public NetCommand(string name, bool foo, int session) public NetCommand(string name, double timestamp, int session)
{ {
Type = CommandType.SESSIONDATA; Type = CommandType.SESSIONDATA;
Session = session; Session = session;
Timestamp = Helper.Now; Timestamp = timestamp;
DisplayName = name; DisplayName = name;
} }
@@ -189,10 +190,10 @@ namespace ErgometerLibrary
private static NetCommand ParseSessionData(int session, string[] args) private static NetCommand ParseSessionData(int session, string[] args)
{ {
if (args.Length != 1) if (args.Length != 2)
throw new MissingFieldException("Error in NetCommand: Session Data is missing arguments"); throw new MissingFieldException("Error in NetCommand: Session Data is missing arguments");
NetCommand temp = new NetCommand(args[0], false, session); NetCommand temp = new NetCommand(args[0], double.Parse(args[1]), session);
return temp; return temp;
} }
@@ -378,7 +379,7 @@ namespace ErgometerLibrary
command += "10»ses" + Session + "»" + Length.ToString().ToLower() + "»" + LengthValue; command += "10»ses" + Session + "»" + Length.ToString().ToLower() + "»" + LengthValue;
break; break;
case CommandType.SESSIONDATA: case CommandType.SESSIONDATA:
command += "11»ses" + Session + "»" + DisplayName; command += "11»ses" + Session + "»" + DisplayName + "»" + Timestamp;
break; break;
case CommandType.ERROR: case CommandType.ERROR:
command += "ERROR IN NETCOMMAND"; command += "ERROR IN NETCOMMAND";