mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-22 04:35:52 +12:00
Ranch forcefully sold message
This commit is contained in:
parent
b898983778
commit
168d534381
5 changed files with 33 additions and 13 deletions
|
@ -405,7 +405,7 @@ namespace HISP.Game
|
|||
|
||||
public static string RanchCantAffordRanch;
|
||||
public static string RanchRanchBroughtMessageFormat;
|
||||
|
||||
public static string RanchForcefullySoldFormat;
|
||||
public static string RanchSavedRanchDescripton;
|
||||
public static string RanchSavedTitleTooLongError;
|
||||
public static string RanchSavedDescrptionTooLongError;
|
||||
|
@ -1599,6 +1599,10 @@ namespace HISP.Game
|
|||
{
|
||||
return ArenaYouWinFormat.Replace("%PRIZE%", prizeMoney.ToString("N0", CultureInfo.InvariantCulture)).Replace("%EXP%", experience.ToString("N0", CultureInfo.InvariantCulture));
|
||||
}
|
||||
public static string FormatRanchForcefullySoldMessage(int amount)
|
||||
{
|
||||
return RanchForcefullySoldFormat.Replace("%AMOUNT%", amount.ToString());
|
||||
}
|
||||
public static string FormatArenaYourScore(int score)
|
||||
{
|
||||
return ArenaYourScoreFormat.Replace("%SCORE%", score.ToString("N0", CultureInfo.InvariantCulture));
|
||||
|
|
|
@ -130,8 +130,31 @@ namespace HISP.Game
|
|||
{
|
||||
if(ownerId != -1)
|
||||
{
|
||||
if (!Database.IsUserSubscribed(ownerId) && !Database.IsUserAdmin(ownerId))
|
||||
if (ConfigReader.AllUsersSubbed || Database.IsUserAdmin(ownerId))
|
||||
return ownerId;
|
||||
|
||||
int subExp = Database.GetUserSubscriptionExpireDate(ownerId);
|
||||
DateTime expTime = Converters.UnixTimeStampToDateTime(subExp);
|
||||
if ((DateTime.UtcNow.Date - expTime.Date).Days >= 30)
|
||||
{
|
||||
int price = GetSellPrice();
|
||||
try
|
||||
{
|
||||
checked
|
||||
{
|
||||
Database.SetPlayerMoney(Database.GetPlayerMoney(ownerId) + price, ownerId);
|
||||
}
|
||||
}
|
||||
catch (OverflowException)
|
||||
{
|
||||
Database.SetPlayerMoney(2147483647, ownerId);;
|
||||
}
|
||||
|
||||
Database.AddMessageToQueue(ownerId, Messages.FormatRanchForcefullySoldMessage(price));
|
||||
deleteRanch();
|
||||
return -1;
|
||||
}
|
||||
|
||||
}
|
||||
return ownerId;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue