mirror of
https://github.com/glest/glest-source.git
synced 2025-08-16 13:23:59 +02:00
- attempt to improve network performance and log more info regarding menu and network performance
This commit is contained in:
@@ -839,6 +839,9 @@ void MenuStateConnectedGame::update() {
|
|||||||
if(clientInterface != NULL && clientInterface->isConnected()) {
|
if(clientInterface != NULL && clientInterface->isConnected()) {
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] clientInterface = %p\n",__FILE__,__FUNCTION__,__LINE__,clientInterface);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d] clientInterface = %p\n",__FILE__,__FUNCTION__,__LINE__,clientInterface);
|
||||||
clientInterface->updateLobby();
|
clientInterface->updateLobby();
|
||||||
|
|
||||||
|
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(chrono.getMillis() > 0) chrono.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
@@ -857,6 +860,9 @@ void MenuStateConnectedGame::update() {
|
|||||||
switchSetupRequestFlagType=ssrft_None;
|
switchSetupRequestFlagType=ssrft_None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if(chrono.getMillis() > 0) SystemFlags::OutputDebug(SystemFlags::debugPerformance,"In [%s::%s Line: %d] took msecs: %lld\n",__FILE__,__FUNCTION__,__LINE__,chrono.getMillis());
|
||||||
|
if(chrono.getMillis() > 0) chrono.start();
|
||||||
|
|
||||||
//call the chat manager
|
//call the chat manager
|
||||||
chatManager.updateNetwork();
|
chatManager.updateNetwork();
|
||||||
|
|
||||||
@@ -865,15 +871,13 @@ void MenuStateConnectedGame::update() {
|
|||||||
console.update();
|
console.update();
|
||||||
|
|
||||||
//intro
|
//intro
|
||||||
if(clientInterface->getIntroDone())
|
if(clientInterface->getIntroDone()) {
|
||||||
{
|
|
||||||
labelInfo.setText(lang.get("WaitingHost"));
|
labelInfo.setText(lang.get("WaitingHost"));
|
||||||
//servers.setString(clientInterface->getServerName(), Ip(labelServerIp.getText()).getString());
|
//servers.setString(clientInterface->getServerName(), Ip(labelServerIp.getText()).getString());
|
||||||
}
|
}
|
||||||
|
|
||||||
//launch
|
//launch
|
||||||
if(clientInterface->getLaunchGame())
|
if(clientInterface->getLaunchGame()) {
|
||||||
{
|
|
||||||
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
SystemFlags::OutputDebug(SystemFlags::debugSystem,"In [%s::%s Line: %d]\n",__FILE__,__FUNCTION__,__LINE__);
|
||||||
|
|
||||||
//servers.save(serversSavedFile);
|
//servers.save(serversSavedFile);
|
||||||
|
@@ -1162,13 +1162,10 @@ void Socket::setBlock(bool block, PLATFORM_SOCKET socket){
|
|||||||
|
|
||||||
bool Socket::isReadable() {
|
bool Socket::isReadable() {
|
||||||
if(isSocketValid() == false) return false;
|
if(isSocketValid() == false) return false;
|
||||||
#ifndef WIN32
|
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
#else
|
|
||||||
TIMEVAL tv;
|
|
||||||
#endif
|
|
||||||
tv.tv_sec= 0;
|
tv.tv_sec= 0;
|
||||||
tv.tv_usec= 1;
|
tv.tv_usec= 0;
|
||||||
|
|
||||||
fd_set set;
|
fd_set set;
|
||||||
FD_ZERO(&set);
|
FD_ZERO(&set);
|
||||||
@@ -1194,11 +1191,7 @@ bool Socket::isReadable() {
|
|||||||
bool Socket::isWritable(bool waitOnDelayedResponse) {
|
bool Socket::isWritable(bool waitOnDelayedResponse) {
|
||||||
if(isSocketValid() == false) return false;
|
if(isSocketValid() == false) return false;
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
struct timeval tv;
|
struct timeval tv;
|
||||||
#else
|
|
||||||
TIMEVAL tv;
|
|
||||||
#endif
|
|
||||||
tv.tv_sec= 0;
|
tv.tv_sec= 0;
|
||||||
tv.tv_usec= 1;
|
tv.tv_usec= 1;
|
||||||
|
|
||||||
@@ -1207,8 +1200,7 @@ bool Socket::isWritable(bool waitOnDelayedResponse) {
|
|||||||
FD_SET(sock, &set);
|
FD_SET(sock, &set);
|
||||||
|
|
||||||
bool result = false;
|
bool result = false;
|
||||||
do
|
do {
|
||||||
{
|
|
||||||
int i = 0;
|
int i = 0;
|
||||||
{
|
{
|
||||||
//MutexSafeWrapper safeMutex(&dataSynchAccessor);
|
//MutexSafeWrapper safeMutex(&dataSynchAccessor);
|
||||||
|
Reference in New Issue
Block a user