MCPcopy Create free account
hub / github.com/dank/rlapi / allMatchmaking

Function allMatchmaking

examples/allrequests/main.go:189–213  ·  view source on GitHub ↗
(ctx context.Context, rpc *rlapi.PsyNetRPC, playerID rlapi.PlayerID)

Source from the content-addressed store, hash-verified

187}
188
189func allMatchmaking(ctx context.Context, rpc *rlapi.PsyNetRPC, playerID rlapi.PlayerID) error {
190 regions := []rlapi.MatchmakingRegion{
191 {Name: "USE1", Ping: 33},
192 {Name: "USE3", Ping: 33},
193 }
194 playlists := []int{10, 11}
195
196 estimatedQueueTime, err := rpc.StartMatchmaking(ctx, playlists, regions, false, "", []rlapi.PlayerID{playerID})
197 if err != nil {
198 return fmt.Errorf("StartMatchmaking err: %w", err)
199 }
200 slog.Debug("StartMatchmaking", slog.Any("estimatedQueueTime", estimatedQueueTime))
201
202 err = rpc.PlayerCancelMatchmaking(ctx)
203 if err != nil {
204 return fmt.Errorf("PlayerCancelMatchmaking err: %w", err)
205 }
206
207 err = rpc.PlayerSearchPrivateMatch(ctx, "USE1", 6)
208 if err != nil {
209 return fmt.Errorf("PlayerSearchPrivateMatch err: %w", err)
210 }
211
212 return nil
213}
214
215func allParty(ctx context.Context, rpc *rlapi.PsyNetRPC) error {
216 party, err := rpc.CreateParty(ctx)

Callers 1

mainFunction · 0.85

Calls 3

StartMatchmakingMethod · 0.80

Tested by

no test coverage detected