Permalink
Browse files

Bombs now hit other players scores are correct

  • Loading branch information...
1 parent d8539f8 commit 7237d76d0b0e3e0f54143b4e65fd18b1195b5f3f @MrJaba committed Apr 17, 2010
Showing with 8,031 additions and 11 deletions.
  1. +1 −1 config/app.rb
  2. +4 −3 cramp/controller/websocket.rb
  3. +8,010 −0 log/bomberman.log
  4. +8 −2 public/javascripts/explosion.js
  5. +5 −4 public/javascripts/game.js
  6. +3 −1 public/javascripts/game_client.js
View
@@ -1,7 +1,7 @@
module Bomberman
App =
Rack::Builder.new do
- use Rack::CommonLogger
+ use Rack::CommonLogger
routes = Usher::Interface.for(:rack) do
add('/game').to GameController
add('/').to RootController
@@ -48,10 +48,11 @@ def render(body)
end
def _on_data_receive(data)
- data = data.slice(/\000([^\377]*)\377/).gsub(/^\x00|\xff$/, '')
-
+ data = data.split(/\000([^\377]*)\377/).select{|d| !d.empty? }.collect{|d| d.gsub(/^\x00|\xff$/, '') }
self.class.on_data_callbacks.each do |callback|
- EM.next_tick { send(callback, data) }
+ data.each do |message|
+ EM.next_tick { send(callback, message) }
+ end
end
end
Oops, something went wrong.

0 comments on commit 7237d76

Please sign in to comment.