/// <summary> /// Writes the end of the auction to the log /// </summary> /// <param name="auction">The auction ending</param> /// <param name="reason">The AuctionResult stating why the auction is ending</param> /// <param name="m">The Mobile forcing the end of the auction (can be null)</param> /// <param name="comments">Additional comments on the ending (can be null)</param> public static void WriteEnd(AuctionItem auction, AuctionResult reason, Mobile m, string comments) { if (!m_Enabled || m_Writer == null) { return; } try { m_Writer.WriteLine("## Ending Auction {0}", auction.ID.ToString()); m_Writer.WriteLine("# Status : {0}", reason.ToString()); if (m != null) { m_Writer.WriteLine("# Ended by {0} [{1}], {2}, Account : {3}", m.Name, m.Serial.ToString(), m.AccessLevel.ToString(), (m.Account as Server.Accounting.Account).Username); } if (comments != null) { m_Writer.WriteLine("# Comments : {0}", comments); } m_Writer.WriteLine(); } catch {} }
/// <summary> /// Creates a check that will deliver an item for the auction system /// </summary> /// <param name="auction">The auction generating this check</param> /// <param name="result">Specifies the reason for the generation of this check</param> public AuctionItemCheck( AuctionItem auction, AuctionResult result ) { Name = auction.Creature ? AuctionSystem.ST[ 131 ] : AuctionSystem.ST[ 132 ]; m_Auction = auction.ID; m_ItemName = auction.ItemName; m_Item = auction.Item; /*if ( m_Item != null ) { AuctionSystem.ControlStone.RemoveItem( m_Item ); m_Item.Parent = this; // This will avoid cleanup }*/ switch ( result ) { // Returning the item to the owner case AuctionResult.NoBids: case AuctionResult.PendingRefused: case AuctionResult.SystemStopped: case AuctionResult.PendingTimedOut: case AuctionResult.ItemDeleted: case AuctionResult.StaffRemoved: m_Owner = auction.Owner; Hue = ItemReturnedHue; switch ( result ) { case AuctionResult.NoBids: m_Message = string.Format( AuctionSystem.ST[ 133 ], m_ItemName ); break; case AuctionResult.PendingRefused: m_Message = string.Format( AuctionSystem.ST[ 134 ], m_ItemName ); break; case AuctionResult.SystemStopped: m_Message = string.Format( AuctionSystem.ST[ 135 ], m_ItemName ); break; case AuctionResult.PendingTimedOut: m_Message = AuctionSystem.ST[ 127 ]; break; case AuctionResult.ItemDeleted: m_Message = AuctionSystem.ST[ 136 ]; break; case AuctionResult.StaffRemoved: m_Message = AuctionSystem.ST[ 203 ]; break; } break; case AuctionResult.PendingAccepted: case AuctionResult.Succesful: case AuctionResult.BuyNow: m_Owner = auction.HighestBid.Mobile; Hue = ItemSoldHue; m_Message = string.Format( AuctionSystem.ST[ 137 ] , m_ItemName, auction.HighestBid.Amount.ToString("#,0" )); break; default: throw new Exception( string.Format( AuctionSystem.ST[ 138 ] , result.ToString() ) ); } }
/// <summary> /// Creates a check delivering gold for the auction system /// </summary> /// <param name="auction">The auction originating this check</param> /// <param name="result">Specifies the reason for the creation of this check</param> public AuctionGoldCheck( AuctionItem auction, AuctionResult result ) { Name = AuctionSystem.ST[ 122 ]; m_Auction = auction.ID; m_ItemName = auction.ItemName; if ( result != AuctionResult.BuyNow ) m_GoldAmount = auction.HighestBid.Amount; else m_GoldAmount = auction.BuyNow; switch ( result ) { case AuctionResult.Outbid: case AuctionResult.SystemStopped: case AuctionResult.PendingRefused: case AuctionResult.ReserveNotMet: case AuctionResult.PendingTimedOut: case AuctionResult.StaffRemoved: case AuctionResult.ItemDeleted: m_Owner = auction.HighestBid.Mobile; Hue = OutbidHue; switch ( result ) { case AuctionResult.Outbid : m_Message = string.Format( AuctionSystem.ST[ 123 ] , m_ItemName, m_GoldAmount.ToString( "#,0" )); break; case AuctionResult.SystemStopped: m_Message = string.Format( AuctionSystem.ST[ 124 ] , m_ItemName, m_GoldAmount.ToString( "#,0" ) ); break; case AuctionResult.PendingRefused: m_Message = string.Format( AuctionSystem.ST[ 125 ] , m_ItemName ) ; break; case AuctionResult.ReserveNotMet: m_Message = string.Format( AuctionSystem.ST[ 126 ] , m_GoldAmount.ToString( "#,0" ), m_ItemName ); break; case AuctionResult.PendingTimedOut: m_Message = AuctionSystem.ST[ 127 ] ; break; case AuctionResult.ItemDeleted: m_Message = AuctionSystem.ST[ 128 ] ; break; case AuctionResult.StaffRemoved: m_Message = AuctionSystem.ST[ 202 ]; break; } break; case AuctionResult.PendingAccepted: case AuctionResult.Succesful: case AuctionResult.BuyNow: m_Owner = auction.Owner; Hue = SoldHue; m_Message = string.Format( AuctionSystem.ST[ 129 ] , m_ItemName, m_GoldAmount.ToString( "#,0" ) ); break; default: throw new Exception( string.Format( "{0} is not a valid reason for an auction gold check", result.ToString() ) ); } }
/// <summary> /// Creates a check that will deliver an item for the auction system /// </summary> /// <param name="auction">The auction generating this check</param> /// <param name="result">Specifies the reason for the generation of this check</param> public AuctionItemCheck(AuctionItem auction, AuctionResult result) { Name = auction.Creature ? AuctionSystem.ST[131] : AuctionSystem.ST[132]; m_Auction = auction.ID; m_ItemName = auction.ItemName; m_Item = auction.Item; /*if ( m_Item != null ) * { * AuctionSystem.ControlStone.RemoveItem( m_Item ); * m_Item.Parent = this; // This will avoid cleanup * }*/ switch (result) { // Returning the item to the owner case AuctionResult.NoBids: case AuctionResult.PendingRefused: case AuctionResult.SystemStopped: case AuctionResult.PendingTimedOut: case AuctionResult.ItemDeleted: case AuctionResult.StaffRemoved: m_Owner = auction.Owner; Hue = ItemReturnedHue; switch (result) { case AuctionResult.NoBids: m_Message = string.Format(AuctionSystem.ST[133], m_ItemName); break; case AuctionResult.PendingRefused: m_Message = string.Format(AuctionSystem.ST[134], m_ItemName); break; case AuctionResult.SystemStopped: m_Message = string.Format(AuctionSystem.ST[135], m_ItemName); break; case AuctionResult.PendingTimedOut: m_Message = AuctionSystem.ST[127]; break; case AuctionResult.ItemDeleted: m_Message = AuctionSystem.ST[136]; break; case AuctionResult.StaffRemoved: m_Message = AuctionSystem.ST[203]; break; } break; case AuctionResult.PendingAccepted: case AuctionResult.Succesful: case AuctionResult.BuyNow: m_Owner = auction.HighestBid.Mobile; Hue = ItemSoldHue; m_Message = string.Format(AuctionSystem.ST[137], m_ItemName, auction.HighestBid.Amount.ToString("#,0")); break; default: throw new Exception(string.Format(AuctionSystem.ST[138], result.ToString())); } }
/// <summary> /// Creates a check delivering gold for the auction system /// </summary> /// <param name="auction">The auction originating this check</param> /// <param name="result">Specifies the reason for the creation of this check</param> public AuctionGoldCheck(AuctionItem auction, AuctionResult result) { Name = AuctionSystem.ST[122]; m_Auction = auction.ID; m_ItemName = auction.ItemName; if (result != AuctionResult.BuyNow) { m_GoldAmount = auction.HighestBid.Amount; } else { m_GoldAmount = auction.BuyNow; } switch (result) { case AuctionResult.Outbid: case AuctionResult.SystemStopped: case AuctionResult.PendingRefused: case AuctionResult.ReserveNotMet: case AuctionResult.PendingTimedOut: case AuctionResult.StaffRemoved: case AuctionResult.ItemDeleted: m_Owner = auction.HighestBid.Mobile; Hue = OutbidHue; switch (result) { case AuctionResult.Outbid: m_Message = string.Format(AuctionSystem.ST[123], m_ItemName, m_GoldAmount); break; case AuctionResult.SystemStopped: m_Message = string.Format(AuctionSystem.ST[124], m_ItemName, m_GoldAmount); break; case AuctionResult.PendingRefused: m_Message = string.Format(AuctionSystem.ST[125], m_ItemName); break; case AuctionResult.ReserveNotMet: m_Message = string.Format(AuctionSystem.ST[126], m_GoldAmount, m_ItemName); break; case AuctionResult.PendingTimedOut: m_Message = AuctionSystem.ST[127]; break; case AuctionResult.ItemDeleted: m_Message = AuctionSystem.ST[128]; break; case AuctionResult.StaffRemoved: m_Message = AuctionSystem.ST[202]; break; } break; case AuctionResult.PendingAccepted: case AuctionResult.Succesful: case AuctionResult.BuyNow: m_Owner = auction.Owner; Hue = SoldHue; m_Message = string.Format(AuctionSystem.ST[129], m_ItemName, m_GoldAmount); break; default: throw new Exception(string.Format("{0} is not a valid reason for an auction gold check", result.ToString())); } }
/// <summary> /// Writes the end of the auction to the log /// </summary> /// <param name="auction">The auction ending</param> /// <param name="reason">The AuctionResult stating why the auction is ending</param> /// <param name="m">The Mobile forcing the end of the auction (can be null)</param> /// <param name="comments">Additional comments on the ending (can be null)</param> public static void WriteEnd( AuctionItem auction, AuctionResult reason, Mobile m, string comments ) { if ( !m_Enabled || m_Writer == null ) return; try { m_Writer .WriteLine( "## Ending Auction {0}", auction.ID.ToString() ); m_Writer .WriteLine( "# Status : {0}", reason.ToString() ); if ( m != null ) m_Writer .WriteLine( "# Ended by {0} [{1}], {2}, Account : {3}", m.Name, m.Serial.ToString(), m.AccessLevel.ToString(), ( m.Account as Server.Accounting.Account ).Username ); if ( comments != null ) m_Writer .WriteLine( "# Comments : {0}", comments ); m_Writer .WriteLine(); } catch {} }