beyond-all-reason / teiserver

Middleware server for online gaming
https://www.beyondallreason.info/
MIT License
49 stars 46 forks source link

Matchmaking #87

Open Teifion opened 1 year ago

knoxy5467 commented 1 year ago

Is there any files or documentation related to this written? or is it completely wild west?

Teifion commented 1 year ago

queue_wait_server.ex and queue_match_server.ex are the two main files that implement matchmaking. There are also some matchmaking tests for the (TCP based) Tachyon protocol which would be of use to you.

knoxy5467 commented 1 year ago

ok, so we have an expected behavior between the server when matchmaking and the lobby client? Is it outlined anywhere?

knoxy5467 commented 1 year ago

after reading this, it looks like there is the add_group and remove group calls, these are the primary calls that the lobby is making to the tachyon server. add_group taking a QueueGroup with lists of members and their ratings correct?

Other things that getting information like get_info

I also see references to PubSub.

My confusion right now is where to find what the tachyon servers are expecting in terms of Client - Server communications. As my (limited) understanding begets ; tachyon is a TCP websocket connection. it sends messages to and from clients and this is where our "actions" live.

Please correct me if I am wrong or looking in the wrong places.

I've looked in router.ex and I see that there is the scope games and matchmaking I've also found the matchmaking_agent_server.ex aswell which seems to be communicating with the Pheonix Channel.

I'm assuming the Phoenix Channel is the websocket handler for our server. so the messages between the client and the server are within that file correct?

so the files that I need to look in to build a proper front end lobby client for matchmaking is in matchmaking_out.ex matchmaking.ex the two files you mentioned earlier queue_wait_server.ex and queue_match_server.ex and matchmaking_agent_server.ex

so does the s.matchmaking.join_queue join the party into the queue or just and individual?

I'm still reading and intaking code right now. I just wanted to make sure that I was on the right track

Teifion commented 1 year ago

I'm sorry, I thought you were looking to dev it from the server side. In that case the information I gave you is very misleading. You'll be wanting the tachyon docs. Note we are swapping over to the new system but I expect roughly this format to be maintained.

All the things you saw in the repo here so far are the internal processes and messaging systems.

knoxy5467 commented 1 year ago

I'd like to do both, depending on what needs to be done. I understand it needs to be tested, what I'm thinking is first creating a design document to run with as to what the goals of the matchmaking system are. How it is going to be implemented internally within the server and client. And the schema for communication between the server and the client.

When you say we are swapping to a new system, do you mean we are moving away from tachyon?

Get Outlook for Androidhttps://aka.ms/AAb9ysg


From: Teifion @.> Sent: Wednesday, April 12, 2023 3:21:14 AM To: beyond-all-reason/teiserver @.> Cc: knoxy5467 @.>; Comment @.> Subject: Re: [beyond-all-reason/teiserver] Matchmaking (Issue #87)

I'm sorry, I thought you were looking to dev it from the server side. In that case the information I gave you is very misleading. You'll be wanting the tachyon docshttps://github.com/beyond-all-reason/teiserver/blob/master/documents/tachyon/matchmaking.md. Note we are swapping over to the new system but I expect roughly this format to be maintained.

All the things you saw in the repo here so far are the internal processes and messaging systems.

— Reply to this email directly, view it on GitHubhttps://github.com/beyond-all-reason/teiserver/issues/87#issuecomment-1504789738, or unsubscribehttps://github.com/notifications/unsubscribe-auth/ABM6WLKPKVVLN7MUJN3O3ZTXAZJWVANCNFSM6AAAAAAWG3BL3M. You are receiving this because you commented.Message ID: @.***>

Teifion commented 1 year ago

We're moving from the text based tachyon to websocket based one; the schema will be in the Tachyon repo.

knoxy5467 commented 1 year ago

are you talking about this file ? , because the definitions are just taking and receiving JSON, but I can't find the spec for what the objects are supposed to look like? Am I looking in the right place?

knoxy5467 commented 1 year ago

wait. you said it will be in the tachyon docs. I think I was looking in the wrong place.

knoxy5467 commented 1 year ago

ok so making sure I'm on the right page a Queue looks like this which is what join_queue and list queue's is going to be "returning"

  field :name, :string
    field :team_size, :integer
    field :team_count, :integer, default: 2

    field :icon, :string
    field :colour, :string

    field :conditions, :map
    field :settings, :map
    field :map_list, {:array, :string}

(taken from here )

knoxy5467 commented 1 year ago

for

{
  "cmd": "c.matchmaking.query",
  "query": Query
}

{
  "cmd": "s.matchmaking.query",
  "matchmaking_list": [
    Queue,
    Queue,
    Queue
  ]
}

what does the Query object look like? I imagine relevant information would be userID, region. ranked / unranked

Teifion commented 1 year ago

The .ex files are internal server logic and probably not relevant if you are doing client side stuff. I think there might be some confusion here, exactly what are you looking to achieve?

knoxy5467 commented 1 year ago

I'm looking to understand what needs to be done as a whole for the matchmaking system. I'm understanding more as I read through it and i think the tachyon docs you linked me earlier really have everything else I need. I apologize for taking so much of your time.