Commit cd293d04 by Nick An

add doc

parent 84143c7e
{
type: 'moving', # 'start' , 'entry', 'clicking'
cid: 'abcdefg',
room_id: 'asdfadfaf',
payload: {
open_id: 'asdfasdfa',
picture: 'https://xxx.com',
x: 1,
y: 4
}
}
{
type: 'game_ready',
cid: 'abcdefg',
room_id: 'asdfadfaf',
payload: {
open_id: 'asdfasdfa',
picture: 'https://xxx.com',
role: 'ghost', # runner
x: 1,
y: 3
}
}
\ No newline at end of file
......@@ -97,10 +97,12 @@ module CrazyFlirt
return unless @faye.websocket?(env)
default_room = "default_room"
ws = @faye.new(env)
ws.on :message do |event|
ws.send(event.data)
message = JSON.parse(event.data)
seq = message[:seq]
command(seq, message)
......@@ -109,6 +111,7 @@ module CrazyFlirt
ws.on :close do |event|
puts 'closed'
end
ws.rack_response
end
......@@ -146,4 +149,4 @@ module CrazyFlirt
end
end
Rack::Handler.get('thin').run(CrazyFlirt::SocketEngine.new, Host: '192.168.50.118', Port: 80)
\ No newline at end of file
Rack::Handler.get('thin').run(CrazyFlirt::SocketEngine.new, Host: '192.168.50.118', Port: 9090)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment