Index: /Dev/LoggingTool.txt
===================================================================
--- /Dev/LoggingTool.txt	(revision 3)
+++ /Dev/LoggingTool.txt	(revision 3)
@@ -0,0 +1,102 @@
+
+
+20/01/2011: Vervelende bug in acknowledgement tussen UT en Logger - input incorrect >_<;
+
+
+
+=====================
+Met properties lokaal wegschrijven/inlezen
+=====================
+
+
+08/12/2010: Started development
+	Created:	+ILoggerOutput
+			+LoggerMessage
+			+TeamUpSpreadsheetOutput
+			+TeamUpMessage
+			+TestSpreadsheetOutput
+			+TeamUpQuestionnaire
+			+TeamUpEvent
+			+ILoggerLogic
+			+TeamUpLogic
+			
+			
+	Basically, I created the output and logic part of the TeamUplogger and tested this quickly with the Google Docs
+	Spreadsheet method. 
+	TODO:		-TeamUpLocalOutput (or generalized LocalOutput)
+			-ILoggerInput
+			-TeamUpInput
+			-In TeamUpOutput: checking connection, throttling/buffering messages
+			-In TeamUpLogic/Output: Get a proper sessionID
+			-(more) Models
+			
+
+
+
+\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\
+- unique session id (datum/tijd) in excel
+- voeg playerid toe aan events
+
+//meerdere sheets in excel output
+//sheet voor questionnares met op kolom session id en 
+
+
+====Startup Procedure ==========
+1. PC's gaan aan
+2. Vier pc's: 1 is momenteel server + client. De rest clients
+
+
+
+Server moet gestart worden vanuit Tool. Daarna worden clients opgestart (via shortcut). Clients connecten puur vanuit unrealscript. IP staat in .ini file.
+Geldt ook voor client die op de server staat (krijgt apart ip, localhost).
+
+Daarna: needs session management. Moet gereset worden als spel gereset wordt door client. Sla op in datamodel. Schrijf oude weg als nieuwe wordt gestart,
+lokaal en extern (bv google docs excel). Houd bij welke al opgestuurd zijn en welke nog gestuurd moeten worden, zodat hij gaat sturen zodra er weer
+connectie is. Wegschrijven aparte modules voor verschillende backends.
+
+
+01/12/2010: Uitzoeken wat gelogged wordt en hoe dat het beste kan worden weergegeven.
+	Belangrijke informatie:
+		- Session id
+		- PlayerID (vier per sessie, most likely)
+		- Questionnaire per speler
+		- Events (10 totaal)
+
+	Mogelijke representaties:
+
+#################### Tabel voor questionnaire + tabel voor ieder event ##########
+#										#
+#	Sheet: Questionnaire							#
+#	Session	   PlayerID   Age     Sex					#
+#	 | i |      | i |    | i |   | i |					#
+#	 |   |      |   |    |   |   |   |					#
+#										#
+#										#
+#	Sheet: Maze								#
+#	Session     Timestamp    		       				#
+#	 | i |	      | i |         	 					#
+#	 |   |        |   |      						#
+#										#
+#										#
+#	Sheet: Stepped on faulty tile						#
+#	Session     Timestamp	PlayerID      					#
+#	 | i |	      | i |      | i |    	  				#
+#	 |   |        |   |      |   |						#
+#Legenda: i = int; t = timestamp.						#
+#################################################################################
+
+################### Tabel voor questionnaire + 1 tabel voor alle events #########
+#										#
+#	Sheet: Questionnaire							#
+#	Session	   PlayerID   Age     Sex					#
+#	 | i |      | i |    | i |   | i |					#
+#	 |   |      |   |    |   |   |   |					#
+#										#
+#	Sheet: Events								#
+#	Session     Timestamp   EventID  PlayerID	       			#
+#	 | i |	      | i |      | i | 	   | i |				#
+#	 |   |        |   |      |   |	   |   |				#
+#Legenda: i = int; t = timestamp.						#				
+#################################################################################
+
+
Index: /Dev/LoggingTool/LoggingTool.cs
===================================================================
--- /Dev/LoggingTool/LoggingTool.cs	(revision 3)
+++ /Dev/LoggingTool/LoggingTool.cs	(revision 3)
@@ -0,0 +1,26 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using UDKTCPLink;
+using LoggingTool.network;
+using System.Threading;
+using LoggingTool.models;
+
+namespace LoggingTool
+{
+    class LoggingTool
+    {
+        static void Main(string[] args)
+        {
+            Server server = new Server();
+            SVData svData = new SVData();
+            server.Protocol = new SVProtocol(server, svData);
+            server.Activate();
+            while(true)
+                Thread.Sleep(1000);
+
+            //Launch Supervisor
+        }
+    }
+}
Index: /Dev/LoggingTool/LoggingTool.csproj
===================================================================
--- /Dev/LoggingTool/LoggingTool.csproj	(revision 3)
+++ /Dev/LoggingTool/LoggingTool.csproj	(revision 3)
@@ -0,0 +1,85 @@
+﻿<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">x86</Platform>
+    <ProductVersion>8.0.30703</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>LoggingTool</RootNamespace>
+    <AssemblyName>LoggingTool</AssemblyName>
+    <TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>bin\Debug\</OutputPath>
+    <DefineConstants>DEBUG;TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|x86' ">
+    <PlatformTarget>x86</PlatformTarget>
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <OutputPath>bin\Release\</OutputPath>
+    <DefineConstants>TRACE</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="Google.GData.Client, Version=1.6.0.0, Culture=neutral, PublicKeyToken=04a59ca9b0273830, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\GoogleData\Samples\Google.GData.Client.dll</HintPath>
+    </Reference>
+    <Reference Include="Google.GData.Extensions, Version=1.6.0.0, Culture=neutral, PublicKeyToken=0b4c5df2ebf20876, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\GoogleData\Samples\Google.GData.Extensions.dll</HintPath>
+    </Reference>
+    <Reference Include="Google.GData.Spreadsheets, Version=1.6.0.0, Culture=neutral, PublicKeyToken=3f77feb76ff0d9a1, processorArchitecture=MSIL">
+      <SpecificVersion>False</SpecificVersion>
+      <HintPath>..\GoogleData\Samples\Google.GData.Spreadsheets.dll</HintPath>
+    </Reference>
+    <Reference Include="System" />
+    <Reference Include="System.Core" />
+    <Reference Include="System.Xml.Linq" />
+    <Reference Include="System.Data.DataSetExtensions" />
+    <Reference Include="System.Data" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="LoggingTool.cs" />
+    <Compile Include="interfaces\TeamUpLogic.cs" />
+    <Compile Include="interfaces\ILoggerLogic.cs" />
+    <Compile Include="interfaces\TeamUpSpreadsheetOutput.cs" />
+    <Compile Include="interfaces\ILoggerOutput.cs" />
+    <Compile Include="models\SVData.cs" />
+    <Compile Include="models\TeamUpEvent.cs" />
+    <Compile Include="models\TeamUpQuestionnaire.cs" />
+    <Compile Include="models\LoggerMessage.cs" />
+    <Compile Include="models\TeamUpSpreadsheetMessage.cs" />
+    <Compile Include="network\SVProtocolClientData.cs" />
+    <Compile Include="network\SVProtocol.cs" />
+    <Compile Include="TestSpreadsheetOutput.cs" />
+    <Compile Include="Properties\AssemblyInfo.cs" />
+  </ItemGroup>
+  <ItemGroup>
+    <ProjectReference Include="..\..\..\UDKTCPLink\UDKTCPLink\UDKTCPLink.csproj">
+      <Project>{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}</Project>
+      <Name>UDKTCPLink</Name>
+    </ProjectReference>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>
Index: /Dev/LoggingTool/LoggingTool.sln
===================================================================
--- /Dev/LoggingTool/LoggingTool.sln	(revision 3)
+++ /Dev/LoggingTool/LoggingTool.sln	(revision 3)
@@ -0,0 +1,42 @@
+﻿
+Microsoft Visual Studio Solution File, Format Version 11.00
+# Visual Studio 2010
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "LoggingTool", "LoggingTool.csproj", "{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "UDKTCPLink", "..\..\..\UDKTCPLink\UDKTCPLink\UDKTCPLink.csproj", "{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}"
+EndProject
+Global
+	GlobalSection(SolutionConfigurationPlatforms) = preSolution
+		Debug|Any CPU = Debug|Any CPU
+		Debug|Mixed Platforms = Debug|Mixed Platforms
+		Debug|x86 = Debug|x86
+		Release|Any CPU = Release|Any CPU
+		Release|Mixed Platforms = Release|Mixed Platforms
+		Release|x86 = Release|x86
+	EndGlobalSection
+	GlobalSection(ProjectConfigurationPlatforms) = postSolution
+		{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}.Debug|Any CPU.ActiveCfg = Debug|x86
+		{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}.Debug|Mixed Platforms.ActiveCfg = Debug|x86
+		{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}.Debug|Mixed Platforms.Build.0 = Debug|x86
+		{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}.Debug|x86.ActiveCfg = Debug|x86
+		{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}.Debug|x86.Build.0 = Debug|x86
+		{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}.Release|Any CPU.ActiveCfg = Release|x86
+		{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}.Release|Mixed Platforms.ActiveCfg = Release|x86
+		{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}.Release|Mixed Platforms.Build.0 = Release|x86
+		{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}.Release|x86.ActiveCfg = Release|x86
+		{B5F52C17-DB39-47A9-8A4A-31FB4DE899EA}.Release|x86.Build.0 = Release|x86
+		{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+		{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+		{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
+		{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
+		{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}.Debug|x86.ActiveCfg = Debug|Any CPU
+		{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+		{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}.Release|Any CPU.Build.0 = Release|Any CPU
+		{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
+		{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}.Release|Mixed Platforms.Build.0 = Release|Any CPU
+		{5FB0E6BA-4999-494D-B6A4-7E884E6B4B6F}.Release|x86.ActiveCfg = Release|Any CPU
+	EndGlobalSection
+	GlobalSection(SolutionProperties) = preSolution
+		HideSolutionNode = FALSE
+	EndGlobalSection
+EndGlobal
Index: /Dev/LoggingTool/TestSpreadsheetOutput.cs
===================================================================
--- /Dev/LoggingTool/TestSpreadsheetOutput.cs	(revision 3)
+++ /Dev/LoggingTool/TestSpreadsheetOutput.cs	(revision 3)
@@ -0,0 +1,186 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using Google.GData.Client;
+using Google.GData.Extensions;
+using Google.GData.Spreadsheets;
+using LoggingTool.interfaces;
+using LoggingTool.models;
+using System.IO;
+using UDKTCPLink;
+using LoggingTool.network;
+using System.Threading;
+
+namespace LoggingTool
+{
+    class TestSpreadsheetOutput
+    {
+
+        /*static void Main(string[] args)
+        {
+            //new SpreadsheetLogicTest();
+            Console.ReadKey();
+        }*/
+    }
+    class SpreadsheetOutputTest
+    {
+        private ILoggerOutput output;
+
+        public SpreadsheetOutputTest()
+        {
+            output = new TeamUpSpeadsheetOutput("cpsgamingstreet@gmail.com", "wachtwoord2009", "GDataTest");
+            LoggerMessage questionnaireMessage = new TeamUpSpreadsheetMessage(TeamUpSpreadsheetMessage.QUESTIONNAIRE, new List<String>() {"1", "11.8940", "1", "20", "0", "1", "2", "3", "4", "5", "6", "7", "8"});
+            LoggerMessage eventMessage = new TeamUpSpreadsheetMessage(TeamUpSpreadsheetMessage.EVENT, new List<String>() {"1", "11.8940", "1337"});
+            output.send(questionnaireMessage);
+            output.send(eventMessage);
+        }
+    }
+
+    /* class SpreadsheetLogicTest
+     {
+         private ILoggerLogic logic;
+         private ILoggerOutput output;
+         private ILoggerInput input;
+
+         public SpreadsheetLogicTest()
+         {
+
+             Console.WriteLine("Setting up Logic");
+             logic = new TeamUpLogic();
+             Console.WriteLine("Setting up Output");
+             output = new TeamUpSpeadsheetOutput("cpsgamingstreet@gmail.com", "wachtwoord2009", "GDataTest");
+             Console.WriteLine("Setting up Input");
+             input = new TeamUpInput(logic);
+
+             Console.WriteLine("Setting up Server");
+             TeamUpServer server = new TeamUpServer();
+             Console.WriteLine("Setting Protocol");
+             server.Protocol = new TeamUpProtocol(server);
+             Console.WriteLine("Activating Server");
+             server.Activate(input);
+             while (true)
+                 Thread.Sleep(1000);
+            
+            
+            /* 
+             //Create some filestreams for testing purposes
+             FileStream fQ = new FileStream("D:\\jkraaijeveld\\Desktop\\questionnaires.log", FileMode.Open);
+             FileStream fE = new FileStream("D:\\jkraaijeveld\\Desktop\\events.log", FileMode.Open);
+             StreamReader sQ = new StreamReader(fQ);
+             StreamReader sE = new StreamReader(fE);
+
+             //Read everything in both of the files
+             while (!sQ.EndOfStream)
+             {
+                 logic.addInput(sQ.ReadLine());
+             }
+             while (!sE.EndOfStream)
+             {
+                 logic.addInput(sE.ReadLine());
+             }
+
+             //Create all the models
+             logic.createModels();
+             //Write them
+             List<LoggerMessage> messages = logic.formatModels();
+             foreach (LoggerMessage message in messages)
+             {
+                 output.send(message);
+             }
+         }
+     }*/
+
+
+
+
+
+
+
+
+
+    /*static void Main(string[] args)
+        {
+            //Login to google docs
+            SpreadsheetsService service = new SpreadsheetsService("testLogger");
+            
+            //Retrieve all spreadsheets in the account
+            SpreadsheetQuery query = new SpreadsheetQuery();
+            SpreadsheetFeed feed = service.Query(query);
+
+            Console.WriteLine("All spreadsheets:");
+            SpreadsheetEntry testEntry = new SpreadsheetEntry();
+            foreach (SpreadsheetEntry entry in feed.Entries)
+            {
+                Console.WriteLine(entry.Title.Text);
+                if(entry.Title.Text.Equals("GDataTest"))
+                {
+                    testEntry = entry;
+                }
+            }
+
+            //Get the first worksheet
+            AtomLink link = testEntry.Links.FindService(GDataSpreadsheetsNameTable.WorksheetRel, null);
+            WorksheetQuery workSheetQuery = new WorksheetQuery(link.HRef.ToString());
+            WorksheetFeed workSheetFeed = service.Query(workSheetQuery);
+            WorksheetEntry worksheet = (WorksheetEntry)workSheetFeed.Entries.First();
+
+            writeRow(service, worksheet);
+
+            //Prompt user for cell to update
+            Console.Write("Row of cell to update? ");
+            string row = Console.ReadLine();
+            Console.Write("Column of cell to update? ");
+            string col = Console.ReadLine();
+
+            //Get the proper cell
+            AtomLink cellFeedLink = worksheet.Links.FindService(GDataSpreadsheetsNameTable.CellRel, null);
+            CellQuery cellQuery = new CellQuery(cellFeedLink.HRef.ToString());
+            cellQuery.MinimumRow = cellQuery.MaximumRow = uint.Parse(row);
+            cellQuery.MinimumColumn = cellQuery.MaximumColumn = uint.Parse(col);
+            CellFeed cellFeed = service.Query(cellQuery);
+            CellEntry cell = (CellEntry)cellFeed.Entries.First();
+
+            Console.Write("Enter a new Value: ");
+            cell.Cell.InputValue = Console.ReadLine();
+            AtomEntry updatedCell = cell.Update();
+
+
+            Console.ReadKey();
+
+        }
+
+        public static void writeRow(SpreadsheetsService service, WorksheetEntry worksheet)
+        {
+            String[] testArray = new String[] { "Testing", "inserting", "row", "into", "spreadsheet" };
+
+
+            AtomLink listFeedLink = worksheet.Links.FindService(GDataSpreadsheetsNameTable.ListRel, null);
+
+            ListQuery query = new ListQuery(listFeedLink.HRef.ToString());
+            ListFeed feed = service.Query(query);
+
+            ListEntry firstRow = feed.Entries[0] as ListEntry;
+            ListEntry newRow = new ListEntry();
+
+
+            for (int i = 0; i < testArray.Length; i++)
+            {
+
+                ListEntry.Custom element = firstRow.Elements[i];
+                ListEntry.Custom curElement = new ListEntry.Custom();
+                curElement.LocalName = element.LocalName;
+                curElement.Value = testArray[i];
+
+                newRow.Elements.Add(curElement);
+            }
+
+            Console.WriteLine("Row is inserted when you press a key.");
+            Console.ReadKey();
+
+            ListEntry insertedRow = feed.Insert(newRow) as ListEntry;
+
+
+        }
+    }*/
+}
Index: /Dev/LoggingTool/bin/Debug/LoggingTool.vshost.exe.manifest
===================================================================
--- /Dev/LoggingTool/bin/Debug/LoggingTool.vshost.exe.manifest	(revision 3)
+++ /Dev/LoggingTool/bin/Debug/LoggingTool.vshost.exe.manifest	(revision 3)
@@ -0,0 +1,11 @@
+﻿<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
+<assembly xmlns="urn:schemas-microsoft-com:asm.v1" manifestVersion="1.0">
+  <assemblyIdentity version="1.0.0.0" name="MyApplication.app"/>
+  <trustInfo xmlns="urn:schemas-microsoft-com:asm.v2">
+    <security>
+      <requestedPrivileges xmlns="urn:schemas-microsoft-com:asm.v3">
+        <requestedExecutionLevel level="asInvoker" uiAccess="false"/>
+      </requestedPrivileges>
+    </security>
+  </trustInfo>
+</assembly>
