private void OnQuickMatchRequest(INetworkConnection con, Packet gmsg) { PacketQuickMatchResult note = (PacketQuickMatchResult)CreatePacket((int)LobbyPacketType.QuickMatchResult, 0, false, false); gmsg.ReplyPacket = note; if (!ValidateHasCurrentCharacter()) { note.ReplyMessage = "You must select a character before you can get a quick match ."; note.ReplyCode = ReplyType.Failure; return; } PacketGenericMessage gp = gmsg as PacketGenericMessage; string msg = ""; gp.Parms.SetProperty("QuickMatch", true); DataTable dt = DB.Instance.Lobby_GetQuickMatch(gp.Parms, out msg); bool gotRowCount = false; if (dt != null) { // Transform data result into game object foreach (DataRow r in dt.Rows) { note.ReplyCode = ReplyType.OK; Game g = new Game(); g.GameID = (Guid)r["GameID"]; g.Started = (bool)r["InProgress"]; g.MaxPlayers = (int)r["MaxPlayersAllowed"]; g.Name = (string)r["GameName"]; g.Properties.SetProperty("IsPrivate", (bool)r["IsPrivate"]); g.Properties.SetProperty("PlayerCount", (int)r["CurrentPlayers"]); // allow custom searches to add their additional data to the game object OnQuickMatchGameSearchResultTransform(g, r); note.TheGame = g; } } }
protected virtual void OnQuickMatchResult(INetworkConnection con, Packet p) { PacketQuickMatchResult res = p as PacketQuickMatchResult; FireQuickMatchResultArrived(res.ReplyCode == ReplyType.OK, res.ReplyMessage, this, res.TheGame); }