Changeset - r14233:1f976749061a
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-01-13 15:03:34
rubidium@openttd.org
(svn r18794) -Codechange: add local company and network 'state' to the crash log
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/crashlog.cpp
Show inline comments
 
@@ -21,16 +21,18 @@
 
#include "music/music_driver.hpp"
 
#include "sound/sound_driver.hpp"
 
#include "video/video_driver.hpp"
 
#include "saveload/saveload.h"
 
#include "screenshot.h"
 
#include "gfx_func.h"
 
#include "network/network.h"
 

	
 
#include <squirrel.h>
 
#include "ai/ai_info.hpp"
 
#include "company_base.h"
 
#include "company_func.h"
 

	
 
#include <time.h>
 

	
 
/* static */ const char *CrashLog::message = NULL;
 
/* static */ char *CrashLog::gamelog_buffer = NULL;
 
/* static */ const char *CrashLog::gamelog_last = NULL;
 
@@ -85,26 +87,28 @@ char *CrashLog::LogConfiguration(char *b
 
			"Configuration:\n"
 
			" Blitter:      %s\n"
 
			" Graphics set: %s\n"
 
			" Language:     %s\n"
 
			" Music driver: %s\n"
 
			" Music set:    %s\n"
 
			" Network:      %s\n"
 
			" Sound driver: %s\n"
 
			" Sound set:    %s\n"
 
			" Video driver: %s\n\n",
 
			BlitterFactoryBase::GetCurrentBlitter() == NULL ? "none" : BlitterFactoryBase::GetCurrentBlitter()->GetName(),
 
			BaseGraphics::GetUsedSet() == NULL ? "none" : BaseGraphics::GetUsedSet()->name,
 
			StrEmpty(_dynlang.curr_file) ? "none" : _dynlang.curr_file,
 
			_music_driver == NULL ? "none" : _music_driver->GetName(),
 
			BaseMusic::GetUsedSet() == NULL ? "none" : BaseMusic::GetUsedSet()->name,
 
			_networking ? (_network_server ? "server" : "client") : "no",
 
			_sound_driver == NULL ? "none" : _sound_driver->GetName(),
 
			BaseSounds::GetUsedSet() == NULL ? "none" : BaseSounds::GetUsedSet()->name,
 
			_video_driver == NULL ? "none" : _video_driver->GetName()
 
	);
 

	
 
	buffer += seprintf(buffer, last, "AI Configuration:\n");
 
	buffer += seprintf(buffer, last, "AI Configuration (local: %i):\n", (int)_local_company);
 
	const Company *c;
 
	FOR_ALL_COMPANIES(c) {
 
		if (c->ai_info == NULL) {
 
			buffer += seprintf(buffer, last, " %2i: Human\n", (int)c->index);
 
		} else {
 
			buffer += seprintf(buffer, last, " %2i: %s (v%d)\n", (int)c->index, c->ai_info->GetName(), c->ai_info->GetVersion());
0 comments (0 inline, 0 general)