mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-10 23:25:41 +12:00
Fix drawing rooms
This commit is contained in:
parent
edb27809bd
commit
8b1f73625a
6 changed files with 24 additions and 15 deletions
|
@ -299,6 +299,18 @@ namespace HISP.Game
|
|||
}
|
||||
throw new KeyNotFoundException("Zone not found.");
|
||||
}
|
||||
public static SpecialTile[] GetSpecialTilesByCode(string code)
|
||||
{
|
||||
List<SpecialTile> tiles = new List<SpecialTile>();
|
||||
foreach (SpecialTile tile in SpecialTiles)
|
||||
{
|
||||
if (tile.Code == code)
|
||||
{
|
||||
tiles.Add(tile);
|
||||
}
|
||||
}
|
||||
return tiles.ToArray();
|
||||
}
|
||||
public static SpecialTile[] GetSpecialTilesByName(string name)
|
||||
{
|
||||
List<SpecialTile> tiles = new List<SpecialTile>();
|
||||
|
|
|
@ -18,7 +18,7 @@ namespace HISP
|
|||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
||||
#endif
|
||||
|
||||
Console.Title = ServerVersion.GetVersionString();
|
||||
Console.Title = ServerVersion.GetBuildString();
|
||||
ConfigReader.OpenConfig();
|
||||
CrossDomainPolicy.GetPolicy();
|
||||
Database.OpenDatabase();
|
||||
|
|
|
@ -1 +1 @@
|
|||
392a3dfcaaaca0e4f3aba9b428d07830550dbd78
|
||||
edb27809bdaf2408b8100306b19261164685622d
|
||||
|
|
|
@ -241,12 +241,6 @@ namespace HISP.Server
|
|||
SendPacket(chatPacket);
|
||||
if (LoggedIn)
|
||||
LoggedinUser.Idle = true;
|
||||
if(warnTimer != null)
|
||||
{
|
||||
warnTimer.Dispose();
|
||||
warnTimer = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void kickTimerTick(object state)
|
||||
|
@ -358,12 +352,12 @@ namespace HISP.Server
|
|||
LoggedinUser.Idle = false;
|
||||
inactivityTimer.Change(keepAliveInterval, keepAliveInterval);
|
||||
}
|
||||
|
||||
|
||||
if (kickTimer != null && identifier != PacketBuilder.PACKET_KEEP_ALIVE)
|
||||
kickTimer = new Timer(new TimerCallback(kickTimerTick), null, kickInterval, kickInterval);
|
||||
kickTimer.Change(kickInterval, kickInterval);
|
||||
|
||||
if (warnTimer != null && identifier != PacketBuilder.PACKET_KEEP_ALIVE)
|
||||
warnTimer = new Timer(new TimerCallback(warnTimerTick), null, warnInterval, warnInterval);
|
||||
warnTimer.Change(warnInterval, warnInterval);
|
||||
|
||||
if (!LoggedIn) // Must be either login or policy-file-request
|
||||
{
|
||||
|
|
|
@ -3954,8 +3954,11 @@ namespace HISP.Server
|
|||
packetStr = Encoding.UTF8.GetString(packet);
|
||||
|
||||
string drawing = packetStr.Substring(3, packetStr.Length - 5);
|
||||
if (drawing.Contains("X")) // Clear byte
|
||||
if (drawing.Contains("X!")) // Clear byte
|
||||
{
|
||||
room.Drawing = "";
|
||||
goto update;
|
||||
}
|
||||
|
||||
try {
|
||||
room.Drawing += drawing;
|
||||
|
@ -3966,9 +3969,9 @@ namespace HISP.Server
|
|||
sender.SendPacket(roomFullMessage);
|
||||
break;
|
||||
}
|
||||
update:;
|
||||
Database.SetLastPlayer("D" + room.Id.ToString(), sender.LoggedinUser.Id);
|
||||
UpdateDrawingForAll("D" + room.Id, sender, drawing, false);
|
||||
|
||||
}
|
||||
|
||||
break;
|
||||
|
@ -7643,7 +7646,7 @@ namespace HISP.Server
|
|||
|
||||
public static void UpdateDrawingForAll(string id, GameClient sender, string drawing, bool includingSender=false)
|
||||
{
|
||||
World.SpecialTile[] tiles = World.GetSpecialTilesByName("MULTIROOM-D" + id);
|
||||
World.SpecialTile[] tiles = World.GetSpecialTilesByCode("MULTIROOM-" + id);
|
||||
foreach (World.SpecialTile tile in tiles)
|
||||
{
|
||||
UpdateAreaForAll(tile.X, tile.Y, true, null);
|
||||
|
|
|
@ -49,7 +49,7 @@ namespace HISP.Server
|
|||
}
|
||||
public static string GetBuildString()
|
||||
{
|
||||
return PRODUCT + " " + GetVersionString() + " @" + GetCommitHash(4) + "; (" + GetArchitecture() + "; " + GetPlatform() + ")";
|
||||
return PRODUCT + " " + GetVersionString() + " @" + GetCommitHash(7) + "; (" + GetArchitecture() + "; " + GetPlatform() + ")";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue