Closed toasterparty closed 2 years ago
Thanks for reporting this, CompleteLocationChecks marks an location as "completed" or checked or marked off
CompleteLocationChecks marks an location as "completed" or checked or marked off ScoutLocationsAsync asks the server for what item is stored in that location, it can also be used to generate actual hints that are visable to players and under !hint. it does however now mark the location as collected or completed or marked off or checked
The received item helper callback should be invoked for every item again after a reconnect. Whether or not it includes the first batch of remote items depents on your ItemHandlingFlags setting during connection
We do need to improve these docs quite a bit
Additionally, this is important for a basic implementation:
public static void send_completion()
{
var statusUpdatePacket = new StatusUpdatePacket();
statusUpdatePacket.Status = ArchipelagoClientState.ClientGoal;
Session.Socket.SendPacket(statusUpdatePacket);
}
In this existing example code, the language keyword new
is used illegally.
session.DataStorage["OnChangeHandler"].OnValueChanged += (old, new) => {
var changed = (int)new - (int)old; //Keep track of changes made to `OnChangeHandler` by any client, and calculate the difference
};
It also doesn't demonstrate how to cast back to an object like so:
session.DataStorage["OnChangeHandler"].OnValueChanged += (_old, _new) => {
OnChangeHandler(
_old.ToObject<Dictionary<int, int>>(),
_new.ToObject<Dictionary<int, int>>()
);
};
Trying to set DataStorage["Key"].OnValueChanged
before result is LoginSuccessful loginSuccess
results in an exception being thrown. This is counterintuitive because the examples show other callback handlers such as:
session.Items.ItemReceived += (receivedItemsHelper) => { OnItemReceived(receivedItemsHelper); };
...before the TryConnectAndLogin
call.
Intresting comments, wy dont you just put them in pull request >.>
I may, but I'm still learning new things about the lib. I will when I'm done with my implementation.
The example code presented in
README.MD
leaves first time users with some questions:CompleteLocationChecks
do? It might seem obvious, but I had to do a double take and look at an example client to know for sure.CompleteLocationChecks
andScoutLocationsAsync
?receivedItemsHelper.DequeueItem()
, but does not hint to the reader as to what information within the dequeued object might be useful. What is a client responsible for doing with this info?A minimalistic example class with connection error handling, basic message handler, basic item received callback, and a "report location completion" function would go a long way to helping new devs.