MCPcopy Create free account
hub / github.com/Lovrom8/RSMods / RunCommand

Function RunCommand

DLL/CC/ControlServer.cpp:29–60  ·  view source on GitHub ↗

Runs/stops the current effect Effects are started externally (from CC or RSMods GUI), but each effect stops itself by running the Run method, which in turn calls Stop when the effect's duration runs out

Source from the content-addressed store, hash-verified

27 /// Effects are started externally (from CC or RSMods GUI), but each effect stops itself by running the Run method, which in turn calls Stop when the effect's duration runs out
28 /// </summary>
29 Response RunCommand(const Request& request) {
30 Response resp{
31 request.id,
32 request.code,
33 EffectStatus::Unavailable,
34 0,
35 ResponseType::EffectRequest
36 };
37
38 if (GetAllEffects().find(request.code) != GetAllEffects().end()) {
39 CCEffect* effect = GetAllEffects().at(request.code);
40
41 switch (request.type)
42 {
43 case RequestType::Test:
44 resp.status = effect->Test(request);
45 break;
46 case RequestType::Start:
47 resp.status = effect->Start(request);
48 break;
49 case RequestType::Stop:
50 resp.status = effect->Stop();
51 break;
52 default:
53 break;
54 }
55
56 resp.timeRemaining = effect->duration_ms;
57 }
58
59 return resp;
60 }
61
62 /// <summary>
63 /// Sends a response through the same socket it received the request from

Callers 1

ClientLoopFunction · 0.85

Calls 5

findMethod · 0.80
endMethod · 0.45
TestMethod · 0.45
StartMethod · 0.45
StopMethod · 0.45

Tested by

no test coverage detected