Add silly tile debug feature

This commit is contained in:
Li 2022-11-15 04:07:40 +13:00
parent 7f635d5fdd
commit 393dc147da
8 changed files with 108 additions and 19 deletions
HorseIsleServer/LibHISP

View file

@ -30,10 +30,10 @@ namespace HISP.Game
}
public static RanchUpgrade GetRanchUpgradeById(int id)
{
foreach (RanchUpgrade rachUpgrade in RanchUpgrades)
foreach (RanchUpgrade ranchUpgrade in RanchUpgrades)
{
if (rachUpgrade.Id == id)
return rachUpgrade;
if (ranchUpgrade.Id == id)
return ranchUpgrade;
}
throw new KeyNotFoundException("No ranch found.");
}
@ -168,7 +168,7 @@ namespace HISP.Game
}
else
{
if(Database.IsRanchOwned(this.Id))
if (Database.IsRanchOwned(this.Id))
{
Database.SetRanchOwner(this.Id, ownerId);
removeDorothyShoes(ownerId);
@ -180,6 +180,17 @@ namespace HISP.Game
}
}
if (GameServer.IsUserOnline(value))
{
User user = GameServer.GetUserById(value);
user.OwnedRanch = this;
user.Inventory.AddIgnoringFull(new ItemInstance(Item.DorothyShoes));
}
else
{
Database.AddItemToInventory(value, new ItemInstance(Item.DorothyShoes));
}
ownerId = value;
}
}

View file

@ -284,10 +284,10 @@ namespace HISP.Player
if (Administrator)
return true;
int Timestamp = Convert.ToInt32(new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds());
if(Timestamp > subscribedUntil && subscribed) // sub expired.
int timestamp = Convert.ToInt32(new DateTimeOffset(DateTime.UtcNow).ToUnixTimeSeconds());
if(timestamp > subscribedUntil && subscribed) // sub expired.
{
Logger.InfoPrint(Username + "'s Subscription expired. (timestamp now: " + Timestamp + " exp date: " + subscribedUntil+" )");
Logger.InfoPrint(Username + "'s Subscription expired. (timestamp now: " + timestamp + " exp date: " + subscribedUntil+" )");
Database.SetUserSubscriptionStatus(this.Id, false);
subscribed = false;
}

View file

@ -30,8 +30,8 @@ using System.Runtime.InteropServices;
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
[assembly: AssemblyVersion("1.8.30.0")]
[assembly: AssemblyFileVersion("1.8.30.0")]
[assembly: AssemblyVersion("1.8.32.0")]
[assembly: AssemblyFileVersion("1.8.32.0")]

View file

@ -5680,8 +5680,6 @@ namespace HISP.Server
sender.LoggedinUser.TakeMoney(ranch.Value);
ranch.OwnerId = sender.LoggedinUser.Id;
ranch.InvestedMoney += ranch.Value;
sender.LoggedinUser.OwnedRanch = ranch;
sender.LoggedinUser.Inventory.AddIgnoringFull(new ItemInstance(Item.DorothyShoes));
UpdateAreaForAll(sender.LoggedinUser.X, sender.LoggedinUser.Y, true);
}
@ -6124,9 +6122,10 @@ namespace HISP.Server
}
returnedMsg = Messages.FormatPlayerHereMessage(usernameStr);
}
byte[] tileInfoPacket = PacketBuilder.CreateTileClickInfo(returnedMsg);
}
// TODO: REMEMBER TO CHANGE THIS BACK
//byte[] tileInfoPacket = PacketBuilder.CreateTileClickInfo(returnedMsg);
byte[] tileInfoPacket = PacketBuilder.CreateTileClickInfo("ground: "+Map.GetTileId(x, y, false)+ ", overlay: "+ Map.GetTileId(x, y, true))
sender.SendPacket(tileInfoPacket);
}
}