本文整理汇总了C++中game_import_t::Cvar_Set方法的典型用法代码示例。如果您正苦于以下问题:C++ game_import_t::Cvar_Set方法的具体用法?C++ game_import_t::Cvar_Set怎么用?C++ game_import_t::Cvar_Set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类game_import_t
的用法示例。
在下文中一共展示了game_import_t::Cvar_Set方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckNeedPass
/**
* @brief If password has changed, update sv_needpass cvar as needed
*/
static void CheckNeedPass (void)
{
if (password->modified) {
password->modified = false;
const int need = Q_strvalid(password->string) && Q_strcasecmp(password->string, "none") ? 1 : 0;
gi.Cvar_Set("sv_needpass", "%i", need);
}
}
示例2: CheckNeedPass
/**
* @brief If password has changed, update sv_needpass cvar as needed
*/
static void CheckNeedPass (void)
{
if (password->modified) {
const char *need = "0";
password->modified = false;
if (password->string[0] != '\0' && Q_strcasecmp(password->string, "none"))
need = "1";
gi.Cvar_Set("sv_needpass", need);
}
}
示例3: G_RunFrame
/**
* @sa SV_RunGameFrame
* @sa G_MatchEndTrigger
* @sa AI_Run
* @return true if game reaches its end - false otherwise
*/
static bool G_RunFrame (void)
{
level.framenum++;
/* server is running at 10 fps */
level.time = level.framenum * SERVER_FRAME_SECONDS;
/* this doesn't belong here, but it works */
if (!level.routed) {
level.routed = true;
G_CompleteRecalcRouting();
}
/* still waiting for other players */
if (!G_MatchIsRunning()) {
if (sv_maxteams->modified) {
/* inform the client */
gi.ConfigString(CS_MAXTEAMS, "%i", sv_maxteams->integer);
sv_maxteams->modified = false;
}
}
if (G_IsMultiPlayer()) {
if (sv_roundtimelimit->modified) {
/* some played around here - restart the count down */
level.roundstartTime = level.time;
/* don't allow smaller values here */
if (sv_roundtimelimit->integer < 30 && sv_roundtimelimit->integer > 0) {
gi.DPrintf("The minimum value for sv_roundtimelimit is 30\n");
gi.Cvar_Set("sv_roundtimelimit", "30");
}
sv_roundtimelimit->modified = false;
}
G_CheckForceEndRound();
}
/* end this game? */
if (G_MatchDoEnd())
return true;
CheckNeedPass();
/* run ai */
AI_Run();
/* not all teams are spawned or game has already ended */
if (G_MatchIsRunning())
G_EdictsThink();
G_SendBoundingBoxes();
return false;
}