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->client = client;
//this->player = new GameLogic::Player();
this->id = gameClientIDCount++;
this->player = player;
Oyster::Callback::OysterCallback<void, NetworkSession::NetEvent> c;
@ -32,7 +31,6 @@ GameClient::~GameClient()
this->player.playerID = 0;
this->player.teamID = 0;
this->id = -1;
//this->player.Release();
}
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;
}
//GameLogic::Player* GameClient::GetPlayer()
//{
// return this->player.Get();
//}
GameLogic::Game::PlayerData* GameClient::GetPlayer()
{
return &this->player;

View File

@ -145,8 +145,11 @@ namespace DanBias
{
for (int i = 0; i < this->clients.Size(); i++)
{
s->Attach(this->clients[i]->ReleaseClient());
RemoveClient(this->clients[i]);
if(this->clients[i])
{
s->Attach(this->clients[i]->ReleaseClient());
RemoveClient(this->clients[i]);
}
}
}
}

View File

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

View File

@ -7,6 +7,6 @@ RWTexture2D<float4> Output;
[numthreads(16, 16, 1)]
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];
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];
}

View File

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