Fixed stuff

This commit is contained in:
2015-09-25 11:48:38 +02:00
parent ce93db22b2
commit 5ef796341a
3 changed files with 21 additions and 4 deletions
+1 -1
View File
@@ -6,7 +6,7 @@ using System.Threading.Tasks;
namespace ErgometerLibrary
{
class FileHandler
public class FileHandler
{
public static int GenerateSession()
{
+18 -1
View File
@@ -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");
+2 -2
View File
@@ -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")]