Fix Auctions

This commit is contained in:
Bluzume 2021-10-26 18:58:55 -04:00
parent c9caa69805
commit 392a3dfcaa
5 changed files with 61 additions and 57 deletions

View file

@ -274,19 +274,10 @@ namespace HISP.Game.Services
public void UpdateAuctionRoom()
{
foreach (World.SpecialTile tile in World.SpecialTiles)
World.SpecialTile[] tiles = World.GetSpecialTilesByName("AUCTION-" + this.RoomId.ToString());
foreach (World.SpecialTile tile in tiles)
{
if (tile.Code != null)
{
if (tile.Code.StartsWith("AUCTION-"))
{
int id = int.Parse(tile.Code.Split('-')[1]);
if (id == this.RoomId)
{
GameServer.UpdateAreaForAll(tile.X, tile.Y);
}
}
}
GameServer.UpdateAreaForAll(tile.X, tile.Y, true);
}
}
public void DeleteEntry(AuctionEntry entry)

View file

@ -43,8 +43,8 @@
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
<DebugType>embedded</DebugType>
<ProduceReferenceAssembly>False</ProduceReferenceAssembly>
<AnalysisLevel>latest</AnalysisLevel>
<EnableNETAnalyzers>True</EnableNETAnalyzers>
<AnalysisLevel>none</AnalysisLevel>
<EnableNETAnalyzers>False</EnableNETAnalyzers>
<Copyright>Public Domain, 2021</Copyright>
<PackageProjectUrl>https://islehorse.com</PackageProjectUrl>
<RepositoryUrl>https://github.com/islehorse/HISP</RepositoryUrl>
@ -57,28 +57,32 @@
<Optimize>true</Optimize>
<PlatformTarget>x86</PlatformTarget>
<DefineConstants>OS_WINDOWS;ARCH_X86</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows|x64'">
<RuntimeIdentifier>win-x64</RuntimeIdentifier>
<Optimize>true</Optimize>
<PlatformTarget>x64</PlatformTarget>
<DefineConstants>OS_WINDOWS;ARCH_X86_64</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows|ARM'">
<RuntimeIdentifier>win-arm</RuntimeIdentifier>
<Optimize>true</Optimize>
<PlatformTarget>ARM32</PlatformTarget>
<DefineConstants>OS_WINDOWS;ARCH_ARM</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows|ARM64'">
<RuntimeIdentifier>win-arm64</RuntimeIdentifier>
<Optimize>true</Optimize>
<PlatformTarget>ARM64</PlatformTarget>
<DefineConstants>OS_WINDOWS;ARCH_ARM64</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
@ -87,21 +91,24 @@
<Optimize>true</Optimize>
<PlatformTarget>x64</PlatformTarget>
<DefineConstants>OS_LINUX;ARCH_X86_64</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Linux|ARM'">
<RuntimeIdentifier>linux-arm</RuntimeIdentifier>
<PlatformTarget>ARM</PlatformTarget>
<Optimize>true</Optimize>
<DefineConstants>OS_LINUX;ARCH_ARM</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Linux|ARM64'">
<RuntimeIdentifier>linux-arm64</RuntimeIdentifier>
<PlatformTarget>ARM64</PlatformTarget>
<Optimize>true</Optimize>
<DefineConstants>OS_LINUX;ARCH_ARM64</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MacOS|x64'">
@ -109,13 +116,15 @@
<Optimize>true</Optimize>
<PlatformTarget>x64</PlatformTarget>
<DefineConstants>OS_MACOS;ARCH_X86_64</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MacOS|ARM64'">
<RuntimeIdentifier>osx-arm64</RuntimeIdentifier>
<Optimize>true</Optimize>
<DefineConstants>OS_MACOS;ARCH_ARM64</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
@ -131,7 +140,8 @@
<PlatformTarget>ARM32</PlatformTarget>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE;OS_DEBUG;ARCH_ARM</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
@ -139,68 +149,78 @@
<PlatformTarget>ARM64</PlatformTarget>
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE;OS_DEBUG;ARCH_ARM64</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE;OS_DEBUG;ARCH_X86_64</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x86'">
<Optimize>False</Optimize>
<DefineConstants>DEBUG;TRACE;OS_DEBUG;ARCH_X86</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MacOS|x86'">
<Optimize>True</Optimize>
<DefineConstants>OS_MACOS;ARCH_X86</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Linux|x86'">
<Optimize>True</Optimize>
<DefineConstants>OS_LINUX;ARCH_X86</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Linux|AnyCPU'">
<Optimize>True</Optimize>
<DefineConstants>OS_LINUX;ARCH_ANYCPU</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Windows|AnyCPU'">
<Optimize>True</Optimize>
<DefineConstants>OS_WINDOWS;ARCH_ANYCPU</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MacOS|AnyCPU'">
<Optimize>True</Optimize>
<DefineConstants>OS_MACOS;ARCH_ANYCPU</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='MacOS|ARM'">
<Optimize>True</Optimize>
<DefineConstants>OS_MACOS;ARCH_ARM</DefineConstants>
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
<WarningLevel>0</WarningLevel>
<WarningLevel>3</WarningLevel>
<NoWarn>1701;1702;2026</NoWarn>
</PropertyGroup>

