Retire commented out/spammy GamePrints to git history.

This commit is contained in:
IQuant 2024-08-28 14:03:34 +03:00
parent 35e56969ef
commit e92de6829d
11 changed files with 6 additions and 39 deletions

View file

@ -157,7 +157,6 @@ function net.init()
if ctx.ready or msg_decoded.kind ~= "mod" then
util.tpcall(net_handling[msg_decoded.kind][msg_decoded.key], msg_decoded.peer_id, msg_decoded.value, msg_decoded.value2)
end
-- GamePrint("NetHnd: "..msg_decoded.kind.." "..msg_decoded.key)
end
end
end)

View file

@ -70,7 +70,6 @@ function net_handling.mod.inventory(peer_id, inventory_state)
local player_data = player_fns.peer_get_player_data(peer_id)
player_data.latest_inventory = inventory_state
player_fns.deserialize_items(inventory_state, player_data)
-- GamePrint("synced inventory")
end
function net_handling.mod.perks(peer_id, perk_data)
@ -151,7 +150,7 @@ function net_handling.mod.fire(peer_id, fire_data)
end
end
if #player_data.projectile_rng_init > 0 then
-- GamePrint("unused projectile_rng_init values left "..#player_data.projectile_rng_init)
-- Shouldn't happen
end
end

View file

@ -328,7 +328,6 @@ local player_fns = {
end
end,
make_playerdata_for = function(entity_id, peer_id)
GamePrint("Made playerdata for "..entity_id)
return {
entity = entity_id,
peer_id = peer_id,
@ -345,7 +344,7 @@ local player_fns = {
function player_fns.serialize_position(player_data)
local entity = player_data.entity
if not EntityGetIsAlive(entity) then
GamePrint("notalive")
print("notalive")
return
end
local x, y = EntityGetTransform(entity)
@ -420,7 +419,7 @@ function player_fns.spawn_player_for(peer_id, x, y, existing_playerdata)
if ctx.run_ended or peer_id == ctx.my_id then
util.print_traceback()
end
GamePrint("Spawning player for "..peer_id)
print("Spawning player for "..peer_id)
local new = EntityLoad("mods/quant.ew/files/system/player/tmp/" .. peer_id .. "_base.xml", x, y)
if ctx.proxy_opt.game_mode == "shared_health" then
@ -481,17 +480,16 @@ function player_fns.respawn_if_necessary()
for _, entity in ipairs(EntityGetWithTag("ew_client")) do
if ctx.player_data_by_local_entity[entity] == nil then
EntityKill(entity)
GamePrint("Removed phantom player entity")
print("Removed phantom player entity")
end
end
for peer_id, player_data in pairs(ctx.players) do
if peer_id ~= ctx.my_player.peer_id and not EntityGetIsAlive(player_data.entity) then
GamePrint("Respawning player entity")
print("Respawning player entity")
player_fns.spawn_player_for(peer_id, 0, 0, player_data)
local latest_inventory = player_data.latest_inventory
if latest_inventory ~= nil then
GamePrint("Recovering inventory")
print("Recovering inventory")
player_fns.deserialize_items(latest_inventory, player_data)
end
end
@ -538,7 +536,6 @@ end
function player_fns.set_current_slot(slot_data, player_data)
local is_wand, slot_x, slot_y = slot_data[1], slot_data[2], slot_data[3]
-- GamePrint("Switching item to slot: " .. tostring(slot_x) .. ", " .. tostring(slot_y))
if (player_data.entity and EntityGetIsAlive(player_data.entity)) then
local items = GameGetAllInventoryItems(player_data.entity) or {}
for i, item in ipairs(items) do

View file

@ -6,19 +6,14 @@ order_deck = function()
local shooter = EntityGetRootEntity(GetUpdatedEntityID())
--GamePrint(EntityGetName(shooter))
oldSetRandomSeed(GameGetFrameNum(), GameGetFrameNum())
local seed = 0
if(EntityHasTag(shooter, "ew_client"))then
-- GamePrint("2: ew_shooter_rng_"..EntityGetName(shooter))
-- GamePrint(GlobalsGetValue("ew_shooter_rng_"..EntityGetName(shooter), "0"))
seed = tonumber(GlobalsGetValue("ew_shooter_rng_"..EntityGetName(shooter), "0")) or 0
elseif(EntityHasTag(shooter, "player_unit"))then
seed = Random(10, 10000000)
GlobalsSetValue("ew_player_rng", tostring(seed))
-- GamePrint(tostring(seed))
end
oldSetRandomSeed(seed, seed)

View file

@ -1,13 +1,10 @@
function throw_item()
-- GamePrint("Item thrown")
GlobalsSetValue("ew_thrown", tostring(GetUpdatedEntityID()))
end
function item_pickup()
-- GamePrint("Item pickup")
GlobalsSetValue("ew_picked", tostring(GetUpdatedEntityID()))
end
function kick()
-- GamePrint("Item kicked")
end

View file

@ -14,8 +14,6 @@ function effect_sync.get_ent_effects(entity)
for _, ent in ipairs(EntityGetAllChildren(entity) or {}) do
local com = EntityGetFirstComponentIncludingDisabled(ent, "GameEffectComponent")
if com ~= nil then
-- local name = ComponentGetValue2(com, "effect")
-- GamePrint("eff "..name)
table.insert(list, ent)
end
end

View file

@ -142,7 +142,6 @@ local function get_sync_entities(return_all)
return has_anyone
end)
end
-- GamePrint("skipped "..skipped_counter.." out of "..#entities)
return entities2
end
@ -239,9 +238,6 @@ function enemy_sync.host_upload_entities()
::continue::
end
-- local estimate = net.estimate_rpc_size(enemy_data_list)
-- GamePrint(#enemy_data_list.." "..net.estimate_rpc_size(enemy_data_list).." "..(estimate*30))
rpc.handle_enemy_data(enemy_data_list)
if #dead_entities > 0 then
rpc.handle_death_data(dead_entities)
@ -375,7 +371,6 @@ function rpc.handle_death_data(death_data)
end
function rpc.handle_enemy_data(enemy_data)
-- GamePrint("Got enemy data: "..#enemy_data)
for _, enemy_info_raw in ipairs(enemy_data) do
local filename = enemy_info_raw[1]
filename = constants.interned_index_to_filename[filename] or filename
@ -492,7 +487,6 @@ end
function rpc.handle_enemy_health(enemy_health_data)
-- GamePrint("Got enemy data: "..#enemy_data)
for _, en_data in ipairs(enemy_health_data) do
local remote_enemy_id = en_data.enemy_id
local hp = en_data.hp

View file

@ -21,7 +21,6 @@ function effect_sync.get_ent_effects(entity)
if not IGNORE_EFFECTS[name] then
table.insert(list, ent)
end
-- GamePrint("eff "..name)
end
end
return list
@ -66,7 +65,6 @@ function rpc.send_effects(effects)
if local_by_remote_id[effect_remote_id] == nil or not EntityGetIsAlive(local_by_remote_id[effect_remote_id]) or not EntityGetIsAlive(entity) then
local ent = EntityLoad(effect[2])
EntityAddChild(entity, ent)
-- GamePrint("Replicating "..effect_remote_id.." as "..ent)
local_by_remote_id[effect_remote_id] = ent
local com = EntityGetFirstComponentIncludingDisabled(ent, "GameEffectComponent")
if com ~= nil then
@ -79,7 +77,6 @@ function rpc.send_effects(effects)
local local_effects = effect_sync.get_ent_effects(entity)
for _, effect in ipairs(local_effects) do
if not confirmed_effects[effect] then
-- GamePrint("Removing "..effect)
EntityKill(effect)
end
end

View file

@ -11,7 +11,6 @@ function nickname.parse( font_filename )
local id_width = {}
local file = ModTextFileGetContent(font_filename)
--GamePrint(file:find("QuadChar"))
local quad_open = false
local space_open = false
@ -30,12 +29,10 @@ function nickname.parse( font_filename )
end
if (space_open == true) then
--GamePrint(split)
id_width["space"] = tonumber(split)
end
if (quad_open == true) then
--GamePrint(split)
if (string.sub(split, 1, 3) == "id=") then
id = tonumber(string.sub(split, 5, -2))
--id = string.sub(v, 5, -2)
@ -68,7 +65,6 @@ function nickname.calculate_textwidth(text, font)
textwidth = textwidth + font["space"]
else
local c_id = string.byte(l)
--GamePrint("Char: ".. l .. ". Id: "..tostring(c_id))
textwidth = textwidth + (font[c_id] or 1)
end
end

View file

@ -76,7 +76,6 @@ local PixelRun_const_ptr = ffi.typeof("struct PixelRun const*")
function world_sync.handle_world_data(datum)
local grid_world = world_ffi.get_grid_world()
-- GamePrint("Decoding world data "..i)
local header = ffi.cast("struct EncodedAreaHeader const*", ffi.cast('char const*', datum))
local runs = ffi.cast(PixelRun_const_ptr, ffi.cast("const char*", datum) + ffi.sizeof(world.EncodedAreaHeader))
world.decode(grid_world, header, runs)

View file

@ -142,7 +142,6 @@ function OnProjectileFired(shooter_id, projectile_id, initial_rng, position_x, p
rng = table.remove(shooter_player_data.projectile_rng_init, 1)
else
-- Shouldn't happen
-- GamePrint("No values in projectile_rng_init")
rng = 0
end
else
@ -150,7 +149,6 @@ function OnProjectileFired(shooter_id, projectile_id, initial_rng, position_x, p
end
end
shooter_player_data.projectile_seed_chain[projectile_id] = rng
-- GamePrint("on fired "..projectile_id.." "..entity_that_shot.." "..shooter_id.." "..rng)
np.SetProjectileSpreadRNG(rng)
end
@ -202,7 +200,6 @@ function OnPlayerSpawned( player_entity ) -- This runs when player entity has be
ctx.initial_player_pos = {x=x, y=y}
local my_player = player_fns.make_playerdata_for(player_entity, ctx.my_id)
GamePrint("My peer_id: "..ctx.my_id)
ctx.players[ctx.my_id] = my_player
ctx.player_data_by_local_entity[player_entity] = my_player
ctx.ready = true
@ -268,7 +265,6 @@ local function on_world_pre_update_inner()
wait(1)
local inventory_state = player_fns.serialize_items(ctx.my_player)
if inventory_state ~= nil then
-- GamePrint("Sending updated inventory")
net.send_player_inventory(inventory_state)
end
end)