Some wierd stuff is going on here

This commit is contained in:
dean11 2013-12-12 12:54:08 +01:00
parent d0bd60c856
commit 693b9df928
2 changed files with 13 additions and 3 deletions

View File

@ -13,12 +13,14 @@ namespace DanBias
{ {
using namespace Oyster::Network; using namespace Oyster::Network;
void GameServer::ClientConnectCallback(NetworkClient client) void GameServer::ClientConnectCallback(NetworkClient client)
{ {
printf("Client connected!\n"); printf("Client connected!\n");
GameLogic::Protocol_TEST t; GameLogic::Protocol_TEST t;
t.text = "Hello"; t.text = "Hello";
client.Send(t); client.Send(t);
c = client;
} }
GameServer::GameServer() GameServer::GameServer()
: initiated(0) : initiated(0)

View File

@ -42,7 +42,10 @@ using namespace Utility::DynamicMemory;
ThreadData() {} ThreadData() {}
~ThreadData() {} ~ThreadData() {}
ThreadData(const ThreadData&) {}; ThreadData(const ThreadData&)
{};
const ThreadData& operator =(const ThreadData& o)
{};
}; };
struct OysterThread::PrivateData struct OysterThread::PrivateData
{ {
@ -60,9 +63,14 @@ using namespace Utility::DynamicMemory;
{ {
threadData = o.threadData; threadData = o.threadData;
} }
const PrivateData& operator=(const PrivateData& o)
{
threadData = o.threadData;
}
~PrivateData() ~PrivateData()
{ {
//@todo TODO: Make detatch avalible. //@todo TODO: Make detatch avalible.
//if(!this->threadData->workerThread->joinable())
this->threadData->workerThread->detach(); this->threadData->workerThread->detach();
this->threadData->owner = 0; this->threadData->owner = 0;
@ -75,8 +83,6 @@ using namespace Utility::DynamicMemory;
#pragma endregion #pragma endregion
int tempId = 0;
std::vector<int> IDS;
static void ThreadingFunction(SmartPointer<ThreadData> &origin) static void ThreadingFunction(SmartPointer<ThreadData> &origin)
{ {
@ -159,6 +165,8 @@ OysterThread::OysterThread(const OysterThread& original)
} }
const OysterThread& OysterThread::operator=(const OysterThread& original) const OysterThread& OysterThread::operator=(const OysterThread& original)
{ {
delete this->privateData;
this->privateData = new PrivateData(*original.privateData);
return *this; return *this;
} }
OysterThread::~OysterThread() OysterThread::~OysterThread()