Closed jonathan-robertson closed 1 year ago
Could also be an even better way to do it: NetPackagePlayerData.ProcessPackage
GameManager.SavePlayerData
will apply the modified quest journal to the player... possibly... if you set the _cInfo.entityId
value to the target player's entityId (i.e. suggest it's a request coming from the client that the player is controlling)
private void ListQuests(CommandSenderInfo senderInfo)
{
EntityPlayer player;
if (senderInfo.RemoteClientInfo == null)
{
player = GameManager.Instance.World.GetPrimaryPlayer();
if (player == null)
{
SdtdConsole.Instance.Output("No remote or local player could be found.");
return;
}
}
else if (!GameManager.Instance.World.Players.dict.TryGetValue(senderInfo.RemoteClientInfo.entityId, out player))
{
SdtdConsole.Instance.Output("Could not find remote player.");
return;
}
for (int i = 0; i < player.QuestJournal.quests.Count; i++)
{
SdtdConsole.Instance.Output($"{player.QuestJournal.quests[i].ID}. {player.QuestJournal.quests[i].GetPOIName()}");
}
}
Confirmed this is working now, but trader relationship doesn't update until log out/in; looking into that now
Dang, it still doesn't seem possible to fully push trader relationship changes unless the player logs out
Found out a very likely approach to removing quests! Server will be reading player data already on death. Instead of having to disconnect player so player can come back with manipulated player data file... the server can send the player a console command to have the player's client issue the command instead (which is supported).