Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Really not sure what's wrong. Trying to send Match Data #80

Open
goodiesohhi opened this issue Jul 11, 2024 · 2 comments
Open

Really not sure what's wrong. Trying to send Match Data #80

goodiesohhi opened this issue Jul 11, 2024 · 2 comments

Comments

@goodiesohhi
Copy link

goodiesohhi commented Jul 11, 2024

trying to send match data with

local result = socket.match_data_send(matchid , opcodes.send_input, data)

this is being done in a coroutine with a connected socket.

No error, the server sees that the message is recieved like this

{"level":"debug","ts":"2024-07-10T17:18:31.705-0400","caller":"server/pipeline.go:65","msg":"Received *rtapi.Envelope_MatchDataSend message","uid":"2f1ac17d-b374-4aa2-85b1-34a73ee10af2","sid":"ea506ba6-3f01-11ef-b43b-e0e9830395f8","message":{"MatchDataSend":{"match_id":"89786132-d824-41e1-ad7d-820960662c7d.doomscroller","op_code":3,"data":"eyJ4IjoxLjA3MDY4ODAzMDE2MDIsInkiOjB9"}}}
I've tried both the lua and the typescript runtime, no dice. Essentially, the server receives the message but doesn't actually forward it to the match_loop handlers or anything. My only theory is that my match id is somehow wrong? I'm sending the same match_id that I save from the callback of the rpc that creates the match, its the same match_id as the one I use to successfully join. Then I try to send match data to that same match id, the server receives it but it never seems to make it to the match_loop. the messages table/object is literally empty. I have no idea what's causing this, can't find any similar issues and don't even know if this is something wrong with the client library or the runtimes or what I'm doing wrong.

Copy link

linear bot commented Jul 11, 2024

@goodiesohhi
Copy link
Author

goodiesohhi commented Jul 11, 2024

A minimum repro would be create a match using an rpc, join the authoritative match with the match id from the callback of the rpc, then attempt to send match data using socket.match_data_send. The server runtime debug logs show the message as being received but it's not propagated any further and does not actually reach the match_loop.

my create match rpc looks like this:

local function create_match(context, payload)
  local modulename = "normal_run"
  local setupstate = { initialstate = payload }
  local matchid = nk.match_create(modulename, setupstate)

  return nk.json_encode({ matchid = matchid })
end

nk.register_rpc(create_match, "create_match_rpc")

my match data send looks like this

local result = socket.match_data_send(match.match["match_id"] , opcodes.send_input, data)

the socket is joining the match properly as I can see there is a presence. But the message doesn't reach the matchloop and never goes further than what the person here #59 before the issue was closed due to inactivity was reporting. Just the runtime debug logs of a message being received. Match_loop messages stay empty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant