diff --git a/ErgometerLibrary/FileHandler.cs b/ErgometerLibrary/FileHandler.cs index 87cd890..c84c8ab 100644 --- a/ErgometerLibrary/FileHandler.cs +++ b/ErgometerLibrary/FileHandler.cs @@ -6,7 +6,7 @@ using System.Threading.Tasks; namespace ErgometerLibrary { - class FileHandler + public class FileHandler { public static int GenerateSession() { diff --git a/ErgometerLibrary/NetCommand.cs b/ErgometerLibrary/NetCommand.cs index 91c85ad..7df5d57 100644 --- a/ErgometerLibrary/NetCommand.cs +++ b/ErgometerLibrary/NetCommand.cs @@ -8,7 +8,7 @@ namespace ErgometerLibrary { public class NetCommand { - public enum CommandType { LOGIN, DATA, CHAT, LOGOUT }; + public enum CommandType { LOGIN, DATA, CHAT, LOGOUT, SESSION }; public double Timestamp { get; set; } @@ -20,6 +20,12 @@ namespace ErgometerLibrary public string ChatMessage { get; set; } public Meting Meting { get; set; } + public NetCommand(int session) + { + Type = CommandType.SESSION; + Session = session; + Timestamp = (DateTime.Now - DateTime.Parse("1/1/1870 0:0:0")).TotalMilliseconds; + } public NetCommand(CommandType commandtype, int session) { @@ -79,11 +85,19 @@ namespace ErgometerLibrary return ParseChatMessage(session, args); case 4: return ParseLogoutRequest(session, args); + case 5: + return ParseSession(session); default: throw new FormatException("Error in NetCommand: " + comType + " is not a valid command type."); } } + private NetCommand ParseSession(int session) + { + NetCommand temp = new NetCommand(CommandType.SESSION, session); + return temp; + } + private NetCommand ParseLogoutRequest(int session, string[] args) { if (args.Length != 1) @@ -153,6 +167,9 @@ namespace ErgometerLibrary case CommandType.LOGOUT: command += "4»ses" + Session + "»logout"; break; + case CommandType.SESSION: + command += "5»ses" + Session; + break; default: throw new FormatException("Error in NetCommand: Cannot find type of command"); diff --git a/ErgometerLibrary/Properties/AssemblyInfo.cs b/ErgometerLibrary/Properties/AssemblyInfo.cs index ae62c7a..63ec27d 100644 --- a/ErgometerLibrary/Properties/AssemblyInfo.cs +++ b/ErgometerLibrary/Properties/AssemblyInfo.cs @@ -32,5 +32,5 @@ using System.Runtime.InteropServices; // You can specify all the values or you can default the Build and Revision Numbers // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("1.0.0.2")] -[assembly: AssemblyFileVersion("1.0.0.2")] +[assembly: AssemblyVersion("1.0.1.0")] +[assembly: AssemblyFileVersion("1.0.1.0")]