Deleted:
/trunk/gogo/src/MUIDSanta.cpp
/trunk/gogo/src/MUIDSanta.h
Modified:
/trunk/gogo/src/CMakeLists.txt
/trunk/gogo/src/GoGoClient.cpp
/trunk/gogo/src/GoGoFactory.h
=======================================
--- /trunk/gogo/src/MUIDSanta.cpp Fri Jun 25 19:38:48 2010
+++ /dev/null
@@ -1,35 +0,0 @@
-#include "MUIDSanta.h"
-
-#if defined(_MSC_VER)
- #include <windows.h>
-#endif
-
-using namespace boost;
-
-MUIDSanta::MUIDSanta()
-{
- next = 1;
-}
-
-MUID MUIDSanta::get()
-{
-// TODO(Clark): Move this ugly #ifdef hell out into an "atomics" library
of sorts.
-#if defined(__GNUC__) || defined(__clang__)
- return __sync_fetch_and_add(&next, 1);
-#elif defined(_MSC_VER)
- return InterlockedIncrement(&next);
-#else
- #error "Unsupported platform! Please write your own lock-free increment."
-#endif
-}
-
-void MUIDSanta::give_back(MUID /*id*/)
-{
- // Unimplemented for now... we don't need it until the number of clients
- // exceeds 2^64. In order for that to happen, the entire population of
- // the world would need to connect 2.75 * 10^9 times EACH. And even then,
- // this algorithm won't generate any collisions unless there's been
someone
- // on from the very beginning. Suffice to say, there's no pressing need
- // to make this algorithm "right", or any more complex until a bug report
- // is filed.
-}
=======================================
--- /trunk/gogo/src/MUIDSanta.h Sat Jun 26 14:21:44 2010
+++ /dev/null
@@ -1,14 +0,0 @@
-#pragma once
-#include <gunz/simple_types.h>
-
-// This class controls the MUIDs of various in-game objects.
-class MUIDSanta
-{
-private:
- volatile MUID next; // The "next" MUID to give out.
-
-public:
- MUIDSanta();
- MUID get();
- void give_back(MUID id);
-};
=======================================
--- /trunk/gogo/src/CMakeLists.txt Sat Jun 26 14:21:44 2010
+++ /trunk/gogo/src/CMakeLists.txt Sun Jun 27 09:06:34 2010
@@ -3,7 +3,6 @@
ConsoleLogger.h
GoGoClient.h
GoGoFactory.h
- MUIDSanta.h
error_codes.h
# Feel free to add more header files when they're added.
)
@@ -14,7 +13,6 @@
GoGoClient.cpp
GoGoFactory.cpp
main.cpp
- MUIDSanta.cpp
# Feel free to add more source files when they're added.
)
=======================================
--- /trunk/gogo/src/GoGoClient.cpp Fri Jun 25 20:20:38 2010
+++ /trunk/gogo/src/GoGoClient.cpp Sun Jun 27 09:06:34 2010
@@ -4,7 +4,7 @@
#include <cockpit/packet/Registry.h>
#include <cockpit/packet/Lookup.h>
-#include "MUIDSanta.h"
+#include <gunz/MUIDSanta.h>
#include <boost/bind.hpp>
=======================================
--- /trunk/gogo/src/GoGoFactory.h Tue Jun 22 11:02:27 2010
+++ /trunk/gogo/src/GoGoFactory.h Sun Jun 27 09:06:34 2010
@@ -3,7 +3,7 @@
#include <cockpit/ClientHandlerFactory.h>
#include <cockpit/Logger.h>
#include <database/GunzDB.h>
-#include "MUIDSanta.h"
+#include <gunz/MUIDSanta.h>
class GoGoFactory : public cockpit::ClientHandlerFactory
{