View file

@ -768,9 +768,11 @@ namespace HISP.Server
}
if (!auctionRoom.HasAuctionEntry(auctionEntryId))
break;
Auction.AuctionEntry entry = auctionRoom.GetAuctionEntry(auctionEntryId);
entry.Bid(sender.LoggedinUser, bidAmount);
UpdateAreaForAll(tile.X, tile.Y, true, null);
}
}
}
@ -3803,8 +3805,7 @@ namespace HISP.Server
catch(KeyNotFoundException)
{
Logger.ErrorPrint(sender.LoggedinUser.Username + " tried to load an invalid drawing room: " + roomId);
break;
break;
}
if(room.Drawing != "")
@ -3923,7 +3924,6 @@ namespace HISP.Server
}
Database.SetLastPlayer("D" + room.Id.ToString(), sender.LoggedinUser.Id);
UpdateAreaForAll(sender.LoggedinUser.X, sender.LoggedinUser.Y, true);
UpdateDrawingForAll("D" + room.Id, sender, drawingToAdd, true);
byte[] loadedDrawingMessage = PacketBuilder.CreateChat(Messages.FormatDrawingRoomLoaded(slotNo), PacketBuilder.CHAT_BOTTOM_RIGHT);
@ -3975,7 +3975,6 @@ namespace HISP.Server
break;
}
Database.SetLastPlayer("D" + room.Id.ToString(), sender.LoggedinUser.Id);
UpdateAreaForAll(sender.LoggedinUser.X, sender.LoggedinUser.Y, true);
UpdateDrawingForAll("D" + room.Id, sender, drawing, false);
}
@ -7650,19 +7649,20 @@ namespace HISP.Server
public static void UpdateDrawingForAll(string id, GameClient sender, string drawing, bool includingSender=false)
{
UpdateAreaForAll(sender.LoggedinUser.X, sender.LoggedinUser.Y);
User[] usersHere = GetUsersOnSpecialTileCode("MULTIROOM-D" + id);
foreach (User user in usersHere)
World.SpecialTile[] tiles = World.GetSpecialTilesByName("MULTIROOM-D" + id);
foreach (World.SpecialTile tile in tiles)
{
if(!includingSender)
if (user.Id == sender.LoggedinUser.Id)
continue;
byte[] patchDrawing = PacketBuilder.CreateDrawingUpdatePacket(drawing);
user.LoggedinClient.SendPacket(patchDrawing);
UpdateAreaForAll(tile.X, tile.Y, true, null);
User[] usersHere = GameServer.GetUsersAt(tile.X, tile.Y, true, true);
foreach (User user in usersHere)
{
if (!includingSender)
if (user.Id == sender.LoggedinUser.Id)
continue;
byte[] patchDrawing = PacketBuilder.CreateDrawingUpdatePacket(drawing);
user.LoggedinClient.SendPacket(patchDrawing);
}
}
}
public static void UpdateHorseMenu(GameClient forClient, HorseInstance horseInst)

View file

@ -333,8 +333,6 @@ namespace HISP.Server
}
}
ms.WriteByte(PACKET_TERMINATOR);
ms.Seek(0x00, SeekOrigin.Begin);
return ms.ToArray();

View file

@ -1,16 +1,11 @@
using HISP.Properties;
using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
namespace HISP.Server
{
public class ServerVersion
{
public static int MAJOR = 1;
public static int MINOR = 3;
public static int MINOR = 2;
public static string PRODUCT = "HISP";
public static string GetArchitecture()