public static List <PlayerStatus> GetPlayerStatus(int playerId) { var msg = new GetPlayerStatusCode(playerId); try { msg.Send(); } catch (ServerCommException ex) { throw new Exception("GetPlayerStatusCode: " + ex.Message); } return(msg.playerStatusList); }
/// <summary> /// Initializes a new instance of the Player class. This constructor /// will call various server message in order to populate the instance /// variables. /// </summary> /// <param name="playerId">The id of the player to create.</param> /// <param name="operatorId">The id of the operator this player /// belongs to.</param> /// <param name="PIN">The PIN for the third party system.</param> /// <exception cref="GTI.Modules.Shared.ServerCommException">The server /// did not response to a message request.</exception> /// <exception cref="GTI.Modules.Shared.MessageWrongSizeException">The /// server sent a message that was an unexpected size.</exception> /// <exception cref="GTI.Modules.Shared.ServerException">The server /// returned a negative return code or a problem occured while /// unpackaging a message.</exception> public Player(int playerId, int operatorId, int PIN = 0, bool thirdPartyPlayerSync = true, bool pointsAreGood = false) { // Rally TA1583 GetPlayerDataMessage getMsg = new GetPlayerDataMessage(playerId, PIN);//JC-A getMsg.ThirdPartyPlayerSync = thirdPartyPlayerSync; getMsg.PointsAreGood = pointsAreGood; // Send the message. getMsg.Send(); // Fill in the data. m_id = playerId; m_firstName = getMsg.FirstName; m_middleInitial = getMsg.MiddleInitial; m_lastName = getMsg.LastName; m_govIssuedIdNum = getMsg.GovIssuedIdNumber; m_birthDate = getMsg.BirthDate; m_age = getMsg.Age; m_email = getMsg.Email; m_playerIdent = getMsg.PlayerIdentity; m_phoneNum = getMsg.PhoneNumber; m_gender = getMsg.Gender; m_pinNum = getMsg.PinNumber; m_address1 = getMsg.Address1; m_address2 = getMsg.Address2; m_city = getMsg.City; m_state = getMsg.State; m_zip = getMsg.Zip; m_country = getMsg.Country; m_joinDate = getMsg.JoinDate; m_lastVisit = getMsg.LastVisit; m_pointsBalance = getMsg.PointsBalance; m_visitCount = getMsg.VisitCount; m_comment = getMsg.Comment; m_magCardNum = getMsg.MagCardNumber; m_totalSpend = getMsg.TotalSpend; m_IsLoggedIn = getMsg.IsLoggedIn; m_pointsUpToDate = getMsg.PointsUpToDate; m_playerCardPINError = getMsg.PlayerCardPINError; m_thirdPartyInterfaceDown = getMsg.ThirdPartyInterfaceDown; m_ErrorMessage = getMsg.ErrorMessage; // Find the player's tier GetPlayerTierListMessage tierMsg = new GetPlayerTierListMessage(operatorId); tierMsg.Send(); PlayerLoyaltyTier[] playerTiers = tierMsg.Tiers; if (getMsg.PlayerTierId > 0 && playerTiers != null) { foreach (PlayerLoyaltyTier tier in playerTiers) { if (tier.Id == getMsg.PlayerTierId) { m_tier = tier; break; } } } else { m_tier = null; } // Get the player's picture. GetPlayerImageMessage getPicMsg = new GetPlayerImageMessage(); getPicMsg.PlayerId = m_id; getPicMsg.Send(); m_image = getPicMsg.Image; // Get the player's comps. GetPlayerCompsMessage getCompMsg = new GetPlayerCompsMessage(m_id); getCompMsg.Send(); m_comps.AddRange(getCompMsg.Comps); // TTP 50067 // Get the current gaming date. GetGamingDateMessage gamingMsg = new GetGamingDateMessage(operatorId); gamingMsg.Send(); // Get the player's receipts GetPlayerReceipts getReceiptsMsg = new GetPlayerReceipts(m_id, operatorId, gamingMsg.GamingDate); getReceiptsMsg.Send(); ReceiptNumbers = getReceiptsMsg.Receipts; // Rally US493 // Get the player's statuses ActiveStatusList = GetPlayerStatusCode.GetPlayerStatus(m_id); // Rally US507 GetPlayerCBBFavoriteCountsMessage favoritesMsg = new GetPlayerCBBFavoriteCountsMessage(m_id); favoritesMsg.Send(); foreach (KeyValuePair <short, int> pair in favoritesMsg.FavoriteCounts) { m_cbbFavoriteCount.Add(pair.Key, pair.Value); } CreditModuleOnline col = new CreditModuleOnline(); /* Debug Code */ // mbolIsCreditOnline = false; if (col.IsCreditModuleOnline) { // Get the player's credit. GetCreditMessage creditMsg = new GetCreditMessage(m_id); creditMsg.Send(); m_RefundableCredit = creditMsg.RefundableCredit; m_NonRefundableCredit = creditMsg.NonRefundableCredit; m_cashOnlyCredit = creditMsg.CashOnlyCredit; // TTP 50114 } else { mbolIsCreditOnline = false; } GetPlayerMagCardPINMessage PINMsg = new GetPlayerMagCardPINMessage(playerId); PINMsg.Send(); m_playerCardPIN = PINMsg.PlayerMagCardPIN; m_playerCard = PINMsg.PlayerMagCard; }