Пример #1
0
// Called when VOIP playback is toggled - pass stop/start to server
static void S_Voip_Play_Callback (cvar_t *var, char *string, qbool *cancel)
{
	if (cls.fteprotocolextensions2 & FTE_PEXT2_VOICECHAT) {
		if (atoi (string))
			CL_SendClientCommand (true, "unmuteall");
		else
			CL_SendClientCommand (true, "muteall");
	}
}
Пример #2
0
// FIXME: make sexy GUI instead!
void Qtvusers_f (void)
{
	qtvuser_t *current;
	int c;

	if (cls.state == ca_disconnected)
	{
		Com_Printf ("Can't \"%s\", not connected\n", Cmd_Argv(0));
		return;
	}

	if (cls.mvdplayback != QTV_PLAYBACK)
	{
		CL_SendClientCommand(true, "%s %s", Cmd_Argv(0), Cmd_Args());
		return;
	}

	c = 0;
	Com_Printf ("userid name\n");
	Com_Printf ("------ ----\n");

	for (current = qtvuserlist; current; current = current->next)
	{
		Com_Printf ("%6i %s\n", current->id, current->name);
		c++;
	}

	Com_Printf ("%i total users\n", c);
}
Пример #3
0
// Add to the ignore list
void S_Voip_Ignore (unsigned int slot, qbool ignore)
{
	if (cls.fteprotocolextensions2 & FTE_PEXT2_VOICECHAT) {
		CL_SendClientCommand (true, "vignore %i %i", slot, ignore);
	}
}
Пример #4
0
void CL_Say_f (void)
{
	char output[8192];
	char string[256];
	char *msg;
	int c;
	output[0] = '\0';
	if (cls.state == ca_disconnected || cls.demoplayback)
	{
#ifndef CLIENT_ONLY
		if (sv.state)
			SV_ConSay_f();
		else
#endif
			Con_TPrintf ("Can't \"%s\", not connected\n", Cmd_Argv(0));
		return;
	}

	if (!strcmp("sayone", Cmd_Argv(0)))
	{
		if (strcmp(Info_ValueForKey(cl.serverinfo, "*distrib"), DISTRIBUTION) || atoi(Info_ValueForKey(cl.serverinfo, "*ver")) < PRE_SAYONE)
		{
			Con_Printf ("%s is only available with server support\n", Cmd_Argv(0));
			return;
		}
	}

	Q_strncpyz(output, Cmd_Argv(0), sizeof(string));
	for (msg = output; *msg; msg++)
		if (*msg >= 'A' && *msg <= 'Z')
			*msg = *msg - 'A' + 'a';

	msg = Cmd_Args();

	if (Cmd_Argc() > 1)
	{
		Q_strncatz(output, " \"", sizeof(output));

		while(*msg)
		{
			c = *msg;

			if (c == '%')
			{
				char *message = NULL;
				msg++;

				if (message == NULL)
				switch(*msg)
				{
				case 'n':
					Q_strncatz(output, name.string, sizeof(output));
					msg++;
					continue;
				case 'h':
					Q_strncatz(output, va("%i", cl.stats[0][STAT_HEALTH]), sizeof(output));
					msg++;
					continue;
				case 'a':
					Q_strncatz(output, va("%i", cl.stats[0][STAT_ARMOR]), sizeof(output));
					msg++;
					continue;
				case 'A':
					Q_strncatz(output, TP_ArmourType(), sizeof(output));
					msg++;
					continue;
				case 'l':
					Q_strncatz(output, CL_LocationName(cl.simorg[0]), sizeof(output));
					msg++;
					continue;
				case 'S':
					Q_strncatz(output, TP_ClassForTFSkin(), sizeof(output));
					msg++;
					continue;
				case '%':
					c  = '%';
					break;
				default:
					c  = '%';
					msg--;
					break;
				}
			}
			else if (c == '$')
			{
				msg++;
				switch(*msg)
				{
				case '\\': c = 0x0D; break;
				case ':': c = 0x0A; break;
				case '[': c = 0x10; break;
				case ']': c = 0x11; break;
				case 'G': c = 0x86; break;
				case 'R': c = 0x87; break;
				case 'Y': c = 0x88; break;
				case 'B': c = 0x89; break;
				case '(': c = 0x80; break;
				case '=': c = 0x81; break;
				case ')': c = 0x82; break;
				case 'a': c = 0x83; break;
				case '<': c = 0x1d; break;
				case '-': c = 0x1e; break;
				case '>': c = 0x1f; break;
				case ',': c = 0x1c; break;
				case '.': c = 0x9c; break;
				case 'b': c = 0x8b; break;
				case 'c':
				case 'd': c = 0x8d; break;
				case '$': c = '$'; break;
				case '^': c = '^'; break;
				case 'x':
					c = INVIS_CHAR1;
					break;
				case 'y':
					c = INVIS_CHAR2;
					break;
				case 'z':
					c = INVIS_CHAR3;
					break;
				default:
					msg--;
					break;
				}

			}
		
			Q_strncatz(output, va("%c", c), sizeof(output));

			msg++;
		}
		Q_strncatz(output, "\"", sizeof(output));
	}

	CL_SendClientCommand("%s", output);
}