Corrected spelling on receive
This commit is contained in:
@@ -12,7 +12,7 @@ You can currently connect to the multiworld server, scout the items.
|
||||
If you have no randomizer genereted (the `Randomizer` folder is empty) `Connect` to the multiworld from the main screen, click the `Scout` button to load all of the item locations and finally press the `Link up` button, you'll be able to start a randomizer save file.
|
||||
with the items populated with the location from the server.
|
||||
|
||||
Sending and Recieving should be implemented, Saving the game doesn't save the current item index localy (the library is a bit anoying with that).
|
||||
Sending and Receiving should be implemented, Saving the game doesn't save the current item index localy (the library is a bit anoying with that).
|
||||
|
||||
Not all checks have been mapped, and some may be mapped incorrectly.
|
||||
The victory condition should be implemented but has largely gone untested.
|
||||
|
||||
@@ -71,5 +71,5 @@ DEFINE_HOOK(OnAssetAltChange, ());
|
||||
DEFINE_HOOK(OnKaleidoUpdate, ());
|
||||
|
||||
DEFINE_HOOK(OnRandomizerItemGivenHooks, (uint32_t rc, GetItemEntry gi, uint8_t isGiSkipped));
|
||||
DEFINE_HOOK(OnArchipelagoItemRecieved, (uint32_t rg));
|
||||
DEFINE_HOOK(OnArchipelagoItemReceived, (uint32_t rg));
|
||||
DEFINE_HOOK(OnRandomizerExternalCheck, (uint32_t rc));
|
||||
|
||||
@@ -309,8 +309,8 @@ void GameInteractor_ExecuteOnRandomizerItemGivenHooks(uint32_t rc, GetItemEntry
|
||||
}
|
||||
|
||||
// MARK: Archipelago
|
||||
void GameInteractor_ExecuteOnArchipelagoItemRecieved(uint32_t rg) {
|
||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnArchipelagoItemRecieved>(rg);
|
||||
void GameInteractor_ExecuteOnArchipelagoItemReceived(uint32_t rg) {
|
||||
GameInteractor::Instance->ExecuteHooks<GameInteractor::OnArchipelagoItemReceived>(rg);
|
||||
}
|
||||
|
||||
void GameInteractor_ExecuteOnRandomizerExternalCheck(uint32_t rc) {
|
||||
|
||||
@@ -85,7 +85,7 @@ void GameInteractor_ExecuteOnKaleidoUpdate();
|
||||
void GameInteractor_ExecuteOnRandomizerItemGivenHooks(uint32_t rc, GetItemEntry gi, uint8_t isGiSkipped);
|
||||
|
||||
// Mark: - Archipelago
|
||||
void GameInteractor_ExecuteOnArchipelagoItemRecieved(uint32_t rg);
|
||||
void GameInteractor_ExecuteOnArchipelagoItemReceived(uint32_t rg);
|
||||
void GameInteractor_ExecuteOnRandomizerExternalCheck(uint32_t rc);
|
||||
|
||||
#ifdef __cplusplus
|
||||
|
||||
@@ -346,27 +346,27 @@ void Context::SetSpoilerLoaded(const bool spoilerLoaded) {
|
||||
mSpoilerLoaded = spoilerLoaded;
|
||||
}
|
||||
|
||||
void Context::AddRecievedArchipelagoItem(const RandomizerGet item) {
|
||||
mAPrecieveQueue.emplace(item);
|
||||
void Context::AddReceivedArchipelagoItem(const RandomizerGet item) {
|
||||
mAPreceiveQueue.emplace(item);
|
||||
std::string logMessage = "[LOG] Item Pushed: " + item;
|
||||
ArchipelagoConsole_SendMessage(logMessage.c_str(), true);
|
||||
}
|
||||
|
||||
GetItemEntry Context::GetArchipelagoGIEntry() {
|
||||
ArchipelagoConsole_SendMessage("[LOG] Trying to get Item Entry", true);
|
||||
if(mAPrecieveQueue.empty()) {
|
||||
if(mAPreceiveQueue.empty()) {
|
||||
// something must have gone wrong here, just give a rupee
|
||||
return ItemTableManager::Instance->RetrieveItemEntry(MOD_NONE, GI_HEART);
|
||||
}
|
||||
|
||||
// get the first item from the archipelago queue
|
||||
RandomizerGet item_id = mAPrecieveQueue.front();
|
||||
RandomizerGet item_id = mAPreceiveQueue.front();
|
||||
assert(item_id != RG_NONE);
|
||||
|
||||
Item& item = StaticData::RetrieveItem(item_id);
|
||||
SPDLOG_TRACE("Found item! {}, {}", item.GetName().GetEnglish(), (int)item_id);
|
||||
GetItemEntry item_entry = item.GetGIEntry_Copy();
|
||||
mAPrecieveQueue.pop();
|
||||
mAPreceiveQueue.pop();
|
||||
return item_entry; // todo: add custom text maybe?
|
||||
}
|
||||
|
||||
|
||||
@@ -107,7 +107,7 @@ class Context {
|
||||
*/
|
||||
RandoOptionLACSCondition LACSCondition() const;
|
||||
GetItemEntry GetFinalGIEntry(RandomizerCheck rc, bool checkObtainability = true, GetItemID ogItemId = GI_NONE);
|
||||
void AddRecievedArchipelagoItem(const RandomizerGet item);
|
||||
void AddReceivedArchipelagoItem(const RandomizerGet item);
|
||||
GetItemEntry GetArchipelagoGIEntry();
|
||||
void ParseSpoiler(const char* spoilerFileName);
|
||||
void ParseHashIconIndexesJson(nlohmann::json spoilerFileJson);
|
||||
@@ -189,6 +189,6 @@ class Context {
|
||||
std::string mHash;
|
||||
std::string mSeedString;
|
||||
uint32_t mFinalSeed = 0;
|
||||
std::queue<RandomizerGet> mAPrecieveQueue = {};
|
||||
std::queue<RandomizerGet> mAPreceiveQueue = {};
|
||||
};
|
||||
} // namespace Rando
|
||||
@@ -222,11 +222,11 @@ static std::queue<RandomizerCheck> randomizerQueuedChecks;
|
||||
static RandomizerCheck randomizerQueuedCheck = RC_UNKNOWN_CHECK;
|
||||
static GetItemEntry randomizerQueuedItemEntry = GET_ITEM_NONE;
|
||||
|
||||
void ArchipelagoOnRecieveItem(const int32_t item) {
|
||||
void ArchipelagoOnReceiveItem(const int32_t item) {
|
||||
std::string logMessage = "[LOG] Receive item handler called: " + item;
|
||||
ArchipelagoConsole_SendMessage(logMessage.c_str(), true);
|
||||
randomizerQueuedChecks.push(RC_ARCHIPELAGO_RECIEVED_ITEM);
|
||||
Rando::Context::GetInstance()->AddRecievedArchipelagoItem(static_cast<RandomizerGet>(item));
|
||||
randomizerQueuedChecks.push(RC_ARCHIPELAGO_RECEIVED_ITEM);
|
||||
Rando::Context::GetInstance()->AddReceivedArchipelagoItem(static_cast<RandomizerGet>(item));
|
||||
}
|
||||
|
||||
void RandomizerOnFlagSetHandler(int16_t flagType, int16_t flag) {
|
||||
@@ -313,7 +313,7 @@ void RandomizerOnPlayerUpdateForRCQueueHandler() {
|
||||
auto loc = Rando::Context::GetInstance()->GetItemLocation(rc);
|
||||
uint8_t isGiSkipped = 0;
|
||||
|
||||
if (rc == RC_ARCHIPELAGO_RECIEVED_ITEM) {
|
||||
if (rc == RC_ARCHIPELAGO_RECEIVED_ITEM) {
|
||||
getItemEntry = Rando::Context::GetInstance()->GetArchipelagoGIEntry();
|
||||
} else {
|
||||
RandomizerGet vanillaRandomizerGet = Rando::StaticData::GetLocation(rc)->GetVanillaItem();
|
||||
@@ -2540,7 +2540,7 @@ void RandomizerRegisterHooks() {
|
||||
onCuccoOrChickenHatchHook = GameInteractor::Instance->RegisterGameHook<GameInteractor::OnCuccoOrChickenHatch>(
|
||||
RandomizerOnCuccoOrChickenHatch);
|
||||
|
||||
COND_HOOK(GameInteractor::OnArchipelagoItemRecieved, IS_ARCHIPELAGO, ArchipelagoOnRecieveItem);
|
||||
COND_HOOK(GameInteractor::OnArchipelagoItemReceived, IS_ARCHIPELAGO, ArchipelagoOnReceiveItem);
|
||||
COND_HOOK(GameInteractor::OnRandomizerExternalCheck, IS_ARCHIPELAGO, RandomizerOnExternalCheckHandler)
|
||||
|
||||
if (RAND_GET_OPTION(RSK_FISHSANITY) != RO_FISHSANITY_OFF) {
|
||||
|
||||
@@ -133,7 +133,7 @@ bool ItemLocation::HasObtained() const {
|
||||
}
|
||||
|
||||
void ItemLocation::SetCheckStatus(RandomizerCheckStatus status_) {
|
||||
if(rc == RC_ARCHIPELAGO_RECIEVED_ITEM) // never count the AP recieve trigger as 'collected'
|
||||
if(rc == RC_ARCHIPELAGO_RECEIVED_ITEM) // never count the AP receive trigger as 'collected'
|
||||
return;
|
||||
status = status_;
|
||||
}
|
||||
|
||||
@@ -3472,7 +3472,7 @@ typedef enum {
|
||||
RC_DEKU_TREE_QUEEN_GOHMA_GRASS_8,
|
||||
// End Grass
|
||||
|
||||
RC_ARCHIPELAGO_RECIEVED_ITEM,
|
||||
RC_ARCHIPELAGO_RECEIVED_ITEM,
|
||||
RC_MAX
|
||||
} RandomizerCheck;
|
||||
|
||||
|
||||
@@ -67,7 +67,7 @@ bool ArchipelagoClient::StartClient() {
|
||||
// we won't have to request an itemSynch
|
||||
if(GameInteractor::IsSaveLoaded(true)) {
|
||||
SynchSentLocations();
|
||||
SynchRecievedLocations();
|
||||
SynchReceivedLocations();
|
||||
}
|
||||
});
|
||||
|
||||
@@ -147,7 +147,7 @@ void ArchipelagoClient::GameLoaded() {
|
||||
|
||||
SynchItems();
|
||||
SynchSentLocations();
|
||||
SynchRecievedLocations();
|
||||
SynchReceivedLocations();
|
||||
}
|
||||
|
||||
void ArchipelagoClient::StartLocationScouts() {
|
||||
@@ -185,7 +185,7 @@ void ArchipelagoClient::SynchSentLocations() {
|
||||
apClient->LocationChecks(checkedLocations);
|
||||
}
|
||||
|
||||
void ArchipelagoClient::SynchRecievedLocations() {
|
||||
void ArchipelagoClient::SynchReceivedLocations() {
|
||||
// Open checks that have been found previously but went unsaved
|
||||
for(const int64_t apLoc : apClient->get_checked_locations()) {
|
||||
QueueExternalCheck(apLoc);
|
||||
@@ -244,17 +244,17 @@ void ArchipelagoClient::OnItemReceived(const ApItem apItem) {
|
||||
return;
|
||||
}
|
||||
|
||||
std::string logMessage = "[LOG] Recieved " + apItem.itemName;
|
||||
std::string logMessage = "[LOG] Received " + apItem.itemName;
|
||||
ArchipelagoConsole_SendMessage(logMessage.c_str(), true);
|
||||
|
||||
// add item to the queue
|
||||
recieveQueue.push(apItem);
|
||||
receiveQueue.push(apItem);
|
||||
}
|
||||
|
||||
void ArchipelagoClient::QueueItem(const ApItem item) {
|
||||
if(item.index < gSaveContext.ship.quest.data.archipelago.lastReceivedItemIndex) {
|
||||
// Skip queueing any items we already have
|
||||
std::string logMessage = "[LOG] Skipping giving " + item.itemName + ". We recieved this previously.";
|
||||
std::string logMessage = "[LOG] Skipping giving " + item.itemName + ". We received this previously.";
|
||||
ArchipelagoConsole_SendMessage(logMessage.c_str(), true);
|
||||
return;
|
||||
}
|
||||
@@ -267,7 +267,7 @@ void ArchipelagoClient::QueueItem(const ApItem item) {
|
||||
}
|
||||
|
||||
itemQueued = true;
|
||||
GameInteractor_ExecuteOnArchipelagoItemRecieved(static_cast<int32_t>(RG));
|
||||
GameInteractor_ExecuteOnArchipelagoItemReceived(static_cast<int32_t>(RG));
|
||||
}
|
||||
|
||||
void ArchipelagoClient::SendGameWon() {
|
||||
@@ -282,11 +282,11 @@ void ArchipelagoClient::Poll() {
|
||||
return;
|
||||
}
|
||||
|
||||
// queue another item to be recieved
|
||||
if(!itemQueued && recieveQueue.size() > 0) {
|
||||
// queue another item to be received
|
||||
if(!itemQueued && receiveQueue.size() > 0) {
|
||||
|
||||
const ApItem item = recieveQueue.front();
|
||||
recieveQueue.pop();
|
||||
const ApItem item = receiveQueue.front();
|
||||
receiveQueue.pop();
|
||||
QueueItem(item);
|
||||
}
|
||||
|
||||
@@ -327,7 +327,7 @@ const char* ArchipelagoClient::GetConnectionStatus() {
|
||||
return "Socket Connected!";
|
||||
}
|
||||
case APClient::State::ROOM_INFO: {
|
||||
return "Room info Recieved!";
|
||||
return "Room info Received!";
|
||||
}
|
||||
case APClient::State::SLOT_CONNECTED: {
|
||||
return "Slot Connected!";
|
||||
@@ -425,7 +425,7 @@ void RegisterArchipelago() {
|
||||
|
||||
COND_HOOK(GameInteractor::OnRandomizerItemGivenHooks, IS_ARCHIPELAGO,
|
||||
[](uint32_t rc, GetItemEntry gi, uint8_t isGiSkipped) {
|
||||
if (rc == RC_ARCHIPELAGO_RECIEVED_ITEM) {
|
||||
if (rc == RC_ARCHIPELAGO_RECEIVED_ITEM) {
|
||||
gSaveContext.ship.quest.data.archipelago.lastReceivedItemIndex++;
|
||||
ArchipelagoClient::GetInstance().itemQueued = false;
|
||||
} else {
|
||||
|
||||
@@ -36,7 +36,7 @@ class ArchipelagoClient{
|
||||
void StartLocationScouts();
|
||||
void SynchItems();
|
||||
void SynchSentLocations();
|
||||
void SynchRecievedLocations();
|
||||
void SynchReceivedLocations();
|
||||
|
||||
// getters
|
||||
const std::string GetSlotName() const;
|
||||
@@ -75,7 +75,7 @@ class ArchipelagoClient{
|
||||
nlohmann::json slotData;
|
||||
std::set<int64_t> locations;
|
||||
std::vector<ApItem> scoutedItems;
|
||||
std::queue<ApItem> recieveQueue;
|
||||
std::queue<ApItem> receiveQueue;
|
||||
};
|
||||
|
||||
void LoadArchipelagoData();
|
||||
|
||||
Reference in New Issue
Block a user