Changeset - r4854:1c5a86166ae1
[Not reviewed]
master
0 7 0
Darkvater - 18 years ago 2006-10-15 17:01:19
darkvater@openttd.org
(svn r6780) -Codechange: Remove GPMI leftovers (-b impersonisation of AI in MP).
7 files changed with 7 insertions and 67 deletions:
0 comments (0 inline, 0 general)
ai/ai.c
Show inline comments
 
@@ -149,115 +149,99 @@ static void AI_RunTick(PlayerID player)
 

	
 
	Player *p = GetPlayer(player);
 
	_current_player = player;
 

	
 
	if (_patches.ainew_active) {
 
		AiNewDoGameLoop(p);
 
	} else {
 
		/* Enable all kind of cheats the old AI needs in order to operate correctly... */
 
		_is_old_ai_player = true;
 
		AiDoGameLoop(p);
 
		_is_old_ai_player = false;
 
	}
 
}
 

	
 

	
 
/**
 
 * The gameloop for AIs.
 
 *  Handles one tick for all the AIs.
 
 */
 
void AI_RunGameLoop(void)
 
{
 
	/* Don't do anything if ai is disabled */
 
	if (!_ai.enabled) return;
 

	
 
	/* Don't do anything if we are a network-client
 
	 *  (too bad when a client joins, he thinks the AIs are real, so it wants to control
 
	 *   them.. this avoids that, while loading a network game in singleplayer, does make
 
	 *   the AIs to continue ;))
 
	 */
 
	if (_networking && !_network_server && !_ai.network_client) return;
 
	/* Don't do anything if we are a network-client */
 
	if (_networking && !_network_server) return;
 

	
 
	/* New tick */
 
	_ai.tick++;
 

	
 
	/* Make sure the AI follows the difficulty rule.. */
 
	assert(_opt.diff.competitor_speed <= 4);
 
	if ((_ai.tick & ((1 << (4 - _opt.diff.competitor_speed)) - 1)) != 0) return;
 

	
 
	/* Check for AI-client (so joining a network with an AI) */
 
	if (_ai.network_client && _ai_player[_ai.network_playas].active) {
 
		/* Run the script */
 
		AI_DequeueCommands(_ai.network_playas);
 
		AI_RunTick(_ai.network_playas);
 
	} else if (!_networking || _network_server) {
 
	if (!_networking || _network_server) {
 
		/* Check if we want to run AIs (server or SP only) */
 
		const Player* p;
 

	
 
		FOR_ALL_PLAYERS(p) {
 
			if (p->is_active && p->is_ai) {
 
				/* This should always be true, else something went wrong... */
 
				assert(_ai_player[p->index].active);
 

	
 
				/* Run the script */
 
				AI_DequeueCommands(p->index);
 
				AI_RunTick(p->index);
 
			}
 
		}
 
	}
 

	
 
	_current_player = OWNER_NONE;
 
}
 

	
 
/**
 
 * A new AI sees the day of light. You can do here what ever you think is needed.
 
 */
 
void AI_StartNewAI(PlayerID player)
 
{
 
	assert(IsValidPlayer(player));
 

	
 
	/* Called if a new AI is booted */
 
	_ai_player[player].active = true;
 
}
 

	
 
/**
 
 * This AI player died. Give it some chance to make a final puf.
 
 */
 
void AI_PlayerDied(PlayerID player)
 
{
 
	if (_ai.network_client && _ai.network_playas == player) {
 
		_ai.network_playas = PLAYER_SPECTATOR;
 
	}
 

	
 
	/* Called if this AI died */
 
	_ai_player[player].active = false;
 
}
 

	
 
/**
 
 * Initialize some AI-related stuff.
 
 */
 
void AI_Initialize(void)
 
{
 
	bool ai_network_client = _ai.network_client;
 

	
 
	/* First, make sure all AIs are DEAD! */
 
	AI_Uninitialize();
 

	
 
	memset(&_ai, 0, sizeof(_ai));
 
	memset(&_ai_player, 0, sizeof(_ai_player));
 

	
 
	_ai.network_client = ai_network_client;
 
	_ai.network_playas = PLAYER_SPECTATOR;
 
	_ai.enabled = true;
 
}
 

	
 
/**
 
 * Deinitializer for AI-related stuff.
 
 */
 
void AI_Uninitialize(void)
 
{
 
	const Player* p;
 

	
 
	FOR_ALL_PLAYERS(p) {
 
		if (p->is_active && p->is_ai) AI_PlayerDied(p->index);
 
	}
 
}
ai/ai.h
Show inline comments
 
@@ -11,52 +11,48 @@ typedef struct AICommand {
 
	uint32 tile;
 
	uint32 p1;
 
	uint32 p2;
 
	uint32 procc;
 
	CommandCallback* callback;
 

	
 
	char *text;
 
	uint uid;
 

	
 
	struct AICommand *next;
 
} AICommand;
 

	
 
/* The struct for an AIScript Player */
 
typedef struct AIPlayer {
 
	bool active;            ///< Is this AI active?
 
	AICommand *queue;       ///< The commands that he has in his queue
 
	AICommand *queue_tail;  ///< The tail of this queue
 
} AIPlayer;
 

	
 
/* The struct to keep some data about the AI in general */
 
typedef struct AIStruct {
 
	/* General */
 
	bool enabled;           ///< Is AI enabled?
 
	uint tick;              ///< The current tick (something like _frame_counter, only for AIs)
 

	
 
	/* For network-clients (a OpenTTD client who acts as an AI connected to a server) */
 
	bool network_client;    ///< Are we a network_client?
 
	uint8 network_playas;   ///< The current network player we are connected as
 
} AIStruct;
 

	
 
VARDEF AIStruct _ai;
 
VARDEF AIPlayer _ai_player[MAX_PLAYERS];
 

	
 
// ai.c
 
void AI_StartNewAI(PlayerID player);
 
void AI_PlayerDied(PlayerID player);
 
void AI_RunGameLoop(void);
 
void AI_Initialize(void);
 
void AI_Uninitialize(void);
 
int32 AI_DoCommand(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc);
 
int32 AI_DoCommandCc(TileIndex tile, uint32 p1, uint32 p2, uint32 flags, uint procc, CommandCallback* callback);
 

	
 
/** Is it allowed to start a new AI.
 
 * This function checks some boundries to see if we should launch a new AI.
 
 * @return True if we can start a new AI.
 
 */
 
static inline bool AI_AllowNewAI(void)
 
{
 
	/* If disabled, no AI */
 
	if (!_ai.enabled)
 
		return false;
 

	
ai/trolly/trolly.c
Show inline comments
 
@@ -27,51 +27,49 @@
 
#include "../../map.h"
 
#include "../../tile.h"
 
#include "../../command.h"
 
#include "trolly.h"
 
#include "../../town.h"
 
#include "../../industry.h"
 
#include "../../station.h"
 
#include "../../engine.h"
 
#include "../../gui.h"
 
#include "../../depot.h"
 
#include "../../vehicle.h"
 
#include "../../date.h"
 
#include "../ai.h"
 

	
 
// This function is called after StartUp. It is the init of an AI
 
static void AiNew_State_FirstTime(Player *p)
 
{
 
	// This assert is used to protect those function from misuse
 
	//   You have quickly a small mistake in the state-array
 
	//   With that, everything would go wrong. Finding that, is almost impossible
 
	//   With this assert, that problem can never happen.
 
	assert(p->ainew.state == AI_STATE_FIRST_TIME);
 
	// We first have to init some things
 

	
 
	if (_current_player == 1 || _ai.network_client) {
 
		ShowErrorMessage(INVALID_STRING_ID, TEMP_AI_IN_PROGRESS, 0, 0);
 
	}
 
	if (_current_player == 1) ShowErrorMessage(INVALID_STRING_ID, TEMP_AI_IN_PROGRESS, 0, 0);
 

	
 
	// The PathFinder (AyStar)
 
	// TODO: Maybe when an AI goes bankrupt, this is de-init
 
	//  or when coming from a savegame.. should be checked out!
 
	p->ainew.path_info.start_tile_tl = 0;
 
	p->ainew.path_info.start_tile_br = 0;
 
	p->ainew.path_info.end_tile_tl = 0;
 
	p->ainew.path_info.end_tile_br = 0;
 
	p->ainew.pathfinder = new_AyStar_AiPathFinder(12, &p->ainew.path_info);
 

	
 
	p->ainew.idle = 0;
 
	p->ainew.last_vehiclecheck_date = _date;
 

	
 
	// We ALWAYS start with a bus route.. just some basic money ;)
 
	p->ainew.action = AI_ACTION_BUS_ROUTE;
 

	
 
	// Let's popup the news, and after that, start building..
 
	p->ainew.state = AI_STATE_WAKE_UP;
 
}
 

	
 

	
 
// This function just waste some time
 
//  It keeps it more real. The AI can build on such tempo no normal user
 
//  can ever keep up with that. The competitor_speed already delays a bit
economy.c
Show inline comments
 
@@ -428,50 +428,48 @@ static void PlayersCheckBankrupt(Player 
 
					/* Find all clients that were in control of this company */
 
					FOR_ALL_CLIENTS(cs) {
 
						ci = DEREF_CLIENT_INFO(cs);
 
						if ((ci->client_playas-1) == owner) {
 
							ci->client_playas = PLAYER_SPECTATOR;
 
							// Send the new info to all the clients
 
							NetworkUpdateClientInfo(_network_own_client_index);
 
						}
 
					}
 
				}
 
				// Make sure the player no longer controls the company
 
				if (IsHumanPlayer(owner) && owner == _local_player) {
 
					// Switch the player to spectator..
 
					_local_player = PLAYER_SPECTATOR;
 
				}
 
#endif /* ENABLE_NETWORK */
 

	
 
				/* Remove the player */
 
				ChangeOwnershipOfPlayerItems(owner, PLAYER_SPECTATOR);
 
				// Register the player as not-active
 
				p->is_active = false;
 

	
 
				if (!IsHumanPlayer(owner) && (!_networking || _network_server) && _ai.enabled)
 
					AI_PlayerDied(owner);
 
				if (IsHumanPlayer(owner) && owner == _local_player && _ai.network_client)
 
					AI_PlayerDied(owner);
 
			}
 
		}
 
	}
 
}
 

	
 
