Hello Sir, I want to automatically add one fake player in match on No Match found message when any player dont find match.
Best Answer
C
Customer Support
said
about 6 years ago
Hey Ram,
You can also manually create a matchmaking request for your player and then another for the dummy player who's ID you know...
// find match as me // var matchReq1 = new SparkRequests.MatchmakingRequest() matchReq1.matchShortCode = "level_a"; matchReq1.matchGroup = "player1_friends"; matchReq1.skill = 0; matchReq1.Send(); // // find match as dummy // var matchReq1 = new SparkRequests.MatchmakingRequest() matchReq1.matchShortCode = "level_a"; matchReq1.matchGroup = "player1_friends"; matchReq1.skill = 0; matchReq1.SendAs("588072be23791d04bdab1313");
You can use the following to do this in the user MatchNotFoundMessage.
//this will add the current player and the fake player to a match. The fake playerid is from my game you need to sub it for a bot player from your game for this to work.
Spark.getMultiplayer().createMatchById([Spark.getPlayer().getPlayerId(),"5877bc0c23791d04bd0ecf33"]);
Try that and let us know if you have any further questions.
Thanks,
Liam
R
Ram Lalu
said
about 6 years ago
HI, But it is creating match without any short code. Now I want to add short code into that match. Is that possible ?
Thanks Ram Lalu
Customer Support
said
about 6 years ago
Hi Ram,
You won't need the shortCode as the players have been matched manually. No matchmaking will be taking place here so the shortCode is not required.
Thanks,
Liam
Customer Support
said
about 6 years ago
Answer
Hey Ram,
You can also manually create a matchmaking request for your player and then another for the dummy player who's ID you know...
// find match as me // var matchReq1 = new SparkRequests.MatchmakingRequest() matchReq1.matchShortCode = "level_a"; matchReq1.matchGroup = "player1_friends"; matchReq1.skill = 0; matchReq1.Send(); // // find match as dummy // var matchReq1 = new SparkRequests.MatchmakingRequest() matchReq1.matchShortCode = "level_a"; matchReq1.matchGroup = "player1_friends"; matchReq1.skill = 0; matchReq1.SendAs("588072be23791d04bdab1313");
R
Ram Lalu
said
about 6 years ago
Hello,
I Added fake Player In match using Below Code:
var matchReq1 = new
SparkRequests.MatchmakingRequest()
matchReq1.matchShortCode =
matchCode;
matchReq1.skill = 0;
matchReq1.Send();
// // find match as dummy
//
var matchReq1 = new
SparkRequests.MatchmakingRequest()
matchReq1.matchShortCode =
matchCode;
matchReq1.skill = 0;
matchReq1.SendAs("588eee000000000000000001");
// search pending matches
as dummy //
var request = new
SparkRequests.FindPendingMatchesRequest();
request.matchShortCode =
matchCode;
request.maxMatchesToFind =
1;
var response =
request.SendAs("588eee000000000000000001");
var pendingMatchId =
response.pendingMatches[0].id;
// join dummy into player1
match //
var joinReq = new
SparkRequests.JoinPendingMatchRequest();
joinReq.pendingMatchId =
pendingMatchId;
//joinReq.matchShortCode =
matchCode;
joinReq.SendAs("588eee000000000000000001”);
Now fake Player Added in match but the real Player is left the Match, this match is not removed from the "pending Match" Collection. How to Remove this Match from the "pending Match" Collection?
Ram Lalu
I want to automatically add one fake player in match on No Match found message when any player dont find match.
Hey Ram,
You can also manually create a matchmaking request for your player and then another for the dummy player who's ID you know...
// find match as me //
var matchReq1 = new SparkRequests.MatchmakingRequest()
matchReq1.matchShortCode = "level_a";
matchReq1.matchGroup = "player1_friends";
matchReq1.skill = 0;
matchReq1.Send();
// // find match as dummy //
var matchReq1 = new SparkRequests.MatchmakingRequest()
matchReq1.matchShortCode = "level_a";
matchReq1.matchGroup = "player1_friends";
matchReq1.skill = 0;
matchReq1.SendAs("588072be23791d04bdab1313");
- Oldest First
- Popular
- Newest First
Sorted by Oldest FirstCustomer Support
Hi Ram,
You can use the following to do this in the user MatchNotFoundMessage.
Try that and let us know if you have any further questions.
Thanks,
Liam
Ram Lalu
HI,
But it is creating match without any short code. Now I want to add short code into that match. Is that possible ?
Ram Lalu
Customer Support
Hi Ram,
You won't need the shortCode as the players have been matched manually. No matchmaking will be taking place here so the shortCode is not required.
Thanks,
Liam
Customer Support
Hey Ram,
You can also manually create a matchmaking request for your player and then another for the dummy player who's ID you know...
// find match as me //
var matchReq1 = new SparkRequests.MatchmakingRequest()
matchReq1.matchShortCode = "level_a";
matchReq1.matchGroup = "player1_friends";
matchReq1.skill = 0;
matchReq1.Send();
// // find match as dummy //
var matchReq1 = new SparkRequests.MatchmakingRequest()
matchReq1.matchShortCode = "level_a";
matchReq1.matchGroup = "player1_friends";
matchReq1.skill = 0;
matchReq1.SendAs("588072be23791d04bdab1313");
Ram Lalu
Hello,
I Added fake Player In match using Below Code:
var matchReq1 = new SparkRequests.MatchmakingRequest()
matchReq1.matchShortCode = matchCode;
matchReq1.skill = 0;
matchReq1.Send();
// // find match as dummy //
var matchReq1 = new SparkRequests.MatchmakingRequest()
matchReq1.matchShortCode = matchCode;
matchReq1.skill = 0;
matchReq1.SendAs("588eee000000000000000001");
// search pending matches as dummy //
var request = new SparkRequests.FindPendingMatchesRequest();
request.matchShortCode = matchCode;
request.maxMatchesToFind = 1;
var response = request.SendAs("588eee000000000000000001");
var pendingMatchId = response.pendingMatches[0].id;
// join dummy into player1 match //
var joinReq = new SparkRequests.JoinPendingMatchRequest();
joinReq.pendingMatchId = pendingMatchId;
//joinReq.matchShortCode = matchCode;
joinReq.SendAs("588eee000000000000000001”);
Now fake Player Added in match but the real Player is left the Match, this match is not removed from the "pending Match" Collection. How to Remove this Match from the "pending Match" Collection?
-
Documentation Notes
-
Design issues with user events
-
Using NoSQL
-
Runtime Collections vs Metadata Collections
-
Anonymous authentication from browser app
-
Modules
-
Movement With Unity
-
Problem with url parameters for downloadables
-
Querying NoSql GameSparks database
-
Challenge accesType
See all 2487 topics