Fixed minor server network bug, modified shader to get visual

This commit is contained in:
Dennis Andersen 2014-01-14 10:15:50 +01:00
parent 844aa37906
commit 82de85d1ac
5 changed files with 14 additions and 11 deletions

View File

@ -17,7 +17,6 @@ GameClient::GameClient(SmartPointer<LobbyClient> client, Game::PlayerData player
{ {
this->callbackValue = value; this->callbackValue = value;
this->client = client; this->client = client;
//this->player = new GameLogic::Player();
this->id = gameClientIDCount++; this->id = gameClientIDCount++;
this->player = player; this->player = player;
Oyster::Callback::OysterCallback<void, NetworkSession::NetEvent> c; Oyster::Callback::OysterCallback<void, NetworkSession::NetEvent> c;
@ -32,7 +31,6 @@ GameClient::~GameClient()
this->player.playerID = 0; this->player.playerID = 0;
this->player.teamID = 0; this->player.teamID = 0;
this->id = -1; this->id = -1;
//this->player.Release();
} }
void GameClient::SetCallback(Oyster::Callback::OysterCallback<void, NetworkSession::NetEvent> value) void GameClient::SetCallback(Oyster::Callback::OysterCallback<void, NetworkSession::NetEvent> value)
@ -40,10 +38,6 @@ void GameClient::SetCallback(Oyster::Callback::OysterCallback<void, NetworkSessi
this->callbackValue = value; this->callbackValue = value;
} }
//GameLogic::Player* GameClient::GetPlayer()
//{
// return this->player.Get();
//}
GameLogic::Game::PlayerData* GameClient::GetPlayer() GameLogic::Game::PlayerData* GameClient::GetPlayer()
{ {
return &this->player; return &this->player;

View File

@ -144,12 +144,15 @@ namespace DanBias
else else
{ {
for (int i = 0; i < this->clients.Size(); i++) for (int i = 0; i < this->clients.Size(); i++)
{
if(this->clients[i])
{ {
s->Attach(this->clients[i]->ReleaseClient()); s->Attach(this->clients[i]->ReleaseClient());
RemoveClient(this->clients[i]); RemoveClient(this->clients[i]);
} }
} }
} }
}
void GameSession::Clean() void GameSession::Clean()
{ {

View File

@ -108,6 +108,7 @@ int Connection::InitiateClient()
int Connection::Disconnect() int Connection::Disconnect()
{ {
if(this->closed) return -1;
int val = CloseSocket(this->socket); int val = CloseSocket(this->socket);
this->socket = -1; this->socket = -1;
this->closed = true; this->closed = true;
@ -117,6 +118,8 @@ int Connection::Disconnect()
int Connection::Send(OysterByte &bytes) int Connection::Send(OysterByte &bytes)
{ {
if(this->closed) return -1;
int nBytes; int nBytes;
nBytes = send(this->socket, bytes, bytes.GetSize(), 0); nBytes = send(this->socket, bytes, bytes.GetSize(), 0);
@ -130,6 +133,7 @@ int Connection::Send(OysterByte &bytes)
int Connection::Recieve(OysterByte &bytes) int Connection::Recieve(OysterByte &bytes)
{ {
if(this->closed) return -1;
int nBytes; int nBytes;
bytes.Resize(1000); bytes.Resize(1000);
@ -150,6 +154,8 @@ int Connection::Recieve(OysterByte &bytes)
//Listen will only return the correct socket or -1 for failure. //Listen will only return the correct socket or -1 for failure.
int Connection::Listen() int Connection::Listen()
{ {
if(this->closed) return -1;
int clientSocket; int clientSocket;
if((clientSocket = (int)accept(this->socket, NULL, NULL)) == INVALID_SOCKET) if((clientSocket = (int)accept(this->socket, NULL, NULL)) == INVALID_SOCKET)
{ {

View File

@ -7,6 +7,6 @@ RWTexture2D<float4> Output;
[numthreads(16, 16, 1)] [numthreads(16, 16, 1)]
void main( uint3 DTid : SV_DispatchThreadID ) void main( uint3 DTid : SV_DispatchThreadID )
{ {
//Output[DTid.xy] = Diffuse[DTid.xy] + Specular[DTid.xy] + Diffuse[DTid.xy] * Ambient[DTid.xy/4].w;// + float4(Ambient[DTid.xy/4].xyz,1); GLOW Output[DTid.xy] = Diffuse[DTid.xy] + Specular[DTid.xy] + Diffuse[DTid.xy] * Ambient[DTid.xy/4].w;// + float4(Ambient[DTid.xy/4].xyz,1); GLOW
Output[DTid.xy] = Diffuse[DTid.xy]; //Output[DTid.xy] = Diffuse[DTid.xy];
} }

View File

@ -32,7 +32,7 @@ public:
{ {
parent = 0; parent = 0;
hInstance = NULL; hInstance = NULL;
windowName = L"おはよう"; windowName = L"Window";
windowSize.x = 800; windowSize.x = 800;
windowSize.y = 600; windowSize.y = 600;
windowPosition.x = 0; windowPosition.x = 0;