void DrawNewsBankrupcy(Window *w)
 
{
 
	Player *p;
 

	
 
	DrawNewsBorder(w);
 

	
 
	p = GetPlayer(WP(w,news_d).ni->string_id & 15);
 
	DrawPlayerFace(p->face, p->player_color, 2, 23);
 
	GfxFillRect(3, 23, 3+91, 23+118, 0x323 | USE_COLORTABLE);
 

	
 
	SetDParam(0, p->president_name_1);
 
	SetDParam(1, p->president_name_2);
 

	
 
	DrawStringMultiCenter(49, 148, STR_7058_PRESIDENT, 94);
 

	
 
	switch (WP(w,news_d).ni->string_id >> 4) {
 
	case 1:
 
		DrawStringCentered(w->width>>1, 1, STR_7056_TRANSPORT_COMPANY_IN_TROUBLE, 0);
 

	
network_client.c
Show inline comments
 
@@ -319,55 +319,48 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER
 
	return NETWORK_RECV_STATUS_CLOSE_QUERY;
 
}
 

	
 
// This packet contains info about the client (playas and name)
 
//  as client we save this in NetworkClientInfo, linked via 'index'
 
//  which is always an unique number on a server.
 
DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_CLIENT_INFO)
 
{
 
	NetworkClientInfo *ci;
 
	uint16 index = NetworkRecv_uint16(MY_CLIENT, p);
 
	PlayerID playas = NetworkRecv_uint8(MY_CLIENT, p);
 
	char name[NETWORK_NAME_LENGTH];
 
	char unique_id[NETWORK_NAME_LENGTH];
 

	
 
	NetworkRecv_string(MY_CLIENT, p, name, sizeof(name));
 
	NetworkRecv_string(MY_CLIENT, p, unique_id, sizeof(unique_id));
 

	
 
	if (MY_CLIENT->quited)
 
		return NETWORK_RECV_STATUS_CONN_LOST;
 

	
 
	/* Do we receive a change of data? Most likely we changed playas */
 
	if (index == _network_own_client_index) {
 
		_network_playas = playas;
 

	
 
		/* Are we a ai-network-client? Are we not joining as a SPECTATOR (playas == 0, means SPECTATOR) */
 
		if (_ai.network_client && playas != 0) {
 
			if (_ai.network_playas == PLAYER_SPECTATOR)
 
				AI_StartNewAI(playas - 1);
 

	
 
			_ai.network_playas = playas - 1;
 
		}
 
	}
 

	
 
	ci = NetworkFindClientInfoFromIndex(index);
 
	if (ci != NULL) {
 
		if (playas == ci->client_playas && strcmp(name, ci->client_name) != 0) {
 
			// Client name changed, display the change
 
			NetworkTextMessage(NETWORK_ACTION_NAME_CHANGE, 1, false, ci->client_name, "%s", name);
 
		} else if (playas != ci->client_playas) {
 
			// The player changed from client-player..
 
			// Do not display that for now
 
		}
 

	
 
		ci->client_playas = playas;
 
		ttd_strlcpy(ci->client_name, name, sizeof(ci->client_name));
 

	
 
		InvalidateWindow(WC_CLIENT_LIST, 0);
 

	
 
		return NETWORK_RECV_STATUS_OKAY;
 
	}
 

	
 
	// We don't have this index yet, find an empty index, and put the data there
 
	ci = NetworkFindClientInfoFromIndex(NETWORK_EMPTY_INDEX);
 
	if (ci != NULL) {
 
		ci->client_index = index;
 
@@ -519,59 +512,48 @@ DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER
 
		SEND_COMMAND(PACKET_CLIENT_MAP_OK)();
 

	
 
		if (_network_playas == 0 || _network_playas > MAX_PLAYERS ||
 
				!GetPlayer(_network_playas - 1)->is_active) {
 

	
 
			if (_network_playas == PLAYER_SPECTATOR) {
 
				// The client wants to be a spectator..
 
				_local_player = PLAYER_SPECTATOR;
 
				DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
 
			} else {
 
				/* We have arrived and ready to start playing; send a command to make a new player;
 
				 * the server will give us a client-id and let us in */
 
				_local_player = 0;
 
				NetworkSend_Command(0, 0, 0, CMD_PLAYER_CTRL, NULL);
 
				_local_player = PLAYER_SPECTATOR;
 
			}
 
		} else {
 
			// take control over an existing company
 
			_local_player = _network_playas - 1;
 
			_patches.autorenew = GetPlayer(_local_player)->engine_renew;
 
			_patches.autorenew_months = GetPlayer(_local_player)->engine_renew_months;
 
			_patches.autorenew_money = GetPlayer(_local_player)->engine_renew_money;
 
			DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
 
		}
 

	
 
		/* Check if we are an ai-network-client, and if so, disable GUI */
 
		if (_ai.network_client) {
 
			_ai.network_playas = _local_player;
 
			_local_player      = PLAYER_SPECTATOR;
 

	
 
			if (_ai.network_playas != PLAYER_SPECTATOR) {
 
				/* If we didn't join the game as a spectator, activate the AI */
 
				AI_StartNewAI(_ai.network_playas);
 
			}
 
		}
 
	}
 

	
 
	return NETWORK_RECV_STATUS_OKAY;
 
}
 

	
 
DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_FRAME)
 
{
 
	_frame_counter_server = NetworkRecv_uint32(MY_CLIENT, p);
 
	_frame_counter_max = NetworkRecv_uint32(MY_CLIENT, p);
 
#ifdef ENABLE_NETWORK_SYNC_EVERY_FRAME
 
	// Test if the server supports this option
 
	//  and if we are at the frame the server is
 
	if (p->pos < p->size) {
 
		_sync_frame = _frame_counter_server;
 
		_sync_seed_1 = NetworkRecv_uint32(MY_CLIENT, p);
 
#ifdef NETWORK_SEND_DOUBLE_SEED
 
		_sync_seed_2 = NetworkRecv_uint32(MY_CLIENT, p);
 
#endif
 
	}
 
#endif
 
	DEBUG(net, 7)("[NET] Received FRAME %d",_frame_counter_server);
 

	
 
	// Let the server know that we received this frame correctly
 
	//  We do this only once per day, to save some bandwidth ;)
openttd.c
Show inline comments
 
@@ -317,104 +317,98 @@ int ttd_main(int argc, char *argv[])
 
{
 
	MyGetOptData mgo;
 
	int i;
 
	const char *optformat;
 
	char musicdriver[16], sounddriver[16], videodriver[16];
 
	int resolution[2] = {0,0};
 
	Year startyear = INVALID_YEAR;
 
	uint generation_seed = GENERATE_NEW_SEED;
 
	bool dedicated = false;
 
	bool network   = false;
 
	char *network_conn = NULL;
 

	
 
	musicdriver[0] = sounddriver[0] = videodriver[0] = 0;
 

	
 
	_game_mode = GM_MENU;
 
	_switch_mode = SM_MENU;
 
	_switch_mode_errorstr = INVALID_STRING_ID;
 
	_dedicated_forks = false;
 
	_config_file = NULL;
 

	
 
	// The last param of the following function means this:
 
	//   a letter means: it accepts that param (e.g.: -h)
 
	//   a ':' behind it means: it need a param (e.g.: -m<driver>)
 
	//   a '::' behind it means: it can optional have a param (e.g.: -d<debug>)
 
	optformat = "bm:s:v:hDn::eit:d::r:g::G:c:"
 
	optformat = "m:s:v:hDn::eit:d::r:g::G:c:"
 
#if !defined(__MORPHOS__) && !defined(__AMIGA__) && !defined(WIN32)
 
		"f"
 
#endif
 
	;
 

	
 
	MyGetOptInit(&mgo, argc-1, argv+1, optformat);
 
	while ((i = MyGetOpt(&mgo)) != -1) {
 
		switch (i) {
 
		case 'm': ttd_strlcpy(musicdriver, mgo.opt, sizeof(musicdriver)); break;
 
		case 's': ttd_strlcpy(sounddriver, mgo.opt, sizeof(sounddriver)); break;
 
		case 'v': ttd_strlcpy(videodriver, mgo.opt, sizeof(videodriver)); break;
 
		case 'D':
 
			strcpy(musicdriver, "null");
 
			strcpy(sounddriver, "null");
 
			strcpy(videodriver, "dedicated");
 
			dedicated = true;
 
			break;
 
		case 'f': _dedicated_forks = true; break;
 
		case 'n':
 
			network = true;
 
			network_conn = mgo.opt; // optional IP parameter, NULL if unset
 
			break;
 
		case 'b': _ai.network_client = true; break;
 
		case 'r': ParseResolution(resolution, mgo.opt); break;
 
		case 't': startyear = atoi(mgo.opt); break;
 
		case 'd': {
 
#if defined(WIN32)
 
				CreateConsole();
 
#endif
 
				if (mgo.opt != NULL) SetDebugString(mgo.opt);
 
			} break;
 
		case 'e': _switch_mode = SM_EDITOR; break;
 
		case 'i': _use_dos_palette = true; break;
 
		case 'g':
 
			if (mgo.opt != NULL) {
 
				strcpy(_file_to_saveload.name, mgo.opt);
 
				_switch_mode = SM_LOAD;
 
			} else {
 
				_switch_mode = SM_NEWGAME;
 
			}
 
			break;
 
		case 'G': generation_seed = atoi(mgo.opt); break;
 
		case 'c': _config_file = strdup(mgo.opt); break;
 
		case -2:
 
		case 'h':
 
			showhelp();
 
			return 0;
 
		}
 
	}
 

	
 
	if (_ai.network_client && !network) {
 
		_ai.network_client = false;
 
		DEBUG(ai, 0) ("[AI] Can't enable network-AI, because '-n' is not used\n");
 
	}
 

	
 
	DeterminePaths();
 
	CheckExternalFiles();
 

	
 
#if defined(UNIX) && !defined(__MORPHOS__)
 
	// We must fork here, or we'll end up without some resources we need (like sockets)
 
	if (_dedicated_forks)
 
		DedicatedFork();
 
#endif
 

	
 
	LoadFromConfig();
 
	CheckConfig();
 
	LoadFromHighScore();
 

	
 
	// override config?
 
	if (musicdriver[0]) ttd_strlcpy(_ini_musicdriver, musicdriver, sizeof(_ini_musicdriver));
 
	if (sounddriver[0]) ttd_strlcpy(_ini_sounddriver, sounddriver, sizeof(_ini_sounddriver));
 
	if (videodriver[0]) ttd_strlcpy(_ini_videodriver, videodriver, sizeof(_ini_videodriver));
 
	if (resolution[0]) { _cur_resolution[0] = resolution[0]; _cur_resolution[1] = resolution[1]; }
 
	if (startyear != INVALID_YEAR) _patches_newgame.starting_year = startyear;
 
	if (generation_seed != GENERATE_NEW_SEED) _patches_newgame.generation_seed = generation_seed;
 

	
 
	if (_dedicated_forks && !dedicated) _dedicated_forks = false;
 

	
 
	// enumerate language files
players.c
Show inline comments
 
@@ -814,66 +814,54 @@ int32 CmdSetAutoReplace(TileIndex tile, 
 
 * @arg - network_server.c:838 DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMMAND)@n
 
 * @arg - network_client.c:536 DEF_CLIENT_RECEIVE_COMMAND(PACKET_SERVER_MAP) from where the map has been received
 
 */
 
int32 CmdPlayerCtrl(TileIndex tile, uint32 flags, uint32 p1, uint32 p2)
 
{
 
	if (flags & DC_EXEC) _current_player = OWNER_NONE;
 

	
 
	switch (p1) {
 
	case 0: { /* Create a new player */
 
		Player *p;
 
		PlayerID pid = p2;
 

	
 
		if (!(flags & DC_EXEC) || !IsValidPlayer(pid)) return 0;
 

	
 
		p = DoStartupNewPlayer(false);
 

	
 
#ifdef ENABLE_NETWORK
 
		if (_networking && !_network_server && _local_player == PLAYER_SPECTATOR) {
 
			/* In case we are a client joining a server... */
 
			DeleteWindowById(WC_NETWORK_STATUS_WINDOW, 0);
 
		}
 
#endif /* ENABLE_NETWORK */
 

	
 
		if (p != NULL) {
 
			if (_local_player == PLAYER_SPECTATOR &&
 
					(!_ai.network_client || _ai.network_playas == PLAYER_SPECTATOR)) {
 
			if (_local_player == PLAYER_SPECTATOR) {
 
				/* Check if we do not want to be a spectator in network */
 
				if (!_networking ||
 
						(_network_server && !_network_dedicated) ||
 
						_network_playas != PLAYER_SPECTATOR ||
 
						_ai.network_client) {
 
					if (_ai.network_client) {
 
						/* As ai-network-client, we have our own rulez (disable GUI and stuff) */
 
						_ai.network_playas = p->index;
 
						_local_player      = PLAYER_SPECTATOR;
 
						if (_ai.network_playas != PLAYER_SPECTATOR) {
 
							/* If we didn't join the game as a spectator, activate the AI */
 
							AI_StartNewAI(_ai.network_playas);
 
						}
 
					} else {
 
						_network_playas != PLAYER_SPECTATOR) {
 
						_local_player = p->index;
 
					}
 
					MarkWholeScreenDirty();
 
				}
 
			} else if (p->index == _local_player) {
 
				DoCommandP(0, (_patches.autorenew << 15 ) | (_patches.autorenew_months << 16) | 4, _patches.autorenew_money, NULL, CMD_SET_AUTOREPLACE);
 
			}
 
#ifdef ENABLE_NETWORK
 
			if (_network_server) {
 
				/* XXX - UGLY! p2 (pid) is mis-used to fetch the client-id, done at
 
				 * server-side in network_server.c:838, function
 
				 * DEF_SERVER_RECEIVE_COMMAND(PACKET_CLIENT_COMMAND) */
 
				NetworkClientInfo *ci = &_network_client_info[pid];
 
				ci->client_playas = p->index + 1;
 
				NetworkUpdateClientInfo(ci->client_index);
 

	
 
				if (ci->client_playas != 0 && ci->client_playas <= MAX_PLAYERS) {
 
					PlayerID player_backup = _local_player;
 
					_network_player_info[p->index].months_empty = 0;
 

	
 
					/* XXX - When a client joins, we automatically set its name to the
 
					 * player's name (for some reason). As it stands now only the server
 
					 * knows the client's name, so it needs to send out a "broadcast" to
 
					 * do this. To achieve this we send a network command. However, it
 
					 * uses _local_player to execute the command as.  To prevent abuse
 
					 * (eg. only yourself can change your name/company), we 'cheat' by
0 comments (0 inline, 0 general)