/// <summary> /// Message to run a player raffle /// </summary> /// <param name="raffleId">The ID of the raffle to run</param> /// <param name="raffleHistoryId">the ID of the previous raffle that ran. 0 if none</param> /// <param name="playerListId">The player list to run the raffle over</param> public RunPlayerRaffleMessage(int raffleId, int raffleHistoryId, int playerListId) { m_id = 18035; m_raffleId = raffleId; m_raffleHistoryId = raffleHistoryId; m_rafflePlayerListId = playerListId; m_winner = new RaffleWinner(); m_winner.RaffleDefID = m_raffleId; }
protected override void UnpackResponse() { base.UnpackResponse(); MemoryStream responseStream = new MemoryStream(m_responsePayload); BinaryReader responseReader = new BinaryReader(responseStream, Encoding.Unicode); try { // Seek past return code. responseReader.BaseStream.Seek(sizeof(int), SeekOrigin.Begin); if (ReturnCode == 0) { m_winner = new RaffleWinner(); // Raffle History Id m_winner.HistoryID = responseReader.ReadInt32(); // Player Id m_winner.PlayerID = responseReader.ReadInt32(); // Player First Name m_winner.FirstName = ReadString(responseReader); // Player Last Name m_winner.LastName = ReadString(responseReader); } } catch (EndOfStreamException e) { throw new MessageWrongSizeException("Run Player Raffle", e); } catch (Exception e) { throw new ServerException("Run Player Raffle", e); } responseReader.Close(); }