本文整理汇总了C++中IConfig::RegisterCallback方法的典型用法代码示例。如果您正苦于以下问题:C++ IConfig::RegisterCallback方法的具体用法?C++ IConfig::RegisterCallback怎么用?C++ IConfig::RegisterCallback使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IConfig
的用法示例。
在下文中一共展示了IConfig::RegisterCallback方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void CFriends::Init(bool Foes)
{
CALLSTACK_ADD();
m_Foes = Foes;
IConfig *pConfig = Kernel()->RequestInterface<IConfig>();
if(pConfig)
pConfig->RegisterCallback(ConfigSaveCallback, this);
IConsole *pConsole = Kernel()->RequestInterface<IConsole>();
if(pConsole)
{
if(Foes)
{
pConsole->Register("add_foe", "s[name] ?s[clan]", CFGFLAG_CLIENT, ConAddFriend, this, "Add a foe");
pConsole->Register("remove_foe", "s[name] ?s[clan]", CFGFLAG_CLIENT, ConRemoveFriend, this, "Remove a foe");
pConsole->Register("foes", "", CFGFLAG_CLIENT, ConFriends, this, "List foes");
}
else
{
pConsole->Register("add_friend", "s[name] ?s[clan]", CFGFLAG_CLIENT, ConAddFriend, this, "Add a friend");
pConsole->Register("remove_friend", "s[name] ?s[clan]", CFGFLAG_CLIENT, ConRemoveFriend, this, "Remove a friend");
pConsole->Register("friends", "", CFGFLAG_CLIENT, ConFriends, this, "List friends");
}
}
}
示例2: SetBaseInfo
void CServerBrowser::SetBaseInfo(class CNetClient *pClient, const char *pNetVersion)
{
m_pNetClient = pClient;
str_copy(m_aNetVersion, pNetVersion, sizeof(m_aNetVersion));
m_pMasterServer = Kernel()->RequestInterface<IMasterServer>();
IConfig *pConfig = Kernel()->RequestInterface<IConfig>();
if(pConfig)
pConfig->RegisterCallback(ConfigSaveCallback, this);
}
示例3: Init
void CLua::Init()
{
IConfig *pConfig = Kernel()->RequestInterface<IConfig>();
if(pConfig)
pConfig->RegisterCallback(ConfigSaveCallback, this);
IConsole *pConsole = Kernel()->RequestInterface<IConsole>();
if(pConsole)
{
pConsole->Register("add_lua_file", "s", CFGFLAG_CLIENT, ConAddLuaFile, this, "Add a Lua file");
}
}
示例4: Init
void CFriends::Init()
{
IConfig *pConfig = Kernel()->RequestInterface<IConfig>();
if(pConfig)
pConfig->RegisterCallback(ConfigSaveCallback, this);
IConsole *pConsole = Kernel()->RequestInterface<IConsole>();
if(pConsole)
{
pConsole->Register("add_friend", "ss", CFGFLAG_CLIENT, ConAddFriend, this, "Add a friend");
pConsole->Register("remove_Friend", "ss", CFGFLAG_CLIENT, ConRemoveFriend, this, "Remove a friend");
}
}
示例5: OnConsoleInit
void CBinds::OnConsoleInit()
{
// bindings
IConfig *pConfig = Kernel()->RequestInterface<IConfig>();
if(pConfig)
pConfig->RegisterCallback(ConfigSaveCallback, this);
Console()->Register("bind", "sr", CFGFLAG_CLIENT, ConBind, this, "Bind key to execute the command");
Console()->Register("unbind", "s", CFGFLAG_CLIENT, ConUnbind, this, "Unbind key");
Console()->Register("unbindall", "", CFGFLAG_CLIENT, ConUnbindAll, this, "Unbind all keys");
Console()->Register("dump_binds", "", CFGFLAG_CLIENT, ConDumpBinds, this, "Dump binds");
// default bindings
SetDefaults();
}