Files
TeslaRel410/CODE/RP/MUNGA_L4/L4HOST.HPP
T
CydandClaude Fable 5 fdd9ac9d97 Initial import: Tesla Release 4.10 (Tesla:BattleTech & Tesla:Red Planet)
Archival snapshot of the Virtual World Entertainment Tesla cockpit
software, 1994-1996: MUNGA engine and L4 pod layer source (Borland
C++ 5.0), BT/RP game code, and game content (models, audio, maps,
gauges, Division renderer data). Includes third-party libraries:
Division dVS/DPL graphics, HMI SOS audio, WATTCP networking.

Files are preserved byte-for-byte (.gitattributes disables all
line-ending conversion). README.md documents the layout, target
hardware, and toolchain.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 13:21:58 -05:00

116 lines
3.8 KiB
C++

//===========================================================================//
// File: l4host.hpp //
// Project: MUNGA Brick: Connection Library //
// Contents: additional L4 data types and functions for hosts //
//---------------------------------------------------------------------------//
// Date Who Modification //
// -------- --- ---------------------------------------------------------- //
// 04/09/95 GAC Initial coding. //
//---------------------------------------------------------------------------//
// Copyright (C) 1994-1995, Virtual World Entertainment, Inc. //
// All Rights reserved worldwide //
// This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL //
//===========================================================================//
#if !defined(L4HOST_HPP)
# define L4HOST_HPP
# if !defined(HOST_HPP)
# include "host.hpp"
# endif
# if !defined(CSTR_HPP)
# include "cstr.hpp"
# endif
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ L4Host ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#define L4HOST_PAD_BUFFER_SIZE 4096
//
//--------------------------------------------------------------------
// L4Host
//
// Derived from Host, so we can add a place to store the host's network
// socket pointer.
//--------------------------------------------------------------------
//
class L4Host:
public Host
{
public:
//
//--------------------------------------------------------------------
// Construction, Destruction, and testing
//--------------------------------------------------------------------
//
L4Host(
HostID host_ID,
HostType host_type,
NetworkAddress network_address,
unsigned long NetworkSocket,
const CString &net_name);
~L4Host();
//
//--------------------------------------------------------------------
// Accessors
//--------------------------------------------------------------------
//
#if 0
enum ConnectionStatus
{
NoNetworkConnectionStatus, // Initial state, host just created with no net link
OpeningConnectionStatus, // Waiting for completion of an active open to this host
ListeningConnectionStatus, // Waiting for this host to connect to us
OnLineConnectionStatus // Host is on-line and ready
};
ConnectionStatus
GetConnectStatus()
{return ConnectStatus;}
void
SetConnectStatus(ConnectionStatus new_status)
{ConnectStatus = new_status;}
#endif
unsigned long
GetNetworkSocket()
{return NetworkSocket;}
void
SetNetworkSocket(unsigned long net_socket)
{NetworkSocket = net_socket;}
CString
GetSymbolicName()
{return SymbolicName;}
//
// Nasty to make these things public but I'll have to clean them later
//
public:
#if defined(TRACE_SEND_BUFFER)
TraceOf<int>
*sendBufferTrace;
char
sendBufferTraceName[50];
#endif
char
pad_buffer[L4HOST_PAD_BUFFER_SIZE]; // a place to buffer up messages
unsigned short
pad_size, // total size of the pad buffer
pad_head, // circular buffer pointers for keeping track of the
pad_tail; // data in the pad buffer.
//
//--------------------------------------------------------------------
// Private data
//--------------------------------------------------------------------
//
private:
unsigned long
NetworkSocket; // address of the network socket this host uses
#if 0
ConnectionStatus
ConnectStatus; // current connection status
#endif
CString
SymbolicName; // Text version of net address from egg
};
#endif