Skip to content

Commit

Permalink
chore: Reduce print output (#130)
Browse files Browse the repository at this point in the history
  • Loading branch information
elementbound authored Nov 23, 2023
1 parent fa7586a commit 761d3d1
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 14 deletions.
2 changes: 1 addition & 1 deletion addons/netfox.extras/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox.extras"
description="Game-specific utilities for Netfox"
author="Tamas Galffy"
version="0.15.14"
version="0.15.15"
script="netfox-extras.gd"
5 changes: 1 addition & 4 deletions addons/netfox.extras/weapon/network-weapon.gd
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,8 @@ func fire() -> Node:
var data = _projectile_data[id]

if not is_multiplayer_authority():
print("Requesting projectile %s" % [id])
rpc_id(get_multiplayer_authority(), "_request_projectile", id, NetworkTime.tick, data)
else:
print("Weapon is local, accepting projectile %s" % [id])
rpc("_accept_projectile", id, NetworkTime.tick, data)

print("Calling after fire hook for %s" % [projectile.name])
Expand Down Expand Up @@ -164,15 +162,14 @@ func _request_projectile(id: String, tick: int, request_data: Dictionary):
func _accept_projectile(id: String, tick: int, response_data: Dictionary):
print("[%s] Accepting projectile %s from %s" % [multiplayer.get_unique_id(), id, multiplayer.get_remote_sender_id()])
if multiplayer.get_unique_id() == multiplayer.get_remote_sender_id():
print("Projectile %s is local, nothing to do" % [id])
# Projectile is local, nothing to do
return

if _projectiles.has(id):
var projectile = _projectiles[id]
var local_data = _projectile_data[id]
_reconcile_buffer.push_back([projectile, local_data, response_data])
else:
print("[%s] Spawning brand new projectile %s" % [multiplayer.get_unique_id(), id])
var projectile = _spawn()
_apply_data(projectile, response_data)
_projectile_data.erase(id)
Expand Down
2 changes: 1 addition & 1 deletion addons/netfox.noray/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox.noray"
description="Bulletproof your connectivity with noray integration for netfox"
author="Tamas Galffy"
version="0.15.14"
version="0.15.15"
script="netfox-noray.gd"
1 change: 0 additions & 1 deletion addons/netfox/network-events.gd
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,6 @@ func is_server() -> bool:

func _ready():
enabled = ProjectSettings.get_setting("netfox/events/enabled", true)
print("Network Events is %s" % [enabled])

# Automatically start ticking when entering multiplayer and stop when
# leaving multiplayer
Expand Down
2 changes: 1 addition & 1 deletion addons/netfox/plugin.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
name="netfox"
description="A higher-level networking addon with rollback support"
author="Tamas Galffy"
version="0.15.14"
version="0.15.15"
script="netfox.gd"
6 changes: 0 additions & 6 deletions examples/forest-brawl/scripts/brawler-crown.gd
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,19 @@ func _handle_scores(scores: Dictionary):

# No crown in single player
if scores.size() == 1:
print("Only one player!")
return

var max_score = scores.values().max()
var max_players = scores.keys().filter(func(p): return scores[p] == max_score)

# Multiple players share the crown
if max_players.size() > 1:
print("Multiple players with crown!")
return

var player_id = max_players[0]
var player = get_tree().get_nodes_in_group("Brawlers")\
.filter(func(it): return it.player_id == player_id)\
.pop_back()

print("All players: %s" % [get_tree().get_nodes_in_group("Brawlers")])
print("Player by id %s: %s" % [player_id, get_tree().get_nodes_in_group("Brawlers")\
.filter(func(it): return it.player_id == player_id)])

target = player
is_enabled = true

0 comments on commit 761d3d1

Please sign in to comment.