mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-12 07:59:48 +12:00
Ranch forcefully sold message
This commit is contained in:
parent
b898983778
commit
168d534381
5 changed files with 33 additions and 13 deletions
|
@ -608,6 +608,7 @@
|
||||||
"unowned_ranch_click":"Unowned Ranch",
|
"unowned_ranch_click":"Unowned Ranch",
|
||||||
"click_message":"%USERNAME%'s %TITLE%",
|
"click_message":"%USERNAME%'s %TITLE%",
|
||||||
|
|
||||||
|
"forcefully_sold":"Your ranch has been forcibly sold since subscription lapsed 30+ days. You earned $%AMOUNT% from the sale.",
|
||||||
"no_dorothy_shoes":"You do not have Dorothy Shoes. They come with a ranch.",
|
"no_dorothy_shoes":"You do not have Dorothy Shoes. They come with a ranch.",
|
||||||
"dorothy_message":"There's no place like home... There's no place like home...",
|
"dorothy_message":"There's no place like home... There's no place like home...",
|
||||||
"dorothy_prison_isle":"You tap them together a bunch of times, but nothing.. They don't work here!",
|
"dorothy_prison_isle":"You tap them together a bunch of times, but nothing.. They don't work here!",
|
||||||
|
|
|
@ -405,7 +405,7 @@ namespace HISP.Game
|
||||||
|
|
||||||
public static string RanchCantAffordRanch;
|
public static string RanchCantAffordRanch;
|
||||||
public static string RanchRanchBroughtMessageFormat;
|
public static string RanchRanchBroughtMessageFormat;
|
||||||
|
public static string RanchForcefullySoldFormat;
|
||||||
public static string RanchSavedRanchDescripton;
|
public static string RanchSavedRanchDescripton;
|
||||||
public static string RanchSavedTitleTooLongError;
|
public static string RanchSavedTitleTooLongError;
|
||||||
public static string RanchSavedDescrptionTooLongError;
|
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));
|
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)
|
public static string FormatArenaYourScore(int score)
|
||||||
{
|
{
|
||||||
return ArenaYourScoreFormat.Replace("%SCORE%", score.ToString("N0", CultureInfo.InvariantCulture));
|
return ArenaYourScoreFormat.Replace("%SCORE%", score.ToString("N0", CultureInfo.InvariantCulture));
|
||||||
|
|
|
@ -130,8 +130,31 @@ namespace HISP.Game
|
||||||
{
|
{
|
||||||
if(ownerId != -1)
|
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();
|
deleteRanch();
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return ownerId;
|
return ownerId;
|
||||||
|
|
||||||
|
|
|
@ -555,15 +555,7 @@ namespace HISP.Player
|
||||||
|
|
||||||
if(Ranch.IsRanchOwned(this.Id))
|
if(Ranch.IsRanchOwned(this.Id))
|
||||||
{
|
{
|
||||||
if (this.Subscribed)
|
OwnedRanch = Ranch.GetRanchOwnedBy(this.Id);
|
||||||
{
|
|
||||||
OwnedRanch = Ranch.GetRanchOwnedBy(this.Id);
|
|
||||||
}
|
|
||||||
else // idk what it does here ...
|
|
||||||
{
|
|
||||||
OwnedRanch = null;
|
|
||||||
Ranch.GetRanchOwnedBy(this.Id).OwnerId = -1;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Gender = Database.GetGender(UserId);
|
Gender = Database.GetGender(UserId);
|
||||||
|
|
|
@ -1312,6 +1312,7 @@ namespace HISP.Server
|
||||||
Messages.RanchNoDorothyShoesMessage = gameData.messages.meta.ranch.no_dorothy_shoes;
|
Messages.RanchNoDorothyShoesMessage = gameData.messages.meta.ranch.no_dorothy_shoes;
|
||||||
Messages.RanchDorothyShoesMessage = gameData.messages.meta.ranch.dorothy_message;
|
Messages.RanchDorothyShoesMessage = gameData.messages.meta.ranch.dorothy_message;
|
||||||
Messages.RanchDorothyShoesPrisonIsleMessage = gameData.messages.meta.ranch.dorothy_prison_isle;
|
Messages.RanchDorothyShoesPrisonIsleMessage = gameData.messages.meta.ranch.dorothy_prison_isle;
|
||||||
|
Messages.RanchForcefullySoldFormat = gameData.messages.meta.ranch.forcefully_sold;
|
||||||
|
|
||||||
Messages.RanchCantAffordRanch = gameData.messages.meta.ranch.ranch_buy_cannot_afford;
|
Messages.RanchCantAffordRanch = gameData.messages.meta.ranch.ranch_buy_cannot_afford;
|
||||||
Messages.RanchRanchBroughtMessageFormat = gameData.messages.meta.ranch.ranch_brought;
|
Messages.RanchRanchBroughtMessageFormat = gameData.messages.meta.ranch.ranch_brought;
|
||||||
|
@ -1321,8 +1322,7 @@ namespace HISP.Server
|
||||||
Messages.RanchSavedDescrptionTooLongError = gameData.messages.meta.ranch.ranch_info.description_too_long;
|
Messages.RanchSavedDescrptionTooLongError = gameData.messages.meta.ranch.ranch_info.description_too_long;
|
||||||
Messages.RanchSavedTitleViolationsError = gameData.messages.meta.ranch.ranch_info.title_contains_violations;
|
Messages.RanchSavedTitleViolationsError = gameData.messages.meta.ranch.ranch_info.title_contains_violations;
|
||||||
Messages.RanchSavedDescrptionViolationsErrorFormat = gameData.messages.meta.ranch.ranch_info.desc_contains_violations;
|
Messages.RanchSavedDescrptionViolationsErrorFormat = gameData.messages.meta.ranch.ranch_info.desc_contains_violations;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Messages.RanchDefaultRanchTitle = gameData.messages.meta.ranch.default_title;
|
Messages.RanchDefaultRanchTitle = gameData.messages.meta.ranch.default_title;
|
||||||
Messages.RanchEditDescriptionMetaFormat = gameData.messages.meta.ranch.edit_description;
|
Messages.RanchEditDescriptionMetaFormat = gameData.messages.meta.ranch.edit_description;
|
||||||
|
|
Loading…
Add table
Reference in a new issue