Files
firestorm/Gameleap/code/mw4/Code/MW4/NetAutoPacketSpliter.hpp
Cyd 2b8ca921cb Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS
Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
2026-06-24 21:28:16 -05:00

98 lines
2.8 KiB
C++

//===========================================================================//
// File: NetAutoPacketSpliter.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 "MW4.hpp"
#include "NetConstants.hpp"
#include "NetUpdateManager.hpp"
#include "MWEntityManager.hpp"
namespace MechWarrior4
{
class NetUpdateSortEntry:
public Stuff::Plug
{
public:
Entity *m_entity;
int m_size;
int m_type;
UpdateRate m_rate;
NetUpdateSortEntry(Entity *entity, int size, int type, UpdateRate rate);
};
//##########################################################################
class NetUpdatePageHolder:
public Stuff::Plug
{
public:
int entryCount;
int totalMaxSize;
ChainOf<NetUpdateSortEntry*> m_UpdateEntries;
NetUpdatePageHolder(int page_overhead);
~NetUpdatePageHolder();
bool IsThereRoom(NetUpdateSortEntry *entry, int paragraph_overhead);
void AddToList(NetUpdateSortEntry *entry, int paragraph_overhead);
void AddSelfToDictionary(Dictionary *dictionary, int page_number);
};
//##########################################################################
//##########################################################################
class NetUpdateSorter:
public Stuff::Plug
{
public:
int m_debugLevel;
int m_bandwidth;
int pageOverhead;
int paragraphOverhead;
ChainOf<NetUpdateSortEntry*> m_halfhzList;
ChainOf<NetUpdateSortEntry*> m_oneHzList;
ChainOf<NetUpdateSortEntry*> m_twoHzList;
ChainOf<NetUpdateSortEntry*> m_threeHzList;
ChainOf<NetUpdateSortEntry*> m_fourHzList;
ChainOf<NetUpdateSortEntry*> m_sixHzList;
ChainOf<NetUpdateSortEntry*> m_eightHzList;
ChainOf<NetUpdateSortEntry*> m_nineHzList;
ChainOf<NetUpdateSortEntry*> m_twelveHzList;
ChainOf<NetUpdateSortEntry*> m_sixteenHzList;
ChainOf<NetUpdateSortEntry*> *updateList[10];
NetUpdateSorter(int debug_level, int connection_rate);
~NetUpdateSorter();
void AddUpdateToList(Entity *entity, int type, UpdateRate rate);
void MakeDictionaryPages(Dictionary *dictionary);
void FindPageWithRoom(ChainOf<NetUpdatePageHolder*> *pages, NetUpdateSortEntry *entry);
};
};