mirror of
https://github.com/IntQuant/noita_entangled_worlds.git
synced 2025-10-19 15:13:16 +00:00
Retire commented out/spammy GamePrints to git history.
This commit is contained in:
parent
35e56969ef
commit
e92de6829d
11 changed files with 6 additions and 39 deletions
|
@ -157,7 +157,6 @@ function net.init()
|
||||||
if ctx.ready or msg_decoded.kind ~= "mod" then
|
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)
|
util.tpcall(net_handling[msg_decoded.kind][msg_decoded.key], msg_decoded.peer_id, msg_decoded.value, msg_decoded.value2)
|
||||||
end
|
end
|
||||||
-- GamePrint("NetHnd: "..msg_decoded.kind.." "..msg_decoded.key)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
|
@ -70,7 +70,6 @@ function net_handling.mod.inventory(peer_id, inventory_state)
|
||||||
local player_data = player_fns.peer_get_player_data(peer_id)
|
local player_data = player_fns.peer_get_player_data(peer_id)
|
||||||
player_data.latest_inventory = inventory_state
|
player_data.latest_inventory = inventory_state
|
||||||
player_fns.deserialize_items(inventory_state, player_data)
|
player_fns.deserialize_items(inventory_state, player_data)
|
||||||
-- GamePrint("synced inventory")
|
|
||||||
end
|
end
|
||||||
|
|
||||||
function net_handling.mod.perks(peer_id, perk_data)
|
function net_handling.mod.perks(peer_id, perk_data)
|
||||||
|
@ -150,8 +149,8 @@ function net_handling.mod.fire(peer_id, fire_data)
|
||||||
ComponentSetValue2(controlsComp, "mButtonDownFire", firing)
|
ComponentSetValue2(controlsComp, "mButtonDownFire", firing)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
if #player_data.projectile_rng_init > 0 then
|
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
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
|
@ -328,7 +328,6 @@ local player_fns = {
|
||||||
end
|
end
|
||||||
end,
|
end,
|
||||||
make_playerdata_for = function(entity_id, peer_id)
|
make_playerdata_for = function(entity_id, peer_id)
|
||||||
GamePrint("Made playerdata for "..entity_id)
|
|
||||||
return {
|
return {
|
||||||
entity = entity_id,
|
entity = entity_id,
|
||||||
peer_id = peer_id,
|
peer_id = peer_id,
|
||||||
|
@ -345,7 +344,7 @@ local player_fns = {
|
||||||
function player_fns.serialize_position(player_data)
|
function player_fns.serialize_position(player_data)
|
||||||
local entity = player_data.entity
|
local entity = player_data.entity
|
||||||
if not EntityGetIsAlive(entity) then
|
if not EntityGetIsAlive(entity) then
|
||||||
GamePrint("notalive")
|
print("notalive")
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
local x, y = EntityGetTransform(entity)
|
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
|
if ctx.run_ended or peer_id == ctx.my_id then
|
||||||
util.print_traceback()
|
util.print_traceback()
|
||||||
end
|
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)
|
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
|
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
|
for _, entity in ipairs(EntityGetWithTag("ew_client")) do
|
||||||
if ctx.player_data_by_local_entity[entity] == nil then
|
if ctx.player_data_by_local_entity[entity] == nil then
|
||||||
EntityKill(entity)
|
EntityKill(entity)
|
||||||
GamePrint("Removed phantom player entity")
|
print("Removed phantom player entity")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
for peer_id, player_data in pairs(ctx.players) do
|
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
|
if peer_id ~= ctx.my_player.peer_id and not EntityGetIsAlive(player_data.entity) then
|
||||||
GamePrint("Respawning player entity")
|
|
||||||
print("Respawning player entity")
|
print("Respawning player entity")
|
||||||
player_fns.spawn_player_for(peer_id, 0, 0, player_data)
|
player_fns.spawn_player_for(peer_id, 0, 0, player_data)
|
||||||
local latest_inventory = player_data.latest_inventory
|
local latest_inventory = player_data.latest_inventory
|
||||||
if latest_inventory ~= nil then
|
if latest_inventory ~= nil then
|
||||||
GamePrint("Recovering inventory")
|
print("Recovering inventory")
|
||||||
player_fns.deserialize_items(latest_inventory, player_data)
|
player_fns.deserialize_items(latest_inventory, player_data)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
@ -538,7 +536,6 @@ end
|
||||||
|
|
||||||
function player_fns.set_current_slot(slot_data, player_data)
|
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]
|
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
|
if (player_data.entity and EntityGetIsAlive(player_data.entity)) then
|
||||||
local items = GameGetAllInventoryItems(player_data.entity) or {}
|
local items = GameGetAllInventoryItems(player_data.entity) or {}
|
||||||
for i, item in ipairs(items) do
|
for i, item in ipairs(items) do
|
||||||
|
|
|
@ -6,19 +6,14 @@ order_deck = function()
|
||||||
|
|
||||||
local shooter = EntityGetRootEntity(GetUpdatedEntityID())
|
local shooter = EntityGetRootEntity(GetUpdatedEntityID())
|
||||||
|
|
||||||
--GamePrint(EntityGetName(shooter))
|
|
||||||
|
|
||||||
oldSetRandomSeed(GameGetFrameNum(), GameGetFrameNum())
|
oldSetRandomSeed(GameGetFrameNum(), GameGetFrameNum())
|
||||||
|
|
||||||
local seed = 0
|
local seed = 0
|
||||||
if(EntityHasTag(shooter, "ew_client"))then
|
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
|
seed = tonumber(GlobalsGetValue("ew_shooter_rng_"..EntityGetName(shooter), "0")) or 0
|
||||||
elseif(EntityHasTag(shooter, "player_unit"))then
|
elseif(EntityHasTag(shooter, "player_unit"))then
|
||||||
seed = Random(10, 10000000)
|
seed = Random(10, 10000000)
|
||||||
GlobalsSetValue("ew_player_rng", tostring(seed))
|
GlobalsSetValue("ew_player_rng", tostring(seed))
|
||||||
-- GamePrint(tostring(seed))
|
|
||||||
end
|
end
|
||||||
|
|
||||||
oldSetRandomSeed(seed, seed)
|
oldSetRandomSeed(seed, seed)
|
||||||
|
|
|
@ -1,13 +1,10 @@
|
||||||
function throw_item()
|
function throw_item()
|
||||||
-- GamePrint("Item thrown")
|
|
||||||
GlobalsSetValue("ew_thrown", tostring(GetUpdatedEntityID()))
|
GlobalsSetValue("ew_thrown", tostring(GetUpdatedEntityID()))
|
||||||
end
|
end
|
||||||
|
|
||||||
function item_pickup()
|
function item_pickup()
|
||||||
-- GamePrint("Item pickup")
|
|
||||||
GlobalsSetValue("ew_picked", tostring(GetUpdatedEntityID()))
|
GlobalsSetValue("ew_picked", tostring(GetUpdatedEntityID()))
|
||||||
end
|
end
|
||||||
|
|
||||||
function kick()
|
function kick()
|
||||||
-- GamePrint("Item kicked")
|
|
||||||
end
|
end
|
|
@ -14,8 +14,6 @@ function effect_sync.get_ent_effects(entity)
|
||||||
for _, ent in ipairs(EntityGetAllChildren(entity) or {}) do
|
for _, ent in ipairs(EntityGetAllChildren(entity) or {}) do
|
||||||
local com = EntityGetFirstComponentIncludingDisabled(ent, "GameEffectComponent")
|
local com = EntityGetFirstComponentIncludingDisabled(ent, "GameEffectComponent")
|
||||||
if com ~= nil then
|
if com ~= nil then
|
||||||
-- local name = ComponentGetValue2(com, "effect")
|
|
||||||
-- GamePrint("eff "..name)
|
|
||||||
table.insert(list, ent)
|
table.insert(list, ent)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -142,7 +142,6 @@ local function get_sync_entities(return_all)
|
||||||
return has_anyone
|
return has_anyone
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
-- GamePrint("skipped "..skipped_counter.." out of "..#entities)
|
|
||||||
|
|
||||||
return entities2
|
return entities2
|
||||||
end
|
end
|
||||||
|
@ -239,9 +238,6 @@ function enemy_sync.host_upload_entities()
|
||||||
::continue::
|
::continue::
|
||||||
end
|
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)
|
rpc.handle_enemy_data(enemy_data_list)
|
||||||
if #dead_entities > 0 then
|
if #dead_entities > 0 then
|
||||||
rpc.handle_death_data(dead_entities)
|
rpc.handle_death_data(dead_entities)
|
||||||
|
@ -375,7 +371,6 @@ function rpc.handle_death_data(death_data)
|
||||||
end
|
end
|
||||||
|
|
||||||
function rpc.handle_enemy_data(enemy_data)
|
function rpc.handle_enemy_data(enemy_data)
|
||||||
-- GamePrint("Got enemy data: "..#enemy_data)
|
|
||||||
for _, enemy_info_raw in ipairs(enemy_data) do
|
for _, enemy_info_raw in ipairs(enemy_data) do
|
||||||
local filename = enemy_info_raw[1]
|
local filename = enemy_info_raw[1]
|
||||||
filename = constants.interned_index_to_filename[filename] or filename
|
filename = constants.interned_index_to_filename[filename] or filename
|
||||||
|
@ -492,7 +487,6 @@ end
|
||||||
|
|
||||||
|
|
||||||
function rpc.handle_enemy_health(enemy_health_data)
|
function rpc.handle_enemy_health(enemy_health_data)
|
||||||
-- GamePrint("Got enemy data: "..#enemy_data)
|
|
||||||
for _, en_data in ipairs(enemy_health_data) do
|
for _, en_data in ipairs(enemy_health_data) do
|
||||||
local remote_enemy_id = en_data.enemy_id
|
local remote_enemy_id = en_data.enemy_id
|
||||||
local hp = en_data.hp
|
local hp = en_data.hp
|
||||||
|
|
|
@ -21,7 +21,6 @@ function effect_sync.get_ent_effects(entity)
|
||||||
if not IGNORE_EFFECTS[name] then
|
if not IGNORE_EFFECTS[name] then
|
||||||
table.insert(list, ent)
|
table.insert(list, ent)
|
||||||
end
|
end
|
||||||
-- GamePrint("eff "..name)
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
return list
|
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
|
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])
|
local ent = EntityLoad(effect[2])
|
||||||
EntityAddChild(entity, ent)
|
EntityAddChild(entity, ent)
|
||||||
-- GamePrint("Replicating "..effect_remote_id.." as "..ent)
|
|
||||||
local_by_remote_id[effect_remote_id] = ent
|
local_by_remote_id[effect_remote_id] = ent
|
||||||
local com = EntityGetFirstComponentIncludingDisabled(ent, "GameEffectComponent")
|
local com = EntityGetFirstComponentIncludingDisabled(ent, "GameEffectComponent")
|
||||||
if com ~= nil then
|
if com ~= nil then
|
||||||
|
@ -79,7 +77,6 @@ function rpc.send_effects(effects)
|
||||||
local local_effects = effect_sync.get_ent_effects(entity)
|
local local_effects = effect_sync.get_ent_effects(entity)
|
||||||
for _, effect in ipairs(local_effects) do
|
for _, effect in ipairs(local_effects) do
|
||||||
if not confirmed_effects[effect] then
|
if not confirmed_effects[effect] then
|
||||||
-- GamePrint("Removing "..effect)
|
|
||||||
EntityKill(effect)
|
EntityKill(effect)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -11,7 +11,6 @@ function nickname.parse( font_filename )
|
||||||
local id_width = {}
|
local id_width = {}
|
||||||
|
|
||||||
local file = ModTextFileGetContent(font_filename)
|
local file = ModTextFileGetContent(font_filename)
|
||||||
--GamePrint(file:find("QuadChar"))
|
|
||||||
local quad_open = false
|
local quad_open = false
|
||||||
local space_open = false
|
local space_open = false
|
||||||
|
|
||||||
|
@ -30,12 +29,10 @@ function nickname.parse( font_filename )
|
||||||
end
|
end
|
||||||
|
|
||||||
if (space_open == true) then
|
if (space_open == true) then
|
||||||
--GamePrint(split)
|
|
||||||
id_width["space"] = tonumber(split)
|
id_width["space"] = tonumber(split)
|
||||||
end
|
end
|
||||||
|
|
||||||
if (quad_open == true) then
|
if (quad_open == true) then
|
||||||
--GamePrint(split)
|
|
||||||
if (string.sub(split, 1, 3) == "id=") then
|
if (string.sub(split, 1, 3) == "id=") then
|
||||||
id = tonumber(string.sub(split, 5, -2))
|
id = tonumber(string.sub(split, 5, -2))
|
||||||
--id = string.sub(v, 5, -2)
|
--id = string.sub(v, 5, -2)
|
||||||
|
@ -68,7 +65,6 @@ function nickname.calculate_textwidth(text, font)
|
||||||
textwidth = textwidth + font["space"]
|
textwidth = textwidth + font["space"]
|
||||||
else
|
else
|
||||||
local c_id = string.byte(l)
|
local c_id = string.byte(l)
|
||||||
--GamePrint("Char: ".. l .. ". Id: "..tostring(c_id))
|
|
||||||
textwidth = textwidth + (font[c_id] or 1)
|
textwidth = textwidth + (font[c_id] or 1)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
|
@ -76,7 +76,6 @@ local PixelRun_const_ptr = ffi.typeof("struct PixelRun const*")
|
||||||
|
|
||||||
function world_sync.handle_world_data(datum)
|
function world_sync.handle_world_data(datum)
|
||||||
local grid_world = world_ffi.get_grid_world()
|
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 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))
|
local runs = ffi.cast(PixelRun_const_ptr, ffi.cast("const char*", datum) + ffi.sizeof(world.EncodedAreaHeader))
|
||||||
world.decode(grid_world, header, runs)
|
world.decode(grid_world, header, runs)
|
||||||
|
|
|
@ -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)
|
rng = table.remove(shooter_player_data.projectile_rng_init, 1)
|
||||||
else
|
else
|
||||||
-- Shouldn't happen
|
-- Shouldn't happen
|
||||||
-- GamePrint("No values in projectile_rng_init")
|
|
||||||
rng = 0
|
rng = 0
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
|
@ -150,7 +149,6 @@ function OnProjectileFired(shooter_id, projectile_id, initial_rng, position_x, p
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
shooter_player_data.projectile_seed_chain[projectile_id] = rng
|
shooter_player_data.projectile_seed_chain[projectile_id] = rng
|
||||||
-- GamePrint("on fired "..projectile_id.." "..entity_that_shot.." "..shooter_id.." "..rng)
|
|
||||||
np.SetProjectileSpreadRNG(rng)
|
np.SetProjectileSpreadRNG(rng)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -202,7 +200,6 @@ function OnPlayerSpawned( player_entity ) -- This runs when player entity has be
|
||||||
ctx.initial_player_pos = {x=x, y=y}
|
ctx.initial_player_pos = {x=x, y=y}
|
||||||
|
|
||||||
local my_player = player_fns.make_playerdata_for(player_entity, ctx.my_id)
|
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.players[ctx.my_id] = my_player
|
||||||
ctx.player_data_by_local_entity[player_entity] = my_player
|
ctx.player_data_by_local_entity[player_entity] = my_player
|
||||||
ctx.ready = true
|
ctx.ready = true
|
||||||
|
@ -268,7 +265,6 @@ local function on_world_pre_update_inner()
|
||||||
wait(1)
|
wait(1)
|
||||||
local inventory_state = player_fns.serialize_items(ctx.my_player)
|
local inventory_state = player_fns.serialize_items(ctx.my_player)
|
||||||
if inventory_state ~= nil then
|
if inventory_state ~= nil then
|
||||||
-- GamePrint("Sending updated inventory")
|
|
||||||
net.send_player_inventory(inventory_state)
|
net.send_player_inventory(inventory_state)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue