Update ServerAPI to latest. Added command to reset the completed angler quests. Verified that angler quests are working as intended. Set value in db to 9, completed quest, received fuzzy carrot, shut down server, set to saw it was set to 10, set to 19, started server, completed quest, received his hat. Please stop reporting this as broken.
This commit is contained in:
parent
55a00c208d
commit
18138afd1d
5 changed files with 39 additions and 4 deletions
|
|
@ -27,6 +27,7 @@ using System.Text;
|
|||
using System.Threading;
|
||||
using Terraria;
|
||||
using TShockAPI.DB;
|
||||
using TerrariaApi.Server;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
|
|
@ -380,6 +381,10 @@ namespace TShockAPI
|
|||
{
|
||||
HelpText = "Starts a Frost Moon at the specified wave."
|
||||
});
|
||||
add(new Command(Permissions.clearangler, ClearAnglerQuests, "clearangler")
|
||||
{
|
||||
HelpText = "Resets the list of users who have completed an angler quest that day."
|
||||
});
|
||||
#endregion
|
||||
#region TP Commands
|
||||
add(new Command(Permissions.home, Home, "home")
|
||||
|
|
@ -1516,7 +1521,7 @@ namespace TShockAPI
|
|||
|
||||
private static void Restart(CommandArgs args)
|
||||
{
|
||||
if (Main.runningMono)
|
||||
if (ServerApi.RunningMono)
|
||||
{
|
||||
Log.ConsoleInfo("Sorry, this command has not yet been implemented in Mono.");
|
||||
}
|
||||
|
|
@ -1702,6 +1707,32 @@ namespace TShockAPI
|
|||
TSPlayer.All.SendInfoMessage("{0} started the frost moon at wave {1}!", args.Player.Name, wave);
|
||||
}
|
||||
|
||||
private static void ClearAnglerQuests(CommandArgs args)
|
||||
{
|
||||
if (args.Parameters.Count > 0)
|
||||
{
|
||||
var result = Main.anglerWhoFinishedToday.RemoveAll(s => s.ToLower().Equals(args.Parameters[0].ToLower()));
|
||||
if (result > 0)
|
||||
{
|
||||
args.Player.SendSuccessMessage("Removed {0} players from the angler quest completion list for today.", result);
|
||||
foreach (TSPlayer ply in TShock.Players.Where(p => p!= null && p.Active && p.TPlayer.name.ToLower().Equals(args.Parameters[0].ToLower())))
|
||||
{
|
||||
//this will always tell the client that they have not done the quest today.
|
||||
ply.SendData((PacketTypes)74, "");
|
||||
}
|
||||
}
|
||||
else
|
||||
args.Player.SendErrorMessage("Failed to find any users by that name on the list.");
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
Main.anglerWhoFinishedToday.Clear();
|
||||
NetMessage.SendAnglerQuest();
|
||||
args.Player.SendSuccessMessage("Cleared all users from the angler quest completion list for today.");
|
||||
}
|
||||
}
|
||||
|
||||
private static void Hardmode(CommandArgs args)
|
||||
{
|
||||
if (Main.hardMode)
|
||||
|
|
|
|||
|
|
@ -197,7 +197,7 @@ namespace TShockAPI
|
|||
{
|
||||
if (socket.tcpClient.Client != null && socket.tcpClient.Client.Poll(0, SelectMode.SelectWrite))
|
||||
{
|
||||
if (Main.runningMono)
|
||||
if (ServerApi.RunningMono)
|
||||
socket.networkStream.Write(buffer, offset, count);
|
||||
else
|
||||
socket.tcpClient.Client.Send(buffer, offset, count, SocketFlags.None);
|
||||
|
|
|
|||
|
|
@ -200,6 +200,9 @@ namespace TShockAPI
|
|||
[Description("User can start invasions (Goblin/Snow Legion) using items")]
|
||||
public static readonly string startinvasion = "tshock.npc.startinvasion";
|
||||
|
||||
[Description("User can clear the list of users who have completed an angler quest that day.")]
|
||||
public static readonly string clearangler = "tshock.npc.clearanglerquests";
|
||||
|
||||
// tshock.superadmin nodes
|
||||
|
||||
[Description("Meant for super admins only.")]
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@ using System.Net;
|
|||
using System.Threading;
|
||||
using System.IO;
|
||||
using System.Web;
|
||||
using TerrariaApi.Server;
|
||||
|
||||
namespace TShockAPI
|
||||
{
|
||||
|
|
@ -54,7 +55,7 @@ namespace TShockAPI
|
|||
systemCPUClock = 0,
|
||||
version = TShock.VersionNum.ToString(),
|
||||
terrariaVersion = Terraria.Main.versionNumber2,
|
||||
mono = Terraria.Main.runningMono
|
||||
mono = ServerApi.RunningMono
|
||||
};
|
||||
|
||||
var serialized = Newtonsoft.Json.JsonConvert.SerializeObject(data);
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
Subproject commit a44d46af2f7b54110707b6f09875fdcf32365544
|
||||
Subproject commit e89c1ed6904e3b1787e69615e900c506fb64bec2
|
||||
Loading…
Add table
Add a link
Reference in a new issue