Index: Dev/LoggingTool/LoggingTool.csproj
===================================================================
--- Dev/LoggingTool/LoggingTool.csproj	(revision 4)
+++ Dev/LoggingTool/LoggingTool.csproj	(revision 5)
@@ -54,4 +54,5 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="LoggingTool.cs" />
     <Compile Include="interfaces\TeamUpLogic.cs" />
     <Compile Include="interfaces\ILoggerLogic.cs" />
@@ -65,5 +66,10 @@
     <Compile Include="Properties\AssemblyInfo.cs" />
   </ItemGroup>
-  <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. 
Index: Dev/LoggingTool/LoggingTool.sln
===================================================================
--- Dev/LoggingTool/LoggingTool.sln	(revision 4)
+++ Dev/LoggingTool/LoggingTool.sln	(revision 5)
@@ -4,14 +4,36 @@
 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
Index: Dev/LoggingTool/Properties/AssemblyInfo.cs
===================================================================
--- Dev/LoggingTool/Properties/AssemblyInfo.cs	(revision 5)
+++ Dev/LoggingTool/Properties/AssemblyInfo.cs	(revision 5)
@@ -0,0 +1,36 @@
+﻿using System.Reflection;
+using System.Runtime.CompilerServices;
+using System.Runtime.InteropServices;
+
+// General Information about an assembly is controlled through the following 
+// set of attributes. Change these attribute values to modify the information
+// associated with an assembly.
+[assembly: AssemblyTitle("LoggingTool")]
+[assembly: AssemblyDescription("")]
+[assembly: AssemblyConfiguration("")]
+[assembly: AssemblyCompany("Microsoft")]
+[assembly: AssemblyProduct("LoggingTool")]
+[assembly: AssemblyCopyright("Copyright © Microsoft 2010")]
+[assembly: AssemblyTrademark("")]
+[assembly: AssemblyCulture("")]
+
+// Setting ComVisible to false makes the types in this assembly not visible 
+// to COM components.  If you need to access a type in this assembly from 
+// COM, set the ComVisible attribute to true on that type.
+[assembly: ComVisible(false)]
+
+// The following GUID is for the ID of the typelib if this project is exposed to COM
+[assembly: Guid("daf3a6e6-a2e9-4823-ad0a-f1ebc5de309c")]
+
+// Version information for an assembly consists of the following four values:
+//
+//      Major Version
+//      Minor Version 
+//      Build Number
+//      Revision
+//
+// 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.0")]
+[assembly: AssemblyFileVersion("1.0.0.0")]
Index: Dev/LoggingTool/interfaces/ILoggerLogic.cs
===================================================================
--- Dev/LoggingTool/interfaces/ILoggerLogic.cs	(revision 5)
+++ Dev/LoggingTool/interfaces/ILoggerLogic.cs	(revision 5)
@@ -0,0 +1,17 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using LoggingTool.models;
+
+namespace LoggingTool.interfaces
+{
+    interface ILoggerLogic
+    {
+        List<LoggerMessage> formatModels();
+
+        void addInput(String input);
+
+        void createModels();
+    }
+}
Index: Dev/LoggingTool/interfaces/ILoggerOutput.cs
===================================================================
--- Dev/LoggingTool/interfaces/ILoggerOutput.cs	(revision 5)
+++ Dev/LoggingTool/interfaces/ILoggerOutput.cs	(revision 5)
@@ -0,0 +1,12 @@
+﻿using System;
+using LoggingTool.models;
+
+namespace LoggingTool.interfaces
+{
+    interface ILoggerOutput
+    {
+        Boolean send(LoggerMessage message);
+
+        Boolean testConnection();
+    }
+}
Index: Dev/LoggingTool/interfaces/TeamUpLogic.cs
===================================================================
--- Dev/LoggingTool/interfaces/TeamUpLogic.cs	(revision 5)
+++ Dev/LoggingTool/interfaces/TeamUpLogic.cs	(revision 5)
@@ -0,0 +1,84 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Collections;
+using LoggingTool.models;
+using System.Text.RegularExpressions;
+
+namespace LoggingTool.interfaces
+{
+    class TeamUpLogic : ILoggerLogic
+    {
+        List<TeamUpQuestionnaire> questionnaires;
+        List<TeamUpEvent> events;
+        List<String> rawInput;
+
+        /* ****************************************************************
+         * constructor TeamUpLogic
+         * @description: Creates a TeamUpLogic object to act as the mediator
+         *                  between Input and Output
+         * ****************************************************************/
+        public TeamUpLogic()
+        {
+            questionnaires = new List<TeamUpQuestionnaire>();
+            events = new List<TeamUpEvent>();
+            rawInput = new List<String>();
+        }
+
+        /* ****************************************************************
+         * function addInput
+         * @param input : String
+         * @description : Appends the input into the raw string array
+         * ****************************************************************/
+        public void addInput(String input)
+        {
+            rawInput.Add(input);
+        }
+
+        /* *********************************************************************
+         * function createModels
+         * @description: Parses all the raw input and creates objects out of it.
+         * *********************************************************************/
+        public void createModels()
+        {
+            //Loop through all the inputs
+            foreach (String input in rawInput)
+            {
+                //If there are more than 4 |'s, this is a questionnaire.
+                if ((input.Split('|').Count() - 1) > 4)
+                    questionnaires.Add(new TeamUpQuestionnaire(input));
+
+                //Else, this is an TeamUpEvent
+                else
+                    events.Add(new TeamUpEvent(input));
+            }
+            rawInput = new List<String>();
+        }
+
+        /* **********************************************************************
+         * function formatModels
+         * @return: List<LoggerMessage>
+         * @description: Takes the models in the lists (attributes) and formats
+         *                  them into messages.
+         * **********************************************************************/
+        public List<LoggerMessage> formatModels()
+        {
+            List<LoggerMessage> resultSet = new List<LoggerMessage>();
+            foreach (TeamUpQuestionnaire questionnaire in questionnaires)
+            {
+                TeamUpSpreadsheetMessage message = new TeamUpSpreadsheetMessage(TeamUpSpreadsheetMessage.QUESTIONNAIRE, questionnaire.toStringArray());
+                resultSet.Add(message);
+            }
+
+            foreach (TeamUpEvent e in events)
+            {
+                TeamUpSpreadsheetMessage message = new TeamUpSpreadsheetMessage(TeamUpSpreadsheetMessage.EVENT, e.toStringArray());
+                resultSet.Add(message);
+            }
+            
+           return resultSet;
+        }
+
+    }
+}
Index: Dev/LoggingTool/interfaces/TeamUpSpreadsheetOutput.cs
===================================================================
--- Dev/LoggingTool/interfaces/TeamUpSpreadsheetOutput.cs	(revision 5)
+++ Dev/LoggingTool/interfaces/TeamUpSpreadsheetOutput.cs	(revision 5)
@@ -0,0 +1,158 @@
+﻿using System;
+using Google.GData.Client;
+using Google.GData.Extensions;
+using Google.GData.Spreadsheets;
+using System.Collections;
+using LoggingTool.models;
+using System.Collections.Generic;
+
+namespace LoggingTool.interfaces
+{
+    class TeamUpSpeadsheetOutput : ILoggerOutput
+    {
+        private SpreadsheetsService service;
+        private SpreadsheetEntry spreadsheet;
+
+        /* ******************************************************************************
+         * constructor TeamUpSpreadsheetOutput
+         * @description: creates the implementation of the ILoggerOutput interface
+         * ******************************************************************************/
+        public TeamUpSpeadsheetOutput(String username, String password, String spreadsheet)
+        {
+            //Log in to GoogleDocs and retrieve the right spreadsheet
+            service = new SpreadsheetsService("TeamUp Logging Spreadsheet");
+            service.setUserCredentials(username, password);
+
+            //Get the correct spreadsheet
+            SpreadsheetQuery query = new SpreadsheetQuery();
+            SpreadsheetFeed feed = service.Query(query);
+  
+            //If a spreadsheet with the given name exists, make that our spreadsheet
+            foreach (SpreadsheetEntry entry in feed.Entries)
+            {
+                if(entry.Title.Text.Equals(spreadsheet))
+                    this.spreadsheet = entry;
+            }
+          
+            //Else, state the spreadsheet is invalid
+            if(spreadsheet == null)
+            {
+                //TODO: give a nice error message.
+                Console.WriteLine("Spreadsheet " + spreadsheet + " not found");
+
+            }
+        }
+
+        /* ****************************************************************************** 
+         * function testConnection
+         * @return: boolean
+         * @description: returns true if the connection to the outside source is working
+         * ******************************************************************************/
+        public Boolean testConnection()
+        {
+            //TODO: Actually check for a connection.
+            return true;
+        }
+
+        /* ******************************************************************************
+         * function send
+         * @param: message : Loggermessage
+         * @return: boolean
+         * @description: Decides to which worksheet the message should go and passes it
+         *                  along. Returns false if the message is not the correct type.
+         * ******************************************************************************/
+        public Boolean send(LoggerMessage message)
+        {
+            //If the message if of the correct type...
+            if (message is TeamUpSpreadsheetMessage)
+            {
+                //Cast it and check for the message type and...
+                TeamUpSpreadsheetMessage msg = (TeamUpSpreadsheetMessage)message;
+                String queryString = "";
+                if (msg.Type == TeamUpSpreadsheetMessage.QUESTIONNAIRE)
+                    queryString = "Questionnaire";
+                else if(msg.Type == TeamUpSpreadsheetMessage.EVENT)
+                    queryString = "Events";
+
+                //Get the correct worksheet to perform the operation
+                AtomLink link = this.spreadsheet.Links.FindService(GDataSpreadsheetsNameTable.WorksheetRel, null);
+                WorksheetQuery workSheetQuery = new WorksheetQuery(link.HRef.ToString());
+                WorksheetFeed workSheetFeed = service.Query(workSheetQuery);
+                WorksheetEntry worksheet = null;
+                foreach (WorksheetEntry entry in workSheetFeed.Entries)
+                {
+                    if(entry.Title.Text.Equals(queryString))
+                        worksheet = entry;
+                }
+
+                //Return if the worksheet doesn't exist.
+                if(worksheet == null)
+                    return false;
+
+                //Else: send the message
+                return sendToWorksheet(worksheet, msg.Data);
+            }
+            else
+            {
+                return false;
+            }
+            
+        }
+        
+
+        /* ******************************************************************************
+         * function sendToWorksheet
+         * @param: worksheet : WorksheetEntry
+         * @param: row : List<String>
+         * @return: boolean
+         * @description: Takes the already formatted ArrayList and sends it to the specified worksheet
+         * ******************************************************************************/
+        Boolean sendToWorksheet(WorksheetEntry worksheet, List<String> row)
+        {
+            //TODO: Actually send stuff.
+            //Get the Google Docs URL
+            AtomLink listFeedLink = worksheet.Links.FindService(GDataSpreadsheetsNameTable.ListRel, null);
+            
+            //Create and perform the query to see what is in the spreadsheet
+            ListQuery query = new ListQuery(listFeedLink.HRef.ToString());
+            ListFeed feed = service.Query(query);
+            
+            //Get the first row of the spreadsheet
+            ListEntry firstRow;
+            if (feed.Entries.Count > 0)
+                firstRow = feed.Entries[0] as ListEntry;
+            else
+                return false;
+
+            ListEntry newRow = new ListEntry();
+
+            //Iterate through the first row elements and set the LocalNames and Values of the new cells
+            int i = 0;
+            foreach(ListEntry.Custom element in firstRow.Elements)
+            {
+               
+                ListEntry.Custom newElement = new ListEntry.Custom();
+                newElement.LocalName = element.LocalName;
+                
+                //Fillerhack, no session or playerID known atm.              
+                if(element.LocalName == "session")
+                {
+                    newElement.Value = "Filler";
+                }
+                //^--- FIX THIS
+                else if(i < row.Count)
+                {
+                    newElement.Value = row[i];
+                    i++;
+                }
+                Console.WriteLine("Worksheet "+worksheet.Title.Text+": Adding element in column " + element.LocalName + " with value " + newElement.Value);
+                newRow.Elements.Add(newElement);
+            }
+
+            //Try to insert the row
+            ListEntry insertedRow = feed.Insert(newRow) as ListEntry;
+            return true;
+           
+        }
+    }
+}
Index: Dev/LoggingTool/models/LoggerMessage.cs
===================================================================
--- Dev/LoggingTool/models/LoggerMessage.cs	(revision 5)
+++ Dev/LoggingTool/models/LoggerMessage.cs	(revision 5)
@@ -0,0 +1,12 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace LoggingTool.models
+{
+    abstract class LoggerMessage
+    {
+
+    }
+}
Index: Dev/LoggingTool/models/TeamUpEvent.cs
===================================================================
--- Dev/LoggingTool/models/TeamUpEvent.cs	(revision 5)
+++ Dev/LoggingTool/models/TeamUpEvent.cs	(revision 5)
@@ -0,0 +1,49 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Globalization;
+
+namespace LoggingTool.models
+{
+    class TeamUpEvent
+    {
+        private double timestamp;
+        private int eventID;
+        /* ******************************************************************************
+         * constructor TeamUpEvent
+         * @description: creates a TeamUpEvent object out of the raw input String
+         * ******************************************************************************/
+        public TeamUpEvent(String rawInput)
+        {
+            //Split the inputstring on |, the delimiter used in the input format
+            String[] splitInput = rawInput.Split('|');
+            timestamp = double.Parse(splitInput[0]);
+            eventID = int.Parse(splitInput[2]);
+        }
+
+
+         /* ******************************************************************************
+         * function toString
+         * @return: String
+         * @description: Returns a string representation of the TeamUpEvent object
+         * ******************************************************************************/
+        public String toString()
+        {
+            String res = "Timestamp :" + timestamp + "\n";
+            res = res + "EventID :" + eventID;
+            return res;
+        }
+
+
+        /* ******************************************************************************
+         * function toStringArray
+         * @return: List<String>
+         * @description: Returns a String array containing the information of the TeamUpEvent object
+         * ******************************************************************************/
+        public List<String> toStringArray()
+        {
+            return new List<String>() { timestamp.ToString(), eventID.ToString() };
+        }
+    }
+}
Index: Dev/LoggingTool/models/TeamUpQuestionnaire.cs
===================================================================
--- Dev/LoggingTool/models/TeamUpQuestionnaire.cs	(revision 5)
+++ Dev/LoggingTool/models/TeamUpQuestionnaire.cs	(revision 5)
@@ -0,0 +1,64 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+using System.Globalization;
+
+namespace LoggingTool.models
+{
+    class TeamUpQuestionnaire
+    {
+        private double timestamp;
+        private int playerID;
+        List<int> answers = new List<int>();
+
+        /* ******************************************************************************
+         * constructor TeamUpQuestionnaire
+         * @description: creates a TeamUpQuestionnaire object out of the raw input String
+         * ******************************************************************************/
+        public TeamUpQuestionnaire(String rawInput)
+        {
+            //Split the inputstring on |, the delimiter used in the input format
+            String[] splitInput = rawInput.Split('|');
+            timestamp = double.Parse(splitInput[0], CultureInfo.InvariantCulture);
+            playerID = int.Parse(splitInput[1]);
+            for (int i = 2; i < splitInput.Count(); i++)
+            {
+                answers.Add(int.Parse(splitInput[i]));
+            }
+        }
+
+        /* ******************************************************************************
+         * function toString
+         * @return: String
+         * @description: Returns a string representation of the TeamUpQuestionnaire object
+         * ******************************************************************************/
+        public String toString()
+        {
+            String res = "Timestamp: +" + timestamp + "\n";
+            res = res + "PlayerID: + " + playerID + "\n";
+            for (int i = 0; i < answers.Count; i++)
+            {
+                res = res + "Answer to question " + i + ": " + answers[i] + "\n";
+            }
+            return res;
+        }
+
+        /* ******************************************************************************
+         * function toStringArray
+         * @return: List<String>
+         * @description: Returns a String array containing the information of the TeamUpQuestionnaireObject
+         * ******************************************************************************/
+        public List<String> toStringArray()
+        {
+            List<String> res = new List<String>();
+            res.Add(timestamp.ToString());
+            res.Add(playerID.ToString());
+            for (int i = 0; i < answers.Count(); i++)
+            {
+                res.Add(answers[i].ToString());
+            }
+            return res;
+        }
+    }
+}
Index: Dev/LoggingTool/models/TeamUpSpreadsheetMessage.cs
===================================================================
--- Dev/LoggingTool/models/TeamUpSpreadsheetMessage.cs	(revision 5)
+++ Dev/LoggingTool/models/TeamUpSpreadsheetMessage.cs	(revision 5)
@@ -0,0 +1,30 @@
+﻿using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Text;
+
+namespace LoggingTool.models
+{
+    
+    class TeamUpSpreadsheetMessage : LoggerMessage
+    {
+        public const int QUESTIONNAIRE = 0;
+        public const int EVENT = 1;
+        int type;
+        List<String> data;
+
+        /* **************************************************************
+         * constructor TeamUpMessage
+         * @description: sets the type and data-array for this messsage
+         * **************************************************************/
+        public TeamUpSpreadsheetMessage(int type, List<String> data)
+        {
+            this.type = type;
+            this.data = data;
+        }
+
+        public int Type { get { return type; } }
+
+        public List<String> Data { get { return data; } }
+    }
+}
