add player rating to the db
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
# Client flow:
|
||||
# 1. Connect: ws(s)://host/cable?token=<JWT>
|
||||
# 2. Subscribe to "MatchmakingChannel"
|
||||
# 3. Send { action: "start", rating: <optional int> } to enter the queue
|
||||
# 3. Send { action: "start" } to enter the queue
|
||||
# 4. Receive { type: "matched", ... } or { type: "timeout" }
|
||||
# 5. Disconnecting (or sending { action: "stop" }) cancels the search.
|
||||
class MatchmakingChannel < ApplicationCable::Channel
|
||||
@@ -17,8 +17,8 @@ class MatchmakingChannel < ApplicationCable::Channel
|
||||
end
|
||||
end
|
||||
|
||||
def start(data)
|
||||
MatchmakingService.enqueue(current_user.id, rating: data["rating"])
|
||||
def start(_data)
|
||||
MatchmakingService.enqueue(current_user.id, rating: current_user.rating)
|
||||
end
|
||||
|
||||
def stop
|
||||
|
||||
Reference in New Issue
Block a user