MCPcopy Create free account
hub / github.com/SunOner/sunone_aimbot_2 / BuildOpenOrder

Function BuildOpenOrder

sunone_aimbot_2/capture/virtual_camera.cpp:281–328  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

279}
280
281std::vector<int> BuildOpenOrder(const std::vector<CameraCandidate>& candidates, const std::string& requestedName)
282{
283 std::vector<int> order;
284 order.reserve(candidates.size());
285
286 auto addUnique = [&](int idx)
287 {
288 if (idx < 0 || idx >= static_cast<int>(candidates.size()))
289 return;
290 if (std::find(order.begin(), order.end(), idx) == order.end())
291 order.push_back(idx);
292 };
293
294 const std::string trimmedRequest = OtherTools::TrimAscii(requestedName);
295 const std::string lowerRequest = OtherTools::ToLowerAscii(trimmedRequest);
296 const bool autoSelect = trimmedRequest.empty() || lowerRequest == "none" || lowerRequest == "auto";
297
298 if (!autoSelect)
299 {
300 int exact = FindExactNameMatch(candidates, trimmedRequest);
301 if (exact >= 0)
302 addUnique(exact);
303 else
304 {
305 int partial = FindPartialNameMatch(candidates, trimmedRequest);
306 if (partial >= 0)
307 addUnique(partial);
308 }
309 }
310
311 int bestAutoIdx = -1;
312 int bestScore = -1;
313 for (int i = 0; i < static_cast<int>(candidates.size()); ++i)
314 {
315 const int score = ScoreAutoCameraChoice(candidates[i]);
316 if (score > bestScore)
317 {
318 bestScore = score;
319 bestAutoIdx = i;
320 }
321 }
322 addUnique(bestAutoIdx);
323
324 for (int i = 0; i < static_cast<int>(candidates.size()); ++i)
325 addUnique(i);
326
327 return order;
328}
329
330bool TryOpenCandidate(
331 const CameraCandidate& candidate,

Callers 1

VirtualCameraCaptureMethod · 0.85

Calls 12

TrimAsciiFunction · 0.85
ToLowerAsciiFunction · 0.85
FindExactNameMatchFunction · 0.85
FindPartialNameMatchFunction · 0.85
ScoreAutoCameraChoiceFunction · 0.85
findFunction · 0.50
reserveMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected