mirror of
https://github.com/islehorse/HISP.git
synced 2025-04-18 19:01:32 +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.");
|
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)
|
public static SpecialTile[] GetSpecialTilesByName(string name)
|
||||||
{
|
{
|
||||||
List<SpecialTile> tiles = new List<SpecialTile>();
|
List<SpecialTile> tiles = new List<SpecialTile>();
|
||||||
|
|
|
@ -18,7 +18,7 @@ namespace HISP
|
||||||
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
AppDomain.CurrentDomain.UnhandledException += new UnhandledExceptionEventHandler(CurrentDomain_UnhandledException);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
Console.Title = ServerVersion.GetVersionString();
|
Console.Title = ServerVersion.GetBuildString();
|
||||||
ConfigReader.OpenConfig();
|
ConfigReader.OpenConfig();
|
||||||
CrossDomainPolicy.GetPolicy();
|
CrossDomainPolicy.GetPolicy();
|
||||||
Database.OpenDatabase();
|
Database.OpenDatabase();
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
392a3dfcaaaca0e4f3aba9b428d07830550dbd78
|
edb27809bdaf2408b8100306b19261164685622d
|
||||||
|
|
|
@ -241,12 +241,6 @@ namespace HISP.Server
|
||||||
SendPacket(chatPacket);
|
SendPacket(chatPacket);
|
||||||
if (LoggedIn)
|
if (LoggedIn)
|
||||||
LoggedinUser.Idle = true;
|
LoggedinUser.Idle = true;
|
||||||
if(warnTimer != null)
|
|
||||||
{
|
|
||||||
warnTimer.Dispose();
|
|
||||||
warnTimer = null;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void kickTimerTick(object state)
|
private void kickTimerTick(object state)
|
||||||
|
@ -358,12 +352,12 @@ namespace HISP.Server
|
||||||
LoggedinUser.Idle = false;
|
LoggedinUser.Idle = false;
|
||||||
inactivityTimer.Change(keepAliveInterval, keepAliveInterval);
|
inactivityTimer.Change(keepAliveInterval, keepAliveInterval);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (kickTimer != null && identifier != PacketBuilder.PACKET_KEEP_ALIVE)
|
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)
|
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
|
if (!LoggedIn) // Must be either login or policy-file-request
|
||||||
{
|
{
|
||||||
|
|
|
@ -3954,8 +3954,11 @@ namespace HISP.Server
|
||||||
packetStr = Encoding.UTF8.GetString(packet);
|
packetStr = Encoding.UTF8.GetString(packet);
|
||||||
|
|
||||||
string drawing = packetStr.Substring(3, packetStr.Length - 5);
|
string drawing = packetStr.Substring(3, packetStr.Length - 5);
|
||||||
if (drawing.Contains("X")) // Clear byte
|
if (drawing.Contains("X!")) // Clear byte
|
||||||
|
{
|
||||||
room.Drawing = "";
|
room.Drawing = "";
|
||||||
|
goto update;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
room.Drawing += drawing;
|
room.Drawing += drawing;
|
||||||
|
@ -3966,9 +3969,9 @@ namespace HISP.Server
|
||||||
sender.SendPacket(roomFullMessage);
|
sender.SendPacket(roomFullMessage);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
update:;
|
||||||
Database.SetLastPlayer("D" + room.Id.ToString(), sender.LoggedinUser.Id);
|
Database.SetLastPlayer("D" + room.Id.ToString(), sender.LoggedinUser.Id);
|
||||||
UpdateDrawingForAll("D" + room.Id, sender, drawing, false);
|
UpdateDrawingForAll("D" + room.Id, sender, drawing, false);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
@ -7643,7 +7646,7 @@ namespace HISP.Server
|
||||||
|
|
||||||
public static void UpdateDrawingForAll(string id, GameClient sender, string drawing, bool includingSender=false)
|
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)
|
foreach (World.SpecialTile tile in tiles)
|
||||||
{
|
{
|
||||||
UpdateAreaForAll(tile.X, tile.Y, true, null);
|
UpdateAreaForAll(tile.X, tile.Y, true, null);
|
||||||
|
|
|
@ -49,7 +49,7 @@ namespace HISP.Server
|
||||||
}
|
}
|
||||||
public static string GetBuildString()
|
public static string GetBuildString()
|
||||||
{
|
{
|
||||||
return PRODUCT + " " + GetVersionString() + " @" + GetCommitHash(4) + "; (" + GetArchitecture() + "; " + GetPlatform() + ")";
|
return PRODUCT + " " + GetVersionString() + " @" + GetCommitHash(7) + "; (" + GetArchitecture() + "; " + GetPlatform() + ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue