mirror of
https://github.com/glest/glest-source.git
synced 2025-08-12 03:14:00 +02:00
- fixed one type of freeze in the custom menu
- some small opengl changes
This commit is contained in:
@@ -278,6 +278,8 @@ ConnectionSlot::~ConnectionSlot() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
||||||
|
//Chrono chrono;
|
||||||
|
//chrono.start();
|
||||||
try {
|
try {
|
||||||
clearThreadErrorList();
|
clearThreadErrorList();
|
||||||
|
|
||||||
@@ -285,6 +287,8 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||||||
slotThreadWorker->purgeCompletedEvents();
|
slotThreadWorker->purgeCompletedEvents();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
if(socket == NULL) {
|
if(socket == NULL) {
|
||||||
if(networkGameDataSynchCheckOkMap) networkGameDataSynchCheckOkMap = false;
|
if(networkGameDataSynchCheckOkMap) networkGameDataSynchCheckOkMap = false;
|
||||||
if(networkGameDataSynchCheckOkTile) networkGameDataSynchCheckOkTile = false;
|
if(networkGameDataSynchCheckOkTile) networkGameDataSynchCheckOkTile = false;
|
||||||
@@ -293,10 +297,22 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||||||
|
|
||||||
// Is the listener socket ready to be read?
|
// Is the listener socket ready to be read?
|
||||||
if(checkForNewClients == true) {
|
if(checkForNewClients == true) {
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] BEFORE accept new client connection, serverInterface->getOpenSlotCount() = %d\n",__FILE__,__FUNCTION__,__LINE__,serverInterface->getOpenSlotCount());
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] BEFORE accept new client connection, serverInterface->getOpenSlotCount() = %d\n",__FILE__,__FUNCTION__,__LINE__,serverInterface->getOpenSlotCount());
|
||||||
bool hasOpenSlots = (serverInterface->getOpenSlotCount() > 0);
|
bool hasOpenSlots = (serverInterface->getOpenSlotCount() > 0);
|
||||||
if(serverInterface->getServerSocket() != NULL &&
|
|
||||||
serverInterface->getServerSocket()->hasDataToRead() == true) {
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
|
bool hasData = (serverInterface->getServerSocket() != NULL && serverInterface->getServerSocket()->hasDataToRead() == true);
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
|
if(hasData == true) {
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] about to accept new client connection playerIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,playerIndex);
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] about to accept new client connection playerIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,playerIndex);
|
||||||
Socket *newSocket = serverInterface->getServerSocket()->accept();
|
Socket *newSocket = serverInterface->getServerSocket()->accept();
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] called accept new client connection playerIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,playerIndex);
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] called accept new client connection playerIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,playerIndex);
|
||||||
@@ -305,6 +321,8 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||||||
newSocket->setBlock(false);
|
newSocket->setBlock(false);
|
||||||
socket = newSocket;
|
socket = newSocket;
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
this->connectedTime = time(NULL);
|
this->connectedTime = time(NULL);
|
||||||
this->clearChatInfo();
|
this->clearChatInfo();
|
||||||
this->name = "";
|
this->name = "";
|
||||||
@@ -313,10 +331,14 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||||||
this->receivedNetworkGameStatus = false;
|
this->receivedNetworkGameStatus = false;
|
||||||
this->gotIntro = false;
|
this->gotIntro = false;
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
MutexSafeWrapper safeMutexSlot(&mutexPendingNetworkCommandList,string(__FILE__) + "_" + intToStr(__LINE__));
|
MutexSafeWrapper safeMutexSlot(&mutexPendingNetworkCommandList,string(__FILE__) + "_" + intToStr(__LINE__));
|
||||||
this->vctPendingNetworkCommandList.clear();
|
this->vctPendingNetworkCommandList.clear();
|
||||||
safeMutexSlot.ReleaseLock();
|
safeMutexSlot.ReleaseLock();
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
this->currentFrameCount = 0;
|
this->currentFrameCount = 0;
|
||||||
this->currentLagCount = 0;
|
this->currentLagCount = 0;
|
||||||
this->lastReceiveCommandListTime = 0;
|
this->lastReceiveCommandListTime = 0;
|
||||||
@@ -329,11 +351,18 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||||||
// this->slotThreadWorker->start();
|
// this->slotThreadWorker->start();
|
||||||
//}
|
//}
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
serverInterface->updateListen();
|
serverInterface->updateListen();
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] playerIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,playerIndex);
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] playerIndex = %d\n",__FILE__,__FUNCTION__,__LINE__,playerIndex);
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
//send intro message when connected
|
//send intro message when connected
|
||||||
if(socket != NULL) {
|
if(socket != NULL) {
|
||||||
RandomGen random;
|
RandomGen random;
|
||||||
@@ -348,6 +377,8 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||||||
sendMessage(&networkMessageIntro);
|
sendMessage(&networkMessageIntro);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
close();
|
close();
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
@@ -356,15 +387,23 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||||||
if(socket != NULL) {
|
if(socket != NULL) {
|
||||||
NetworkMessageIntro networkMessageIntro(sessionKey,getNetworkVersionString(), getHostName(), playerIndex, nmgstOk, 0, ServerSocket::getFTPServerPort());
|
NetworkMessageIntro networkMessageIntro(sessionKey,getNetworkVersionString(), getHostName(), playerIndex, nmgstOk, 0, ServerSocket::getFTPServerPort());
|
||||||
sendMessage(&networkMessageIntro);
|
sendMessage(&networkMessageIntro);
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
if(socket != NULL && socket->isConnected()) {
|
if(socket != NULL && socket->isConnected()) {
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
this->clearChatInfo();
|
this->clearChatInfo();
|
||||||
|
|
||||||
bool gotTextMsg = true;
|
bool gotTextMsg = true;
|
||||||
@@ -724,12 +763,18 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
validateConnection();
|
validateConnection();
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] calling close...\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] calling close...\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
close();
|
close();
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
@@ -740,7 +785,11 @@ void ConnectionSlot::update(bool checkForNewClients,int lockedSlotIndex) {
|
|||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] error detected [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] error detected [%s]\n",__FILE__,__FUNCTION__,__LINE__,ex.what());
|
||||||
|
|
||||||
threadErrorList.push_back(ex.what());
|
threadErrorList.push_back(ex.what());
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
void ConnectionSlot::validateConnection() {
|
void ConnectionSlot::validateConnection() {
|
||||||
|
@@ -351,11 +351,11 @@ void ServerInterface::updateSlot(ConnectionSlotEvent *event) {
|
|||||||
if(connectionSlot->isConnected() == false || socketTriggered == true) {
|
if(connectionSlot->isConnected() == false || socketTriggered == true) {
|
||||||
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] MUTEX LOCK held for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] MUTEX LOCK held for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
safeMutexSlot.ReleaseLock(true);
|
//safeMutexSlot.ReleaseLock(true);
|
||||||
connectionSlot->update(checkForNewClients,event->triggerId);
|
connectionSlot->update(checkForNewClients,event->triggerId);
|
||||||
|
|
||||||
//chrono.start();
|
//chrono.start();
|
||||||
safeMutexSlot.Lock();
|
//safeMutexSlot.Lock();
|
||||||
connectionSlot = slots[event->triggerId];
|
connectionSlot = slots[event->triggerId];
|
||||||
|
|
||||||
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] MUTEX LOCK held for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] MUTEX LOCK held for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
@@ -141,7 +141,7 @@ public:
|
|||||||
int getDataToRead(bool wantImmediateReply=false);
|
int getDataToRead(bool wantImmediateReply=false);
|
||||||
int send(const void *data, int dataSize);
|
int send(const void *data, int dataSize);
|
||||||
int receive(void *data, int dataSize);
|
int receive(void *data, int dataSize);
|
||||||
int peek(void *data, int dataSize);
|
int peek(void *data, int dataSize, bool mustGetData=true);
|
||||||
|
|
||||||
void setBlock(bool block);
|
void setBlock(bool block);
|
||||||
static void setBlock(bool block, PLATFORM_SOCKET socket);
|
static void setBlock(bool block, PLATFORM_SOCKET socket);
|
||||||
|
@@ -143,7 +143,7 @@ void ModelRendererGl::renderMesh(Mesh *mesh) {
|
|||||||
}
|
}
|
||||||
else{
|
else{
|
||||||
glEnable(GL_CULL_FACE);
|
glEnable(GL_CULL_FACE);
|
||||||
glPolygonOffset(0.05, 0);
|
glPolygonOffset(0.05f, 0.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
//set color
|
//set color
|
||||||
|
@@ -1206,23 +1206,41 @@ int Socket::receive(void *data, int dataSize) {
|
|||||||
return static_cast<int>(bytesReceived);
|
return static_cast<int>(bytesReceived);
|
||||||
}
|
}
|
||||||
|
|
||||||
int Socket::peek(void *data, int dataSize) {
|
int Socket::peek(void *data, int dataSize,bool mustGetData) {
|
||||||
|
//Chrono chrono;
|
||||||
|
//chrono.start();
|
||||||
|
|
||||||
const int MAX_PEEK_WAIT_SECONDS = 3;
|
const int MAX_PEEK_WAIT_SECONDS = 3;
|
||||||
|
|
||||||
ssize_t err = 0;
|
ssize_t err = 0;
|
||||||
if(isSocketValid() == true) {
|
if(isSocketValid() == true) {
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
MutexSafeWrapper safeMutex(&dataSynchAccessor,string(__FILE__) + "_" + intToStr(__LINE__) + "_" + intToStr(sock) + "_" + intToStr(dataSize));
|
MutexSafeWrapper safeMutex(&dataSynchAccessor,string(__FILE__) + "_" + intToStr(__LINE__) + "_" + intToStr(sock) + "_" + intToStr(dataSize));
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
err = recv(sock, reinterpret_cast<char*>(data), dataSize, MSG_PEEK);
|
err = recv(sock, reinterpret_cast<char*>(data), dataSize, MSG_PEEK);
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
}
|
}
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
if(err < 0 && getLastSocketError() != PLATFORM_SOCKET_TRY_AGAIN) {
|
if(err < 0 && getLastSocketError() != PLATFORM_SOCKET_TRY_AGAIN) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"[%s::%s Line: %d] ERROR PEEKING SOCKET DATA error while sending socket data, err = %d, error = %s\n",__FILE__,__FUNCTION__,__LINE__,err,getLastSocketErrorFormattedText().c_str());
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"[%s::%s Line: %d] ERROR PEEKING SOCKET DATA error while sending socket data, err = %d, error = %s\n",__FILE__,__FUNCTION__,__LINE__,err,getLastSocketErrorFormattedText().c_str());
|
||||||
//throwException(szBuf);
|
//throwException(szBuf);
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
disconnectSocket();
|
disconnectSocket();
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
}
|
}
|
||||||
else if(err < 0 && getLastSocketError() == PLATFORM_SOCKET_TRY_AGAIN) {
|
else if(err < 0 && getLastSocketError() == PLATFORM_SOCKET_TRY_AGAIN && mustGetData == true) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] #1 ERROR EAGAIN during peek, trying again...\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] #1 ERROR EAGAIN during peek, trying again...\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
time_t tStartTimer = time(NULL);
|
time_t tStartTimer = time(NULL);
|
||||||
while((err < 0 && getLastSocketError() == PLATFORM_SOCKET_TRY_AGAIN) &&
|
while((err < 0 && getLastSocketError() == PLATFORM_SOCKET_TRY_AGAIN) &&
|
||||||
(difftime(time(NULL),tStartTimer) <= MAX_PEEK_WAIT_SECONDS)) {
|
(difftime(time(NULL),tStartTimer) <= MAX_PEEK_WAIT_SECONDS)) {
|
||||||
@@ -1241,16 +1259,27 @@ int Socket::peek(void *data, int dataSize) {
|
|||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] #2 EAGAIN during peek, trying again returned: %d\n",__FILE__,__FUNCTION__,__LINE__,err);
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"In [%s::%s Line: %d] #2 EAGAIN during peek, trying again returned: %d\n",__FILE__,__FUNCTION__,__LINE__,err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
if(err <= 0) {
|
if(err <= 0) {
|
||||||
int iErr = getLastSocketError();
|
if(mustGetData == true || getLastSocketError() != PLATFORM_SOCKET_TRY_AGAIN) {
|
||||||
disconnectSocket();
|
int iErr = getLastSocketError();
|
||||||
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"[%s::%s Line: %d] DISCONNECTED SOCKET error while peeking socket data, err = %d, error = %s\n",__FILE__,__FUNCTION__,__LINE__,err,getLastSocketErrorFormattedText(&iErr).c_str());
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
//throwException(szBuf);
|
|
||||||
|
disconnectSocket();
|
||||||
|
|
||||||
|
SystemFlags::OutputDebug(SystemFlags::debugNetwork,"[%s::%s Line: %d] DISCONNECTED SOCKET error while peeking socket data, err = %d, error = %s\n",__FILE__,__FUNCTION__,__LINE__,err,getLastSocketErrorFormattedText(&iErr).c_str());
|
||||||
|
//throwException(szBuf);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//if(chrono.getMillis() > 1) printf("In [%s::%s Line: %d] action running for msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,(long long int)chrono.getMillis());
|
||||||
|
|
||||||
return static_cast<int>(err);
|
return static_cast<int>(err);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1369,12 +1398,11 @@ bool Socket::isConnected() {
|
|||||||
if(isWritable(false) == false) {
|
if(isWritable(false) == false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
//if the socket is readable it is connected if we can read a byte from it
|
//if the socket is readable it is connected if we can read a byte from it
|
||||||
if(isReadable()) {
|
if(isReadable()) {
|
||||||
char tmp;
|
char tmp;
|
||||||
int err = peek(&tmp, 1);
|
int err = peek(&tmp, 1, false);
|
||||||
if(err <= 0) {
|
if(err <= 0 && err != PLATFORM_SOCKET_TRY_AGAIN) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -18,6 +18,7 @@
|
|||||||
#include "sdl_private.h"
|
#include "sdl_private.h"
|
||||||
#include "noimpl.h"
|
#include "noimpl.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "opengl.h"
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
|
||||||
@@ -381,6 +382,13 @@ void Window::setupGraphicsScreen(int depthBits, int stencilBits, bool hardware_a
|
|||||||
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 1);
|
SDL_GL_SetAttribute(SDL_GL_BLUE_SIZE, 1);
|
||||||
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, newStencilBits);
|
SDL_GL_SetAttribute(SDL_GL_STENCIL_SIZE, newStencilBits);
|
||||||
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, newDepthBits);
|
SDL_GL_SetAttribute(SDL_GL_DEPTH_SIZE, newDepthBits);
|
||||||
|
|
||||||
|
// setup LOD bias factor
|
||||||
|
//const float lodBias = std::max(std::min( configHandler->Get("TextureLODBias", 0.0f) , 4.0f), -4.0f);
|
||||||
|
const float lodBias = std::max(std::min( 0.0f , 4.0f), -4.0f);
|
||||||
|
if (fabs(lodBias)>0.01f) {
|
||||||
|
glTexEnvf(GL_TEXTURE_FILTER_CONTROL,GL_TEXTURE_LOD_BIAS, lodBias );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef WIN32
|
#ifdef WIN32
|
||||||
|
Reference in New Issue
Block a user