MCPcopy Create free account
hub / github.com/Segs/Segs / UpdateCommandShortcuts

Method UpdateCommandShortcuts

Projects/CoX/Servers/MapServer/NetCommandManager.cpp:133–148  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

131 tgt.StorePackedBits(1,~0u); // end of command list
132}
133void NetCommandManager::UpdateCommandShortcuts(MapClientSession *client, std::vector<QString> &commands)
134{
135 static bool initialized=false;
136 if(!initialized) {
137 initialized=true;
138 FillCommands();
139 }
140 // add shortcuts to client's shortcut map.
141 //TODO: differentiate the commands based on access level ?
142 commands.reserve(m_commands_level0.size());
143 for(size_t i=0, total = m_commands_level0.size(); i<total; ++i)
144 {
145 client->AddShortcut(i,m_commands_level0[i]);
146 commands.push_back(m_commands_level0[i]->m_name);
147 }
148}
149//! @}

Callers 1

on_shortcuts_requestMethod · 0.80

Calls 4

FillCommandsFunction · 0.85
AddShortcutMethod · 0.80
push_backMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected