MCPcopy Create free account
hub / github.com/alliedmodders/sourcemod / DispatchClientCommand

Method DispatchClientCommand

core/ConCmdManager.cpp:156–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

154}
155
156ResultType ConCmdManager::DispatchClientCommand(int client, const char *cmd, int args, ResultType type)
157{
158 ConCmdInfo *pInfo = FindInTrie(cmd);
159
160 if (pInfo == NULL)
161 {
162 return type;
163 }
164
165 cell_t result = type;
166 for (CmdHookList::iterator iter = pInfo->hooks.begin(); iter != pInfo->hooks.end(); iter++)
167 {
168 CmdHook *hook = *iter;
169
170 if (hook->type == CmdHook::Server || !hook->pf->IsRunnable())
171 continue;
172
173 if (hook->admin && !CheckAccess(client, cmd, hook->admin.get()))
174 {
175 if (result < Pl_Handled)
176 result = Pl_Handled;
177 continue;
178 }
179
180 hook->pf->PushCell(client);
181 hook->pf->PushCell(args);
182
183 cell_t tempres = result;
184
185 if (hook->pf->Execute(&tempres) == SP_ERROR_NONE)
186 {
187 if (tempres > result)
188 result = tempres;
189 if (result == Pl_Stop)
190 break;
191 }
192 }
193
194 return (ResultType)result;
195}
196
197bool ConCmdManager::InternalDispatch(int client, const ICommandArgs *args)
198{

Callers 1

OnClientCommandMethod · 0.80

Calls 6

CheckAccessFunction · 0.85
IsRunnableMethod · 0.80
PushCellMethod · 0.80
beginMethod · 0.45
endMethod · 0.45
ExecuteMethod · 0.45

Tested by

no test coverage detected