Skip to content

Commit

Permalink
chore: Remove debug.
Browse files Browse the repository at this point in the history
  • Loading branch information
JoshPiper committed Jan 14, 2025
1 parent 2671a25 commit 2457b1a
Showing 1 changed file with 4 additions and 14 deletions.
18 changes: 4 additions & 14 deletions lua/autorun/photon/shared/sh_simplenet.lua
Original file line number Diff line number Diff line change
Expand Up @@ -127,31 +127,18 @@ end
if SERVER then
local cds = {}
net.Receive("Photon_SimpleNet_Sync", function(len, ply)
print("doing sync")
local ent = net.ReadEntity()
if not IsValid(ent) or not ent.IsEMV or not ent:IsEMV() then
print("invalid or non-photon vehicle")
return
end

if not IsValid(ply) then
print("invalid player")
return
end

local cdi = ply:SteamID() .. ":" .. ent:EntIndex()
local cd = cds[cdi]
if cd ~= nil and CurTime() + 10 >= cd then
print("prevented sync spam from ply")
return
end

print("-----")
print("syncing " .. tostring(ent) .. " to " .. tostring(ply))
net.Start("Photon_SimpleNet_Sync")
net.WriteEntity(ent)
for _, datum in ipairs(NET.FMap) do
PrintTable(datum)
local v = ent[NET.Normalise(datum[1])]
if v == nil then
net.WriteBool(false)
Expand Down Expand Up @@ -180,7 +167,10 @@ if CLIENT then
local ent = net.ReadEntity()
local idx = net.ReadUInt(NET.Bits)
if not IsValid(ent) then
return PhotonWarning("Invalid Entity given in Photon_SimpleNet_Change")
-- I would keep this, but this is fucking spammy as all hell.
-- So I'm not.
-- PhotonWarning("Invalid Entity given in Photon_SimpleNet_Change")
return
end
local name, netType, extra = unpack(NET.FMap[idx])
ent[NET.Normalise(name)] = NET.ReadFunctions[netType](extra)
Expand Down

0 comments on commit 2457b1a

Please sign in to comment.