#Typescript Update for Multiplayer Hooks

1 messages · Page 1 of 1 (latest)

bright cobalt
#

In cloudscript there are objects called

server
http

That can be used to call the api.

matchmaking is one of them.

If I simply type out
match.[function] the call will work since its javascript but I dont have the strong typing from typescript since the actual object declaration is not implemented.

Can this be uploaded?

#

@obtuse minnow

obtuse minnow
bright cobalt
#

Thank you! It is safer if we have actual types for the function calls

obtuse minnow
bright cobalt
#

Yes, @obtuse minnow . There was another repo years ago but I forgot what it was called

obtuse minnow
bright cobalt
#

Thank you @obtuse minnow !

obtuse minnow
# bright cobalt Thank you <@897169744015269930> !

I updated the CloudScript TypeScript sample to include support for the multiplayer global object, which includes Matchmaking, MultiplayerServer, Party, and Lobby APIs.

You can pick up the changes by downloading the latest CloudScript.d.ts from here: https://github.com/PlayFab/SdkTestingCloudScript/blob/master/Scripts/typings/PlayFab/CloudScript.d.ts

Once you replace your local copy, you'll get full IntelliSense and type checking for calls like:

    var result = multiplayer.CreateMatchmakingTicket({
        Creator: { Entity: { Id: entityId, Type: "title_player_account" } },
        GiveUpAfterSeconds: 120,
        QueueName: "ranked_1v1"
    });

Note: the global object name is multiplayer (not match like you specified earlier). The methods include CreateMatchmakingTicket, GetMatch, GetMatchmakingTicket, JoinMatchmakingTicket, CancelAllMatchmakingTicketsForPlayer, etc.

Let me know if you run into any issues, thanks!

GitHub

This is the Cloud Script used for the internal testing of all SDKs. - PlayFab/SdkTestingCloudScript

bright cobalt
#

@obtuse minnow OMG this is so amazing. I've waited years for this! You are awesome!

#

And I assume the smaller models are also made?

#

I have another question wrt the get player in segment retirement

obtuse minnow
bright cobalt
#

Yea and I see that they were. So thank you for that as well.