Index: code/branches/FICN/src/network/Server.cc
===================================================================
--- code/branches/FICN/src/network/Server.cc	(revision 660)
+++ code/branches/FICN/src/network/Server.cc	(revision 777)
@@ -11,14 +11,21 @@
 //
 
+#include <iostream>
 
+#include "ConnectionManager.h"
+#include "PacketTypes.h"
+#include "GameStateManager.h"
+#include "ClientInformation.h"
+//#include "NetworkFrameListener.h"
 #include "Server.h"
 
-namespace network{
 
+namespace network
+{
   /**
-   * Constructor for default values (bindaddress is set to ENET_HOST_ANY
-   *
-   */
-  Server::Server(){
+  * Constructor for default values (bindaddress is set to ENET_HOST_ANY
+  *
+  */
+  Server::Server() {
     packet_gen = PacketGenerator();
     clients = new ClientInformation(true);
@@ -28,9 +35,9 @@
 
   /**
-   * Constructor
-   * @param port Port to listen on
-   * @param bindAddress Address to listen on
-   */
-  Server::Server(int port, std::string bindAddress){
+  * Constructor
+  * @param port Port to listen on
+  * @param bindAddress Address to listen on
+  */
+  Server::Server(int port, std::string bindAddress) {
     packet_gen = PacketGenerator();
     clients = new ClientInformation();
@@ -40,9 +47,9 @@
 
   /**
-   * Constructor
-   * @param port Port to listen on
-   * @param bindAddress Address to listen on
-   */
-  Server::Server(int port, const char *bindAddress){
+  * Constructor
+  * @param port Port to listen on
+  * @param bindAddress Address to listen on
+  */
+  Server::Server(int port, const char *bindAddress) {
     packet_gen = PacketGenerator();
     clients = new ClientInformation();
@@ -52,7 +59,7 @@
 
   /**
-   * This function opens the server by creating the listener thread
-   */
-  void Server::open(){
+  * This function opens the server by creating the listener thread
+  */
+  void Server::open() {
     connection->createListener();
     return;
@@ -60,7 +67,7 @@
 
   /**
-   * This function closes the server
-   */
-  void Server::close(){
+  * This function closes the server
+  */
+  void Server::close() {
     connection->quitListener();
     return;
@@ -68,9 +75,9 @@
 
   /**
-   * This function sends out a message to all clients
-   * @param msg message
-   * @return true/false
-   */
-  bool Server::sendMSG(std::string msg){
+  * This function sends out a message to all clients
+  * @param msg message
+  * @return true/false
+  */
+  bool Server::sendMSG(std::string msg) {
     ENetPacket *packet = packet_gen.chatMessage(msg.c_str());
     //std::cout <<"adding packets" << std::endl;
@@ -79,10 +86,11 @@
     return connection->sendPackets();
   }
+
   /**
-   * This function sends out a message to all clients
-   * @param msg message
-   * @return true/false
-   */
-  bool Server::sendMSG(const char *msg){
+  * This function sends out a message to all clients
+  * @param msg message
+  * @return true/false
+  */
+  bool Server::sendMSG(const char *msg) {
     ENetPacket *packet = packet_gen.chatMessage(msg);
     std::cout <<"adding Packets" << std::endl;
@@ -90,6 +98,6 @@
     //std::cout <<"added packets" << std::endl;
     if (connection->sendPackets()){
-	std::cout << "Sucessfully" << std::endl;
-	return true;
+      std::cout << "Sucessfully" << std::endl;
+      return true;
     }
     return false;
@@ -97,9 +105,9 @@
 
   /**
-   * Run this function once every tick
-   * calls processQueue and updateGamestate
-   * @param time time since last tick
-   */
-  void Server::tick(float time){
+  * Run this function once every tick
+  * calls processQueue and updateGamestate
+  * @param time time since last tick
+  */
+  void Server::tick(float time) {
     processQueue();
     updateGamestate();
@@ -108,7 +116,7 @@
 
   /**
-   * processes all the packets waiting in the queue
-   */
-  void Server::processQueue(){
+  * processes all the packets waiting in the queue
+  */
+  void Server::processQueue() {
     ENetPacket *packet;
     int clientID=-1;
@@ -121,7 +129,7 @@
 
   /**
-   * takes a new snapshot of the gamestate and sends it to the clients
-   */
-  void Server::updateGamestate(){
+  * takes a new snapshot of the gamestate and sends it to the clients
+  */
+  void Server::updateGamestate() {
     gamestates->update();
     //std::cout << "updated gamestate, sending it" << std::endl;
@@ -131,7 +139,7 @@
 
   /**
-   * sends the gamestate
-   */
-  bool Server::sendGameState(){
+  * sends the gamestate
+  */
+  bool Server::sendGameState() {
     std::cout << "starting gamestate" << std::endl;
     ClientInformation *temp = clients;
@@ -160,9 +168,9 @@
     if(added)
       return connection->sendPackets();
-    else return false;
-    //return true;
+    else
+      return false;
   }
 
-  void Server::processAck( ack *data, int clientID){
+  void Server::processAck( ack *data, int clientID) {
     clients->findClient(clientID)->setGamestateID(data->a);
   }
