Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
930391c
Process usercmds
callumok2004 Feb 22, 2026
acbf638
more server
callumok2004 Feb 23, 2026
113c16b
Merge branch 'main' of https://github.com/marchc1/Source.NET into nav…
callumok2004 Feb 23, 2026
08dc555
FIx compile
callumok2004 Feb 23, 2026
a8a28db
Server & stringtables impl
callumok2004 Feb 27, 2026
3ac6b2c
Some ServerPlugin impl
callumok2004 Feb 27, 2026
9f608c3
Allocate edicts
callumok2004 Feb 28, 2026
3d3bdc5
Fix usermessages overflowing
callumok2004 Feb 28, 2026
971a5e8
report_entities command
callumok2004 Feb 28, 2026
16e4eaf
Parse map entities
callumok2004 Feb 28, 2026
a0a7ede
Revert CLC_GMod_ClientToServer back to how it was
callumok2004 Mar 1, 2026
8ede6c6
Some HUD fixes
callumok2004 Mar 1, 2026
35e4b24
Fix remaining issues with console completions
callumok2004 Mar 2, 2026
89b5391
EntityList impl
callumok2004 Mar 3, 2026
39eb3d7
Init gamerules
callumok2004 Mar 3, 2026
ec6e9f3
Gamerules stringtable
callumok2004 Mar 3, 2026
6333ab0
Impl player spawn spot
callumok2004 Mar 3, 2026
f36e2f3
PackedEntity impl
callumok2004 Mar 4, 2026
42250d7
FrameSnapshot impl
callumok2004 Mar 4, 2026
c1ef6f4
scaffold PackedEntities
callumok2004 Mar 4, 2026
54a75de
Some PackedEntities impl
callumok2004 Mar 4, 2026
ca0d5c3
ChangeFrameList
callumok2004 Mar 4, 2026
3d2c436
More PackedEntities/SendTable impl
callumok2004 Mar 4, 2026
c2f64ea
Cleanup some stuff
callumok2004 Mar 4, 2026
77d998d
Allow server to run commands
callumok2004 Mar 5, 2026
3b34b6f
CommandClient stuff
callumok2004 Mar 5, 2026
878bf19
Fix command completions
callumok2004 Mar 5, 2026
bab9e88
temp autocomplete for map command
callumok2004 Mar 5, 2026
a855388
Cleanups
callumok2004 Mar 5, 2026
c121579
More server impl
callumok2004 Mar 6, 2026
4895093
DatatableStack funcs
callumok2004 Mar 6, 2026
26713f4
Some SendProxy funcs impl
callumok2004 Mar 6, 2026
13e891f
Fix SendLoopPacket
callumok2004 Mar 7, 2026
d6f0610
SendProxyRecipients
callumok2004 Mar 7, 2026
84880a7
ClientFrameManager
callumok2004 Mar 7, 2026
8c92ba5
WriteProps & PropCullStack
callumok2004 Mar 7, 2026
62d81e6
fix save pos for WriteDeltaEntities
callumok2004 Mar 7, 2026
992e702
engine/server impl
callumok2004 Mar 7, 2026
eb61813
Some entity impl
callumok2004 Mar 8, 2026
f5952ec
ToString overrides for some netmessages
callumok2004 Mar 9, 2026
fb464b2
Some client impl
callumok2004 Mar 9, 2026
1deb46c
Make net_showmsg stand out more when debugging
callumok2004 Mar 9, 2026
ddf0ae5
Impl MD5_MapFile
callumok2004 Mar 13, 2026
9e32699
Misc impl
callumok2004 Mar 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Game.Client/C_BasePlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ public override void OnDataChanged(DataUpdateType updateType) {

if (pWeaponData == null || (pWeaponData.Flags & WeaponFlags.NoAmmoPickups) == 0) {
// We got more ammo for this ammo index. Add it to the ammo history
HudHistoryResource? pHudHR = GET_HUDELEMENT<HudHistoryResource>();
HudHistoryResource? pHudHR = gHUD.FindElement("CHudHistoryResource") as HudHistoryResource;
pHudHR?.AddToHistory(HRType.Ammo, i, Math.Abs(GetAmmoCount(i) - OldAmmo[i]));
}
}
Expand Down
9 changes: 9 additions & 0 deletions Game.Client/ClientModeShared.cs
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,15 @@ public override void FireGameEvent(IGameEvent ev) {

public void LevelInit(ReadOnlySpan<char> newmap) {
Viewport.GetAnimationController().StartAnimationSequence("LevelInit");

// if (ChatElement != null)
// ChatElement.LevelInit(newmap);

IGameEvent? evnt = gameeventmanager.CreateEvent("game_newmap");
if (evnt != null) {
evnt.SetString("mapname", newmap);
gameeventmanager.FireEventClientSide(evnt);
}
}

public void ProcessInput(bool active) {
Expand Down
7 changes: 4 additions & 3 deletions Game.Client/HL2/HL2_ClientMode.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ public static class HL2_ClientMode_Globals
public static IClientMode clientMode { get; set; } = null!;
}

public class HLModeManager : IVModeManager {
public class HLModeManager : IVModeManager
{
public static readonly HLModeManager g_HLModeManager = new();
static HLModeManager(){
static HLModeManager() {
modemanager = g_HLModeManager;
}

Expand All @@ -27,6 +28,6 @@ public void LevelInit(ReadOnlySpan<char> newmap) {
}

public void LevelShutdown() {
throw new NotImplementedException();
// clientMode.LevelShutdown(); todo
}
}
2 changes: 2 additions & 0 deletions Game.Client/HL2/HudDamageIndicator.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

using System.Numerics;

namespace Game.Client.HL2;

[DeclareHudElement(Name = "CHudDamageIndicator")]
class HudDamageIndicator : EditableHudElement, IHudElement
{
Expand Down
52 changes: 52 additions & 0 deletions Game.Client/HLClient.cs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,60 @@ public int HudVidInit() {

public void HudProcessInput(bool active) => gHUD.ProcessInput(active);

public void HudUpdate(bool active) {
TimeUnit_t frameTime = gpGlobals.FrameTime;

// GetClientVoiceMgr().Frame(frameTime);

gHUD.UpdateHud(active);

BaseAnimating.AutoAllowBoneAccess boneAccess = new(true, true);
IGameSystem.UpdateAllSystems(frameTime);

// vgui.GetAnimationController().UpdateAnimations(gpGlobals.CurTime);

C_BaseTempEntity.CheckDynamicTempEnts();
}

public void HudReset() {
gHUD.VidInit();
// PhysicsReset();
}

public void LevelShutdown() {
// if (!LevelInitialized)
// return;

// LevelInitialized = false;

C_BaseEntity.EnableAbsRecomputations(false);

IGameSystem.LevelShutdownPreEntityAllSystems();

// C_PhysPropClientside.DestroyAll();

modemanager.LevelShutdown();
// tempents.LevelShutdown();
// cl_entitylist.Release()

// C_BaseEntityClassList classList = s_pClassLists;
// while (classList != null) {
// classList.LevelShutdown();
// classList = classList.NextClassList;
// }

IGameSystem.LevelShutdownPostEntityAllSystems();

view.LevelShutdown();
beams.ClearBeams();

// ParticleMgr().RemoveAllEffects();

// StopAllRumbleEffects();

// gHUD.LevelShutdown();

// todo
}

public LookupProxyInterfaceFn GetMaterialProxyInterfaceFn() {
Expand Down
2 changes: 1 addition & 1 deletion Game.Client/HUD/Hud.cs
Original file line number Diff line number Diff line change
Expand Up @@ -407,7 +407,7 @@ private void SetupNewHudTexture(HudTexture t) {
}
}

public void UpdateHud() {
public void UpdateHud(bool active) {
KeyBits &= ~(InButtons.Weapon1 | InButtons.Weapon2);
// clientMode.Update();
// LCD.Update();
Expand Down
5 changes: 4 additions & 1 deletion Game.Client/HUD/HudAnimationInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
using Source.Common.GUI;
using Source.GUI.Controls;

namespace Game.Client;

[DeclareHudElement(Name = "CHudAnimationInfo")]
class HudAnimationInfo : EditableHudElement, IHudElement
{
Expand All @@ -20,6 +22,7 @@ class HudAnimationInfo : EditableHudElement, IHudElement
Panel? Watch;

public HudAnimationInfo(string panelName) : base(null, "HudAnimationInfo") {
ElementName = panelName;
ANIM_INFO_WIDTH = 300 * (ScreenWidth() / 640);

Panel parent = clientMode.GetViewport();
Expand Down Expand Up @@ -161,7 +164,7 @@ public override void Paint() {

[ConCommand("cl_animationinfo", "Hud element to examine.", FCvar.None)]
static void func(in TokenizedCommand args) {
if (gHUD.FindElement("HudAnimationInfo") is not HudAnimationInfo info)
if (gHUD.FindElement("CHudAnimationInfo") is not HudAnimationInfo info)
return;

if (args.ArgC() != 2) {
Expand Down
2 changes: 1 addition & 1 deletion Game.Client/HUD/Menu.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ public void SelectMenuItem(int menu_item) {
if (menu_item > 0 && (BitsValidSlots & (1 << (menu_item - 1))) != 0) {
Span<char> buf = stackalloc char[32];
sprintf(buf, "menuselect %d\n").D(menu_item);
engine.ClientCmd_Unrestricted(buf); // TODO: This should not be unrestricted
engine.ClientCmd(buf);

SelectedItem = menu_item;
clientMode.GetViewportAnimationController()?.StartAnimationSequence("MenuPulse");
Expand Down
3 changes: 2 additions & 1 deletion Game.Client/HistoryResource.cs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
using Game.Client;
using Game.Client.HUD;
using Game.Shared;

Expand All @@ -7,6 +6,8 @@
using Source.Common.GUI;
using Source.GUI.Controls;

namespace Game.Client;

enum HRType
{
Empty,
Expand Down
2 changes: 1 addition & 1 deletion Game.Client/View.cs
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ public void LevelInit() {
}

public void LevelShutdown() {
throw new NotImplementedException();
// ScreenSpaceEffects.ShutdownScreenSpaceEffects();
}

public void OnRenderStart() {
Expand Down
2 changes: 1 addition & 1 deletion Game.Client/WeaponsResource.cs
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ internal void LoadWeaponSprites(WEAPON_FILE_INFO_HANDLE weaponFileInfo) {
weaponInfo.IconZoomedAutoaim = weaponInfo.IconZoomedCrosshair; //default to zoomed crosshair
}

HudHistoryResource? hudHR = GET_HUDELEMENT<HudHistoryResource>();
HudHistoryResource? hudHR = gHUD.FindElement("CHudHistoryResource") as HudHistoryResource;
if (hudHR != null) {
p = FindHudTextureInDict(tempList, "weapon");
if (p != null) {
Expand Down
6 changes: 4 additions & 2 deletions Game.Server/BaseAnimating.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,9 +156,9 @@ public float GetSequenceMoveDist(StudioHdr? studioHdr, int sequence) {
public float GetSequenceGroundSpeed(StudioHdr? studioHdr, int sequence) {
TimeUnit_t t = SequenceDuration(studioHdr, sequence);

if (t > 0)
if (t > 0)
return (GetSequenceMoveDist(studioHdr, sequence) / (float)t);
else
else
return 0;
}
public void ResetSequenceInfo() {
Expand Down Expand Up @@ -200,4 +200,6 @@ public int FindTransitionSequence(int currentSequence, int goalSequence) {
else
return sequence;
}

public override BaseAnimating? GetBaseAnimating() => this;
}
20 changes: 19 additions & 1 deletion Game.Server/BaseCombatCharacter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,25 @@ public partial class BaseCombatCharacter : BaseFlex
public Color BloodColor;

private static object? SendProxy_SendBaseCombatCharacterLocalDataTable(SendProp prop, object instance, IFieldAccessor data, SendProxyRecipients recipients, int objectID) {
throw new NotImplementedException();
// recipients.ClearAllRecipients();

BaseCombatCharacter character = (BaseCombatCharacter)instance;
if (character != null) {
if (character.IsPlayer()) {
// recipients.SetOnly(character.EntIndex() - 1);
}
else {
IServerVehicle vehicle = character.GetServerVehicle();
if (vehicle != null) {
BaseCombatCharacter driver = vehicle.GetPassenger();
if (driver != null) {
// recipients.SetOnly(driver.EntIndex() - 1);
}
}
}
}

return data;
}

public static readonly new ServerClass ServerClass = new ServerClass("BaseCombatCharacter", DT_BaseCombatCharacter).WithManualClassID(StaticClassIndices.CBaseCombatCharacter);
Expand Down
Loading