示例#1
0
void QTV_Say_f (void)
{
	tokenizecontext_t tmpcontext;

	// save context, so we can later restore it
	Cmd_SaveContext(&tmpcontext);

	// in our last tests, this check was not necessary
	// and even lead to issues
	// so we are disabling it temporarily to see if everything works ok without it
#if 0
	// get rid of quotes, if any
	char *s = Cmd_Args();
	if (0 && s[0] == '\"' && s[(len = strlen(s))-1] == '\"' && len > 2)
	{
		int len;
		char text[1024] = {0};
		snprintf(text, sizeof(text), "%s %s", Cmd_Argv(0), s + 1);
		if ((len = strlen(text)))
			text[len - 1] = 0;
		Cmd_TokenizeString(text);
	}
#endif

	QTV_ForwardToServerEx (true, true);

	// restore
	Cmd_RestoreContext(&tmpcontext);
}
示例#2
0
void QTV_Cmd_Printf(int qtv_ext, char *fmt, ...)
{
	va_list argptr;
	char msg[1024] = {0};
	tokenizecontext_t tmpcontext;

	if (cls.mvdplayback != QTV_PLAYBACK || (qtv_ext & cls.qtv_ezquake_ext) != qtv_ext)
		return; // no point for this, since it not qtv playback or qtv server do not support it

	va_start (argptr, fmt);
	vsnprintf (msg, sizeof(msg), fmt, argptr);
	va_end (argptr);

	// save context, so we can later restore it
	Cmd_SaveContext(&tmpcontext);

	Cmd_TokenizeString(msg);
	QTV_Cmd_ForwardToServer ();

	// restore
	Cmd_RestoreContext(&tmpcontext);
}
示例#3
0
文件: qtv.c 项目: jogi1/camquake
void QTV_Say_f (void)
{
    char *s = Cmd_Args();
    char text[1024] = {0};
    int len;
    tokenizecontext_t tmpcontext;

    // save context, so we can later restore it
    Cmd_SaveContext(&tmpcontext);

    // get rid of quotes, if any
    if (s[0] == '\"' && s[(len = strlen(s))-1] == '\"' && len > 2)
    {
        snprintf(text, sizeof(text), "%s %s", Cmd_Argv(0), s + 1);
        if ((len = strlen(text)))
            text[len - 1] = 0;
        Cmd_TokenizeString(text);
    }

    QTV_ForwardToServerEx (true, true);

    // restore
    Cmd_RestoreContext(&tmpcontext);
}