Only process journey research updates for SSC mode

This commit changes the logic for sending and accepting journey research
requests -- only processing those requests in SSC makes sense. This
stops sending extra data to clients that may not know what to do with it
when it's not relevant (not in both SSC and journey mode).

This also stops us from accepting erroneous journey mode NPC spawn rate
update requests when journey mode isn't on but SSC is on due to a weird
client glitch in 1.4.0.4.
This commit is contained in:
Lucas Nicodemus 2020-05-25 01:01:47 -07:00
parent fb418095fe
commit d1b27d8b7a
No known key found for this signature in database
GPG key ID: A07BD9023D1664DB
2 changed files with 18 additions and 10 deletions

View file

@ -484,18 +484,20 @@ namespace TShockAPI
NetMessage.SendData(39, player.Index, -1, NetworkText.Empty, 400);
var sacrificedItems = TShock.ResearchDatastore.GetSacrificedItems();
for(int i = 0; i < ItemID.Count; i++)
if (Main.GameModeInfo.IsJourneyMode)
{
var amount = 0;
if (sacrificedItems.ContainsKey(i))
var sacrificedItems = TShock.ResearchDatastore.GetSacrificedItems();
for(int i = 0; i < ItemID.Count; i++)
{
amount = sacrificedItems[i];
}
var amount = 0;
if (sacrificedItems.ContainsKey(i))
{
amount = sacrificedItems[i];
}
var response = NetCreativeUnlocksModule.SerializeItemSacrifice(i, amount);
NetManager.Instance.SendToClient(response, player.TPlayer.whoAmI);
var response = NetCreativeUnlocksModule.SerializeItemSacrifice(i, amount);
NetManager.Instance.SendToClient(response, player.TPlayer.whoAmI);
}
}
}
}