#include "rp.h"
#pragma hdrstop

#include "rpcnsl.h"

// see rpcnsl.h - the in-process console registers its intake here
void (*gConsoleScoreSink)(int player_host_ID, int final_score) = NULL;

//~~~~~~~~~~~~~~~~~~ ConsolePlayerVTVScoredMessage ~~~~~~~~~~~~~~~~~~~~~~
ConsolePlayerVTVScoredMessage::
	ConsolePlayerVTVScoredMessage(HostID player_host_ID):
		NetworkClient::Message(
			ConsolePlayerVTVScoredMessageID,
			sizeof(ConsolePlayerVTVScoredMessage)
		)
{
	playerHostID = player_host_ID;
}

//~~~~~~~~~~~~~~~~~~ ConsolePlayerVTVKilledMessage ~~~~~~~~~~~~~~~~~~~~~~
ConsolePlayerVTVKilledMessage::
	ConsolePlayerVTVKilledMessage(
		HostID player_host_ID,
		HostID killer_host_ID
	):
		NetworkClient::Message(
			ConsolePlayerVTVKilledMessageID,
			sizeof(ConsolePlayerVTVKilledMessage)
		)
{
	playerHostID = player_host_ID;
	killerHostID = killer_host_ID;
}

//~~~~~~~~~~~~~~~~~~ ConsolePlayerVTVBoosterMessage ~~~~~~~~~~~~~~~~~~~~~~
ConsolePlayerVTVBoosterMessage::
	ConsolePlayerVTVBoosterMessage(
		HostID player_host_ID,
		int booster_on
	):
		NetworkClient::Message(
			ConsolePlayerVTVBoosterMessageID,
			sizeof(ConsolePlayerVTVBoosterMessage)
		)
{
	playerHostID = player_host_ID;
	boosterOn = booster_on;
}

//~~~~~~~~~~~~~~~~~~ ConsolePlayerVTVScoreUpdateMessage ~~~~~~~~~~~~~~~~~~~~
ConsolePlayerVTVScoreUpdateMessage::
	ConsolePlayerVTVScoreUpdateMessage(
		HostID player_host_ID,
		int score
	):
		NetworkClient::Message(
			ConsolePlayerVTVScoreUpdateMessageID,
			sizeof(ConsolePlayerVTVScoreUpdateMessage)
		)
{
	playerHostID = player_host_ID;
	playerScore = score;
}

//~~~~~~~~~~~~~~~~~~ ConsolePlayerVTVDamagedMessage ~~~~~~~~~~~~~~~~~~~~~~
ConsolePlayerVTVDamagedMessage::
	ConsolePlayerVTVDamagedMessage(
		HostID player_host_ID,
		HostID damager_host_ID,
		int loss,
		int points_transfered
	):
		NetworkClient::Message(
			ConsolePlayerVTVDamagedMessageID,
			sizeof(ConsolePlayerVTVDamagedMessage)
		)
{
	playerHostID = player_host_ID;
	damagerHostID = damager_host_ID;
	damageLoss = loss;
   pointsTransfered = points_transfered;
}

//==============================================================================
