public async Task<SearchingForMatchNotification> AttachToQueue(MatchMakerParams matchMakerParams) { int Id = Invoke("matchmakerService", "attachToQueue", new object[] { matchMakerParams.GetBaseTypedObject() }); while (!results.ContainsKey(Id)) await Task.Delay(10); TypedObject messageBody = results[Id].GetTO("data").GetTO("body"); SearchingForMatchNotification result = new SearchingForMatchNotification(messageBody); results.Remove(Id); return result; }
public async Task<SearchingForMatchNotification> AttachToLowPriorityQueue(MatchMakerParams matchMakerParams, string accessToken) { TypedObject typedObject = new TypedObject(null); typedObject.Add("LEAVER_BUSTER_ACCESS_TOKEN", accessToken); int key = this.Invoke("matchmakerService", "attachToQueue", new object[] { matchMakerParams.GetBaseTypedObject(), typedObject }); while (!this.results.ContainsKey(key)) { await Task.Delay(10); } TypedObject tO = this.results[key].GetTO("data").GetTO("body"); SearchingForMatchNotification result = new SearchingForMatchNotification(tO); this.results.Remove(key); return result; }
/// 37.) public void AttachToQueue(MatchMakerParams matchMakerParams, SearchingForMatchNotification.Callback callback) { SearchingForMatchNotification cb = new SearchingForMatchNotification(callback); InvokeWithCallback("matchmakerService", "attachToQueue", new object[] { matchMakerParams.GetBaseTypedObject() }, cb); }
public async Task<SearchingForMatchNotification> AttachToLowPriorityQueue(MatchMakerParams matchMakerParams, string accessToken) { TypedObject to = new TypedObject(null); to.Add("LEAVER_BUSTER_ACCESS_TOKEN", accessToken); int Id = Invoke("matchmakerService", "attachToQueue", new object[] { matchMakerParams.GetBaseTypedObject(), to }); while (!results.ContainsKey(Id)) await Task.Delay(10); TypedObject messageBody = results[Id].GetTO("data").GetTO("body"); SearchingForMatchNotification result = new SearchingForMatchNotification(messageBody); results.Remove(Id); return result; }