Skip to content

Commit

Permalink
performed a stress test and fixed a couple resulting bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
jimsmi6 committed Apr 13, 2012
1 parent 062660c commit 879f64a
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions lib/calyx/net/packetloader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ def Net.load_packets
end

def Net.handle_packet(player, packet)
return if !player

if PACKETS.include?(packet.opcode)
handler = PACKETS[packet.opcode]

Expand Down
2 changes: 1 addition & 1 deletion lib/calyx/tasks/player_update.rb
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def execute
WORLD.region_manager.get_local_players(@player).each {|p|
# Make sure we have space and avoid duplicates
break if @player.local_players.size >= 255
next if p.eql?(@player) || @player.local_players.include?(p)
next if p.index == nil || p.eql?(@player) || @player.local_players.include?(p)

# Add and update the new player
@player.local_players << p
Expand Down
2 changes: 1 addition & 1 deletion lib/calyx/tasks/update_event.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ def execute
}

WORLD.players.each {|p|
# TODO check if the connection is inactive
next unless p.index
ticks << PlayerTickTask.new(p)
resets << PlayerResetTask.new(p)
updates << PlayerUpdateTask.new(p)
Expand Down

0 comments on commit 879f64a

Please sign in to comment.