From d689fac4cef1c08b1551596eeb74c4ccf14a5488 Mon Sep 17 00:00:00 2001 From: high Date: Thu, 7 Jul 2011 22:00:50 -0400 Subject: [PATCH 1/4] Accept chair/bed frame changes. Should fix direction issue. --- TShockAPI/GetDataHandlers.cs | 9 ++++++++- TShockAPI/Properties/AssemblyInfo.cs | 4 ++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 64fc1322..1574885e 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -220,6 +220,13 @@ namespace TShockAPI tile.type = 0x1; changed = true; } + else if ((tile.type == 0xF && newtile.Type == 0xF) || + (tile.type == 0x4F && newtile.Type == 0x4F)) + { + tile.frameX = newtile.FrameX; + tile.frameY = newtile.FrameY; + changed = true; + } } } @@ -294,7 +301,7 @@ namespace TShockAPI args.Player.SendMessage("Spawn protected from changes.", Color.Red); args.Player.LastTileChangeNotify = DateTime.UtcNow; } - args.Player.SendTileSquare(x, y); + args.Player.SendTileSquare(x, y); return true; } } diff --git a/TShockAPI/Properties/AssemblyInfo.cs b/TShockAPI/Properties/AssemblyInfo.cs index 66169d98..e0b89dc5 100644 --- a/TShockAPI/Properties/AssemblyInfo.cs +++ b/TShockAPI/Properties/AssemblyInfo.cs @@ -35,5 +35,5 @@ using System.Runtime.InteropServices; // by using the '*' as shown below: // [assembly: AssemblyVersion("1.0.*")] -[assembly: AssemblyVersion("2.3.2.0704")] -[assembly: AssemblyFileVersion("2.3.2.0704")] +[assembly: AssemblyVersion("2.3.2.0707")] +[assembly: AssemblyFileVersion("2.3.2.0707")] From 07a758d0e695f760a5a7146b447befba48468b8e Mon Sep 17 00:00:00 2001 From: high Date: Thu, 7 Jul 2011 22:42:22 -0400 Subject: [PATCH 2/4] Size changed from just 3 to <6. Chairs/Beds should be working now. --- TShockAPI/GetDataHandlers.cs | 2 +- TShockAPI/TShock.cs | 22 ++++++++++------------ 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/TShockAPI/GetDataHandlers.cs b/TShockAPI/GetDataHandlers.cs index 1574885e..b67f9e9a 100755 --- a/TShockAPI/GetDataHandlers.cs +++ b/TShockAPI/GetDataHandlers.cs @@ -181,7 +181,7 @@ namespace TShockAPI int tilex = args.Data.ReadInt32(); int tiley = args.Data.ReadInt32(); - if (size != 3) + if (size > 5) return true; var tiles = new NetTile[size, size]; diff --git a/TShockAPI/TShock.cs b/TShockAPI/TShock.cs index 2cd61ed6..44388dc1 100755 --- a/TShockAPI/TShock.cs +++ b/TShockAPI/TShock.cs @@ -80,18 +80,18 @@ namespace TShockAPI { HandleCommandLine(Environment.GetCommandLineArgs()); - ConfigFile.ConfigRead += OnConfigRead; - - Bans = new BanManager(FileTools.BansPath); - Backups = new BackupManager(Path.Combine(SavePath, "backups")); - - FileTools.SetupConfig(); - #if DEBUG Log.Initialize(Path.Combine(SavePath, "log.txt"), LogLevel.All, false); #else Log.Initialize(Path.Combine(SavePath, "log.txt"), LogLevel.All & ~LogLevel.Debug, false); #endif + AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; + + Bans = new BanManager(FileTools.BansPath); + Backups = new BackupManager(Path.Combine(SavePath, "backups")); + + ConfigFile.ConfigRead += OnConfigRead; + FileTools.SetupConfig(); Log.ConsoleInfo(string.Format("TShock Version {0} ({1}) now running.", Version, VersionCodename)); @@ -106,8 +106,7 @@ namespace TShockAPI NetHooks.GreetPlayer += OnGreetPlayer; NetHooks.SendData += OnSendData; NpcHooks.StrikeNpc += NpcHooks_OnStrikeNpc; - WorldHooks.SaveWorld += OnSaveWorld; - AppDomain.CurrentDomain.UnhandledException += CurrentDomain_UnhandledException; + Bans.LoadBans(); GetDataHandlers.InitGetDataHandler(); @@ -133,7 +132,6 @@ namespace TShockAPI NetHooks.GreetPlayer -= OnGreetPlayer; NetHooks.SendData -= OnSendData; NpcHooks.StrikeNpc -= NpcHooks_OnStrikeNpc; - WorldHooks.SaveWorld -= OnSaveWorld; } /// @@ -297,6 +295,8 @@ namespace TShockAPI private void OnLeave(int ply) { var tsplr = Players[ply]; + Players[ply] = null; + if (tsplr != null && tsplr.ReceivedInfo) { Log.Info(string.Format("{0} left.", tsplr.Name)); @@ -309,8 +309,6 @@ namespace TShockAPI RemeberedPosManager.WriteSettings(); } } - - Players[ply] = null; } private void OnChat(messageBuffer msg, int ply, string text, HandledEventArgs e) From 2a212629dcfae2a0b34183abec3d6c3e205c1cf2 Mon Sep 17 00:00:00 2001 From: high Date: Thu, 7 Jul 2011 22:42:51 -0400 Subject: [PATCH 3/4] Added WorldInfoMsg class (empty) --- TShockAPI/Net/WorldInfoMsg.cs | 29 +++++++++++++++++++++++++++++ TShockAPI/TShockAPI.csproj | 3 ++- 2 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 TShockAPI/Net/WorldInfoMsg.cs diff --git a/TShockAPI/Net/WorldInfoMsg.cs b/TShockAPI/Net/WorldInfoMsg.cs new file mode 100644 index 00000000..b2361699 --- /dev/null +++ b/TShockAPI/Net/WorldInfoMsg.cs @@ -0,0 +1,29 @@ +/* +TShock, a server mod for Terraria +Copyright (C) 2011 The TShock Team + +This program is free software: you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation, either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, +but WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +GNU General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program. If not, see . +*/ + +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +namespace TShockAPI.Net +{ + class WorldInfoMsg + { + } +} diff --git a/TShockAPI/TShockAPI.csproj b/TShockAPI/TShockAPI.csproj index 9a054663..b16f3565 100644 --- a/TShockAPI/TShockAPI.csproj +++ b/TShockAPI/TShockAPI.csproj @@ -83,6 +83,7 @@ + @@ -145,7 +146,7 @@ - +