MCPcopy Create free account
hub / github.com/BernardoGiordano/Checkpoint / update

Method update

switch/source/ReceiveOverlay.cpp:144–170  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144void ReceiveOverlay::update(const InputState& input)
145{
146 // While an upload is in flight, B means "cancel the transfer", never "close
147 // the overlay": the receiver must stay registered until the server thread has
148 // abandoned the request, so closing waits for the transfer to end.
149 TransferSnapshot ts = TransferStatus::snapshot();
150 if (ts.active && ts.kind == TransferKind::Network) {
151 if (input.kHeld & HidNpadButton_B) {
152 if (++mCancelHoldFrames >= CANCEL_HOLD_FRAMES && !TransferStatus::cancelRequested()) {
153 TransferStatus::requestCancel();
154 }
155 }
156 else {
157 mCancelHoldFrames = 0;
158 }
159 return; // no close path while active
160 }
161 mCancelHoldFrames = 0;
162
163 if (Transfer::receiverHasCompleted() && (input.kDown & HidNpadButton_A)) {
164 closeReceiver();
165 return;
166 }
167 if (input.kDown & HidNpadButton_B) {
168 closeReceiver();
169 }
170}

Callers

nothing calls this directly

Calls 3

snapshotFunction · 0.70
cancelRequestedFunction · 0.70
requestCancelFunction · 0.70

Tested by

no test coverage detected