Index: client/Client/main.cpp
===================================================================
--- client/Client/main.cpp	(revision 2488852e451359e9522acfbd77cbb1c85fc0f292)
+++ client/Client/main.cpp	(revision d2b411afb1f24e8dc56eee5b72ceefd6d51e5344)
@@ -43,5 +43,13 @@
 const int BOUNCER_SIZE = 32;
 enum MYKEYS {
-   KEY_UP, KEY_DOWN, KEY_LEFT, KEY_RIGHT
+   KEY_UP,
+   KEY_DOWN,
+   KEY_LEFT,
+   KEY_RIGHT
+};
+
+enum STATE {
+   STATE_START,
+   STATE_LOGIN
 };
  
@@ -58,4 +66,6 @@
    bool doexit = false;
 
+   int state = STATE_START;
+
    chat chatConsole;
 
@@ -130,5 +140,5 @@
    struct sockaddr_in server, from;
    struct hostent *hp;
-   char buffer[256];
+   //char buffer[256];
    NETWORK_MSG msgTo, msgFrom;
 
@@ -200,5 +210,18 @@
                cout << "input: " << input << endl;
                strcpy(msgTo.buffer, input.c_str());
-               
+
+               switch(state)
+               {
+               case STATE_START:
+                  msgTo.type = MSG_TYPE_LOGIN;
+                  break;
+               case STATE_LOGIN:
+                  msgTo.type = MSG_TYPE_CHAT;
+                  break;
+               default:
+                  cout << "The state has an invalid value: " << state << endl;
+                  break;
+               }
+
                n=sendMessage(&msgTo, sock, &server);
                if (n < 0)
@@ -209,6 +232,17 @@
                   error("receiveMessage");
 
-               chatConsole.addLine(string(msgFrom.buffer));
-               cout << "Added new line" << endl;
+               switch(state)
+               {
+               case STATE_START:
+                  state = STATE_LOGIN;
+                  break;
+               case STATE_LOGIN:
+                  chatConsole.addLine(string(msgFrom.buffer));
+                  cout << "Added new line" << endl;
+                  break;
+               default:
+                  cout << "The state has an invalid value: " << state << endl;
+                  break;
+               }
             }
          }else {
