//===========================================================================//
// File:	NetGenericMessages.hpp											
//---------------------------------------------------------------------------//
//   Date    Who  Modification                                               //
// --------  ---  ---------------------------------------------------------- //
// 01/06/1999  JSE  Inital coding
//---------------------------------------------------------------------------//
// Copyright (C) 1998, Microsoft Corp.										 //
// All Rights reserved worldwide                                             //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL               //
//===========================================================================//




#pragma once

#include "NetConstants.hpp"
#include "NetUpdateManager.hpp"




namespace MechWarrior4
{

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	void __cdecl NetGenericMessagesSecurityCheckStart(void);
	void __cdecl NetGenericMessagesSecurityCheckStop(void);


	__int64 CalculateCodeHash(int key);


	class MissionObjectiveUpdate
	{
	public:

		enum {
			UpdateEntryCount = 0
		};

		enum {
			UpdateType = UpdateManager::MissionObjectiveUpdateID
		};

		static void Decode(Entity *entity, MemoryStream *memory_stream, Time till, Scalar packet_latency, int connection, int debug_level, int bandwidth);
		static void Skip(MemoryStream *memory_stream, int size, Time till, int connection, int debug_level, int bandwidth);
		static void Encode(Entity *entity, DynamicMemoryStream *memory_stream, int connection, int debug_level, int bandwidth);
		static int SizeFunction(Entity *entity){return -1;};
		static int MaxSize(Entity *entity, int debug_level, int bandwidth);
		static bool MaintainActiveFlagFunction(Entity *entity,Point3D cull_location){return true;}

		static int GetUpdateEntryCount(){return UpdateEntryCount;};
		static int GetUpdateEntryType(){return UpdateType;};
	};


	class NavPointUpdate
	{
	public:

		enum {
			UpdateEntryCount = 0
		};

		enum {
			UpdateType = UpdateManager::NavPointUpdateID
		};

		static void Decode(Entity *entity, MemoryStream *memory_stream, Time till, Scalar packet_latency, int connection, int debug_level, int bandwidth);
		static void Skip(MemoryStream *memory_stream, int size, Time till, int connection, int debug_level, int bandwidth);
		static void Encode(Entity *entity, DynamicMemoryStream *memory_stream, int connection, int debug_level, int bandwidth);
		static int SizeFunction(Entity *entity){return -1;};
		static int MaxSize(Entity *entity, int debug_level, int bandwidth);
		static bool MaintainActiveFlagFunction(Entity *entity,Point3D cull_location){return true;}

		static int GetUpdateEntryCount(){return UpdateEntryCount;};
		static int GetUpdateEntryType(){return UpdateType;};
	};

	class FlagUpdate
	{
	public:

		enum {
			XPositionUpdateEntryID = 0,
			ZPositionUpdateEntryID,
			UpdateEntryCount
		};

		enum {
			UpdateType = UpdateManager::FlagUpdateID
		};

		enum {
			GroundMode = 0,
			ServerObjectMode = 1,
			PlayerMode = 2
		};

		static void Decode(Entity *entity, MemoryStream *memory_stream, Time till, Scalar packet_latency, int connection, int debug_level, int bandwidth);
		static void Skip(MemoryStream *memory_stream, int size, Time till, int connection, int debug_level, int bandwidth);
		static void Encode(Entity *entity, DynamicMemoryStream *memory_stream, int connection, int debug_level, int bandwidth);
		static int SizeFunction(Entity *entity){return -1;};
		static int MaxSize(Entity *entity, int debug_level, int bandwidth);
		static bool MaintainActiveFlagFunction(Entity *entity,Point3D cull_location){return true;}

		static int GetUpdateEntryCount(){return UpdateEntryCount;};
		static int GetUpdateEntryType(){return UpdateType;};
	};


	class TimeUpdate
	{
	public:

		enum {
			UpdateEntryCount = 0
		};

		enum {
			UpdateType = UpdateManager::TimeUpdateID
		};

		static void Decode(Entity *entity, MemoryStream *memory_stream, Time till, Scalar packet_latency, int connection, int debug_level, int bandwidth);
		static void Skip(MemoryStream *memory_stream, int size, Time till, int connection, int debug_level, int bandwidth);
		static void Encode(Entity *entity, DynamicMemoryStream *memory_stream, int connection, int debug_level, int bandwidth);
		static int SizeFunction(Entity *entity){return -1;};
		static int MaxSize(Entity *entity, int debug_level, int bandwidth);
		static bool MaintainActiveFlagFunction(Entity *entity,Point3D cull_location){return true;}

		static int GetUpdateEntryCount(){return UpdateEntryCount;};
		static int GetUpdateEntryType(){return UpdateType;};
	};


	
	class PingUpdate
	{
	public:

		enum {
			UpdateEntryCount = 0
		};

		enum {
			UpdateType = UpdateManager::PingUpdateID
		};

		static void Decode(Entity *entity, MemoryStream *memory_stream, Time till, Scalar packet_latency, int connection, int debug_level, int bandwidth);
		static void Skip(MemoryStream *memory_stream, int size, Time till, int connection, int debug_level, int bandwidth);
		static void Encode(Entity *entity, DynamicMemoryStream *memory_stream, int connection, int debug_level, int bandwidth);
		static int SizeFunction(Entity *entity){return -1;};
		static int MaxSize(Entity *entity, int debug_level, int bandwidth);
		static bool MaintainActiveFlagFunction(Entity *entity,Point3D cull_location){return true;}

		static int GetUpdateEntryCount(){return UpdateEntryCount;};
		static int GetUpdateEntryType(){return UpdateType;};
	};



	class SecurityQuery
	{
	public:

		enum {
			UpdateEntryCount = 0
		};

		enum {
			UpdateType = UpdateManager::SecurityQueryID
		};

		static void Decode(Entity *entity, MemoryStream *memory_stream, Time till, Scalar packet_latency, int connection, int debug_level, int bandwidth);
		static void Skip(MemoryStream *memory_stream, int size, Time till, int connection, int debug_level, int bandwidth);
		static void Encode(Entity *entity, DynamicMemoryStream *memory_stream, int connection, int debug_level, int bandwidth);
		static int SizeFunction(Entity *entity){return -1;};
		static int MaxSize(Entity *entity, int debug_level, int bandwidth);
		static bool MaintainActiveFlagFunction(Entity *entity,Point3D cull_location){return true;}

		static int GetUpdateEntryCount(){return UpdateEntryCount;};
		static int GetUpdateEntryType(){return UpdateType;};
	};


	class SecurityResponse
	{
	public:

		enum {
			UpdateEntryCount = 0
		};

		enum {
			UpdateType = UpdateManager::SecurityResponseID
		};

		static void Decode(Entity *entity, MemoryStream *memory_stream, Time till, Scalar packet_latency, int connection, int debug_level, int bandwidth);
		static void Skip(MemoryStream *memory_stream, int size, Time till, int connection, int debug_level, int bandwidth);
		static void Encode(Entity *entity, DynamicMemoryStream *memory_stream, int connection, int debug_level, int bandwidth);
		static int SizeFunction(Entity *entity){return -1;};
		static int MaxSize(Entity *entity, int debug_level, int bandwidth);
		static bool MaintainActiveFlagFunction(Entity *entity,Point3D cull_location){return true;}

		static int GetUpdateEntryCount(){return UpdateEntryCount;};
		static int GetUpdateEntryType(){return UpdateType;};
	};

};




