Index: common/Message.h
===================================================================
--- common/Message.h	(revision 6e66ffdf57ffae5c067c3c8b3e2101b2e7d49e5e)
+++ common/Message.h	(revision 5f868c00086f84264d3338e38f380b246cafe046)
@@ -2,10 +2,12 @@
 #define _MESSAGE_H
 
-#define MSG_TYPE_REGISTER     1
-#define MSG_TYPE_LOGIN        2
-#define MSG_TYPE_LOGOUT       3
-#define MSG_TYPE_CHAT         4
-#define MSG_TYPE_PLAYER       5  // server sends this to update player positions
-#define MSG_TYPE_PLAYER_MOVE  6  // client sends this when a player wants to move
+#define MSG_TYPE_REGISTER      1
+#define MSG_TYPE_LOGIN         2
+#define MSG_TYPE_LOGOUT        3
+#define MSG_TYPE_CHAT          4
+#define MSG_TYPE_PLAYER        5  // server sends this to update player positions
+#define MSG_TYPE_PLAYER_MOVE   6  // client sends this when a player wants to move
+#define MSG_TYPE_OBJECT        7
+#define MSG_TYPE_REMOVE_OBJECT 8
 
 typedef struct
Index: common/WorldMap.cpp
===================================================================
--- common/WorldMap.cpp	(revision 6e66ffdf57ffae5c067c3c8b3e2101b2e7d49e5e)
+++ common/WorldMap.cpp	(revision 5f868c00086f84264d3338e38f380b246cafe046)
@@ -6,4 +6,5 @@
 #include <sstream>
 #include <cstdlib>
+#include <cstring>
 
 using namespace std;
@@ -64,4 +65,7 @@
 }
 
+vector<WorldMap::Object> WorldMap::getObjects() {
+   return *vctObjects;
+}
 vector<WorldMap::Object> WorldMap::getObjects(int x, int y) {
    vector<WorldMap::Object> vctObjectsInRegion;
@@ -78,5 +82,5 @@
 // used by the server to create new objects
 void WorldMap::addObject(WorldMap::ObjectType t, int x, int y) {
-   WorldMap::Object o(t, vctObjects->size(), x, y);
+   WorldMap::Object o(vctObjects->size(), t, x, y);
    vctObjects->push_back(o);
 }
@@ -96,7 +100,20 @@
 
    if (!foundObject) {
-      WorldMap::Object o(t, id, x, y);
+      WorldMap::Object o(id, t, x, y);
       vctObjects->push_back(o);
    }
+}
+
+bool WorldMap::removeObject(int id) {
+   vector<WorldMap::Object>::iterator it;
+
+   for (it = vctObjects->begin(); it != vctObjects->end(); it++) {
+      if (it->id == id) {
+         vctObjects->erase(it);
+         return true;
+      }
+   }
+
+   return false;  // no object with that id was found
 }
 
@@ -240,5 +257,5 @@
 /*** Functions for Object ***/
 
-WorldMap::Object::Object(ObjectType type, int id, int x, int y) {
+WorldMap::Object::Object(int id, ObjectType type, int x, int y) {
    this->type = type;
    this->id = id;
@@ -247,5 +264,5 @@
 }
 
-WorldMap::Object::Object(ObjectType type, int id, POSITION pos) {
+WorldMap::Object::Object(int id, ObjectType type, POSITION pos) {
    this->type = type;
    this->id = id;
@@ -255,2 +272,16 @@
 WorldMap::Object::~Object() {
 }
+
+void WorldMap::Object::serialize(char* buffer) {
+   memcpy(buffer, &this->type, 4);
+   memcpy(buffer+4, &this->id, 4);
+   memcpy(buffer+8, &this->pos.x, 4);
+   memcpy(buffer+12, &this->pos.y, 4);
+}
+
+void WorldMap::Object::deserialize(char* buffer) {
+   memcpy(&this->type, buffer, 4);
+   memcpy(&this->id, buffer+4, 4);
+   memcpy(&this->pos.x, buffer+8, 4);
+   memcpy(&this->pos.y, buffer+12, 4);
+}
Index: common/WorldMap.h
===================================================================
--- common/WorldMap.h	(revision 6e66ffdf57ffae5c067c3c8b3e2101b2e7d49e5e)
+++ common/WorldMap.h	(revision 5f868c00086f84264d3338e38f380b246cafe046)
@@ -37,8 +37,11 @@
       POSITION pos;
 
-      Object(ObjectType type, int id, int x, int y);
-      Object(ObjectType type, int id, POSITION pos);
+      Object(int id, ObjectType type, int x, int y);
+      Object(int id, ObjectType type, POSITION pos);
 
       ~Object();
+
+      void serialize(char* buffer);
+      void deserialize(char* buffer);
    };
 
@@ -58,7 +61,10 @@
    void setStructure(int x, int y, StructureType type);
 
+   vector<Object> getObjects();
    vector<Object> getObjects(int x, int y);
+
    void addObject(ObjectType type, int x, int y);
    void updateObject(int id, WorldMap::ObjectType t, int x, int y);
+   bool removeObject(int id);
 
    static WorldMap* createDefaultMap();
Index: server/server.cpp
===================================================================
--- server/server.cpp	(revision 6e66ffdf57ffae5c067c3c8b3e2101b2e7d49e5e)
+++ server/server.cpp	(revision 5f868c00086f84264d3338e38f380b246cafe046)
@@ -98,6 +98,16 @@
    // add some items to the map. They will be sent out
    // to players when they login
-   // m->addObject(x*25+12, y*25+12, OBJECT_BLUE_FLAG);
-   // m->addObject(x*25+12, y*25+12, OBJECT_RED_FLAG);
+   for (int y=0; y<gameMap->height; y++) {
+      for (int x=0; x<gameMap->width; x++) {
+         switch (gameMap->getStructure(x, y)) {
+            case WorldMap::STRUCTURE_BLUE_FLAG:
+               gameMap->addObject(WorldMap::OBJECT_BLUE_FLAG, x*25+12, y*25+12);
+               break;
+            case WorldMap::STRUCTURE_RED_FLAG:
+               gameMap->addObject(WorldMap::OBJECT_RED_FLAG, x*25+12, y*25+12);
+               break;
+         }
+      }
+   }
 
    sock = socket(AF_INET, SOCK_DGRAM, 0);
@@ -259,5 +269,18 @@
 
                cout << "sending info about " << it->second.name  << endl;
-               cout << "sending ind " << it->second.id  << endl;
+               cout << "sending id " << it->second.id  << endl;
+               if ( sendMessage(&serverMsg, sock, &from) < 0 )
+                  error("sendMessage");
+            }
+
+            // tell the new player about all map objects
+            // (currently just the flags)
+            serverMsg.type = MSG_TYPE_OBJECT;
+            vector<WorldMap::Object> vctObjects = gameMap->getObjects();
+            vector<WorldMap::Object>::iterator itObjects;
+            cout << "sending items" << endl;
+            for (itObjects = vctObjects.begin(); itObjects != vctObjects.end(); itObjects++) {
+               itObjects->serialize(serverMsg.buffer);
+               cout << "sending item id " << itObjects->id  << endl;
                if ( sendMessage(&serverMsg, sock, &from) < 0 )
                   error("sendMessage");
