==> Synchronizing chroot copy [/home/leming/armv8/root] -> [leming]...done
==> Making package: quake 1.36.0-3 (Thu Sep 10 18:06:15 2026)
==> Retrieving sources...
  -> Found vkquake-1.36.0.tar.gz
  -> Found librequake-0.09-beta.zip
==> WARNING: Skipping verification of source file PGP signatures.
==> Validating source files with b2sums...
    vkquake-1.36.0.tar.gz ... Passed
    librequake-0.09-beta.zip ... Passed
==> Making package: quake 1.36.0-3 (Fri Sep 11 00:06:18 2026)
==> Checking runtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...

Packages (34) alsa-lib-1.2.16.1-1  alsa-topology-conf-1.2.5.1-4  alsa-ucm-conf-1.2.16.1-1  default-cursors-3-1  hidapi-0.15.0-1  libdrm-2.4.134-1  libedit-20260512_3.1-1  libglvnd-1.7.0-3  libogg-1.3.6-1  libpciaccess-0.19-1  libx11-1.8.13-1  libxau-1.0.12-1  libxcb-1.17.0-1  libxcursor-1.2.3-1  libxdmcp-1.1.5-2  libxext-1.3.7-1  libxfixes-6.0.2-1  libxrender-0.9.12-1  libxshmfence-1.3.3-1  libxxf86vm-1.1.7-1  llvm-libs-22.1.8-2  lm_sensors-1:3.6.2-1  mesa-1:26.2.2-1  opus-1.6.1-1  spirv-tools-1:1.4.357.0-1  wayland-1.26.0-1  xcb-proto-1.17.0-4  xorgproto-2025.1-1  flac-1.5.0-1  libvorbis-1.3.7-4  mpg123-1.33.7-1  opusfile-0.12-4  sdl3-3.4.16-1  vulkan-icd-loader-1.4.357.0-1

Total Download Size:     0.06 MiB
Total Installed Size:  283.25 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 opusfile-0.12-4-aarch64 downloading...
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
installing libogg...
installing flac...
installing libvorbis...
installing alsa-topology-conf...
installing alsa-ucm-conf...
installing alsa-lib...
installing mpg123...
Optional dependencies for mpg123
    sdl2-compat: for sdl audio support
    jack: for jack audio support
    libpulse: for pulse audio support
    perl: for conplay [installed]
installing opus...
installing opusfile...
installing xcb-proto...
installing xorgproto...
installing libxdmcp...
installing libxau...
installing libxcb...
installing libx11...
installing libxext...
installing libxrender...
installing libpciaccess...
installing libdrm...
Optional dependencies for libdrm
    cairo: needed for modetest tool
installing libxshmfence...
installing libxxf86vm...
installing libedit...
installing llvm-libs...
installing lm_sensors...
Optional dependencies for lm_sensors
    rrdtool: for logging with sensord
    perl: for sensor detection and configuration convert [installed]
installing spirv-tools...
installing default-cursors...
Optional dependencies for default-cursors
    adwaita-cursors: default cursor theme
installing wayland...
installing mesa...
Optional dependencies for mesa
    opengl-man-pages: for the OpenGL API man pages
installing libglvnd...
installing libxfixes...
installing libxcursor...
installing hidapi...
Optional dependencies for hidapi
    libusb: for hidapi-libusb [installed]
installing sdl3...
Optional dependencies for sdl3
    alsa-lib: ALSA audio driver [installed]
    libpulse: PulseAudio audio driver
    jack: JACK audio driver
    pipewire: PipeWire audio driver
    vulkan-driver: vulkan renderer
    sndio: sndio audio driver
    libdecor: Wayland client decorations
installing vulkan-icd-loader...
Optional dependencies for vulkan-icd-loader
    vulkan-driver: packaged vulkan driver
:: Running post-transaction hooks...
(1/2) Reloading system manager configuration...
  Skipped: Current root is not booted.
(2/2) Arming ConditionNeedsUpdate...
==> Checking buildtime dependencies...
==> Installing missing dependencies...
resolving dependencies...
looking for conflicting packages...

Packages (7) ninja-1.13.2-3  python-tqdm-4.70.0-1  gendesk-1.0.15-1  glslang-1:1.4.357.0-1  meson-1.12.0-1  vulkan-headers-1:1.4.357.0-1  vulkan-validation-layers-1.4.357.0-1

Total Download Size:     9.64 MiB
Total Installed Size:  114.17 MiB

:: Proceed with installation? [Y/n] 
:: Retrieving packages...
 vulkan-validation-layers-1.4.357.0-1-aarch64 downloading...
 gendesk-1.0.15-1-aarch64 downloading...
checking keyring...
checking package integrity...
loading package files...
checking for file conflicts...
checking available disk space...
:: Processing package changes...
installing gendesk...
installing glslang...
installing ninja...
installing python-tqdm...
Optional dependencies for python-tqdm
    python-requests: telegram
installing meson...
installing vulkan-headers...
Optional dependencies for vulkan-headers
    python: Registry tools [installed]
installing vulkan-validation-layers...
:: Running post-transaction hooks...
(1/1) Arming ConditionNeedsUpdate...
==> Retrieving sources...
  -> Found vkquake-1.36.0.tar.gz
  -> Found librequake-0.09-beta.zip
==> WARNING: Skipping all source file integrity checks.
==> Extracting sources...
  -> Extracting vkquake-1.36.0.tar.gz with bsdtar
  -> Extracting librequake-0.09-beta.zip with bsdtar
==> Starting prepare()...
[quake]                           Generating desktop file... Games is an unrecognized category
ok
/*
Copyright (C) 1996-2001 Id Software, Inc.
Copyright (C) 2002-2009 John Fitzgibbons and others
Copyright (C) 2007-2008 Kristian Duske
Copyright (C) 2010-2014 QuakeSpasm developers

This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; either version 2
of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.

*/

#include "quakedef.h"
#include "q_ctype.h"
#include "json.h"
#include <sys/stat.h>
#ifndef _WIN32
#include <dirent.h>
#include <ctype.h>
#else
#include <windows.h>
#endif

extern cvar_t pausable;
extern cvar_t nomonsters;
extern cvar_t autoload;
extern cvar_t autofastload;
extern cvar_t cl_topcolor;
extern cvar_t cl_bottomcolor;

int current_skill;

void Mod_Print (void);

#define MIN_BSP_MAP_SIZE (32 * 1024)

/*
==================
Host_Quit_f
==================
*/
void Host_Quit_f (void)
{
	if (key_dest != key_console && cls.state != ca_dedicated)
	{
		M_Menu_Quit_f ();
		return;
	}
	CL_Disconnect ();
	Host_ShutdownServer (false);

	Sys_Quit ();
}

//==============================================================================
// johnfitz -- extramaps management
//==============================================================================

/*
==================
FileList_AddEx

Like FileList_Add, but allocates extrabytes of zeroed payload behind the
item and returns it (also when the name was already in the list)
==================
*/
static filelist_item_t *FileList_AddEx (const char *name, size_t extrabytes, filelist_item_t **list)
{
	filelist_item_t *item, *cursor, *prev;

	// return existing entry for duplicates
	for (item = *list; item; item = item->next)
	{
		if (!strcmp (name, item->name))
			return item;
	}

	item = (filelist_item_t *)Mem_Alloc (sizeof (filelist_item_t) + extrabytes);
	q_strlcpy (item->name, name, sizeof (item->name));

	// insert each entry in alphabetical order
	if (*list == NULL || q_strcasecmp (item->name, (*list)->name) < 0) // insert at front
	{
		item->next = *list;
		*list = item;
	}
	else // insert later
	{
		prev = *list;
		cursor = (*list)->next;
		while (cursor && (q_strcasecmp (item->name, cursor->name) > 0))
		{
			prev = cursor;
			cursor = cursor->next;
		}
		item->next = prev->next;
		prev->next = item;
	}

	return item;
}

/*
==================
FileList_Add
==================
*/
static void FileList_Add (const char *name, filelist_item_t **list)
{
	FileList_AddEx (name, 0, list);
}

static void FileList_Clear (filelist_item_t **list)
{
	filelist_item_t *blah;

	while (*list)
	{
		blah = (*list)->next;
		Mem_Free (*list);
		*list = blah;
	}
}

static void FileList_Init (char *path, char *ext, filelist_item_t **list)
{
	char		  filestring[MAX_OSPATH];
	char		  filename[32];
	findfile_t	 *find;
	searchpath_t *search;
	searchpath_t  legacy_saves;
	qboolean	  have_legacy_saves = !strcmp (ext, "sav") && COM_GetLegacySaveDir (legacy_saves.filename, sizeof (legacy_saves.filename));

	legacy_saves.next = com_searchpaths;

	for (search = have_legacy_saves ? &legacy_saves : com_searchpaths; search; search = search->next)
	{
		if (*search->filename) // directory
		{
			q_snprintf (filestring, sizeof (filestring), "%s/%s", search->filename, path);
			for (find = Sys_FindFirst (filestring, ext); find; find = Sys_FindNext (find))
			{
				if (find->attribs & FA_DIRECTORY)
					continue;
				COM_StripExtension (find->name, filename, sizeof (filename));
				FileList_Add (filename, list);
			}
			if (!strcmp (ext, "sav") && search != &legacy_saves) // legacy saves, then only the active game directory
				break;
		}
	}
}

/*
==================
RightPad
==================
*/
static const char *RightPad (const char *str, size_t minlen, char c)
{
	static char buf[1024];
	size_t		len = strlen (str);

	minlen = q_min (minlen, sizeof (buf) - 1);
	if (len >= minlen)
		return str;

	memcpy (buf, str, len);
	for (; len < minlen; len++)
		buf[len] = c;
	buf[len] = '\0';

	return buf;
}

filelist_item_t	 *extralevels;
filelist_item_t **extralevels_sorted;
static size_t	  maxlevelnamelen;

static SDL_Thread	  *extralevels_parsing_thread;
static atomic_uint32_t extralevels_cancel_parsing;

/*
==================
ExtraMaps_Categorize
==================
*/
static maptype_t ExtraMaps_Categorize (const char *name, const searchpath_t *source)
{
	size_t	  len = strlen (name);
	maptype_t base;
	qboolean  is_start, is_end, is_dm;

	if (!source)
	{
		switch (name[0])
		{
		case 'd':
			if (name[1] == 'm')
				return MAPTYPE_ID_DM;
			break;
		case 's':
			if (!strcmp (name + 1, "tart"))
				return MAPTYPE_ID_START;
			break;
		case 'e':
			if (name[1] >= '1' && name[1] <= '4')
				return MAPTYPE_ID_EP1_LEVEL + (name[1] - '1');
			if (!strcmp (name + 1, "nd"))
				return MAPTYPE_ID_END;
			break;
		default:
			break;
		}
		return MAPTYPE_ID_LEVEL;
	}

	is_start = (len >= 5 && (!memcmp (name + len - 5, "start", 5) || !memcmp (name, "start", 5) || !memcmp (name + len - 5, "intro", 5)));
	is_end = (len >= 3 && !memcmp (name + len - 3, "end", 3));
	while (len > 0 && (unsigned int)(name[len - 1] - '0') <= 9)
		len--;
	is_dm = (len >= 2 && !memcmp (name + len - 2, "dm", 2));

	if (source->path_id != com_searchpaths->path_id)
	{
		if (is_start)
			return MAPTYPE_CUSTOM_ID_START;
		if (is_end)
			return MAPTYPE_CUSTOM_ID_END;
		if (is_dm)
			return MAPTYPE_CUSTOM_ID_DM;
		return MAPTYPE_CUSTOM_ID_LEVEL;
	}

	base = *source->filename ? MAPTYPE_CUSTOM_MOD_START : MAPTYPE_MOD_START;
	if (is_start)
		return base + MAPTYPE_CUSTOM_MOD_START;
	if (is_end)
		return base + MAPTYPE_CUSTOM_MOD_END;
	if (is_dm)
		return base + MAPTYPE_CUSTOM_MOD_DM;
	return base + MAPTYPE_CUSTOM_MOD_LEVEL;
}

typedef struct levelinfo_s
{
	atomic_uint32_t type;
	atomic_ptr_t	message;
} levelinfo_t;

/*
==================
ExtraMaps_GetInfo
==================
*/
static const levelinfo_t *ExtraMaps_GetInfo (const filelist_item_t *item)
{
	return (const levelinfo_t *)(item + 1);
}

/*
==================
ExtraMaps_GetType
==================
*/
maptype_t ExtraMaps_GetType (const filelist_item_t *item)
{
	const levelinfo_t *info = ExtraMaps_GetInfo (item);
	return Atomic_LoadUInt32 ((atomic_uint32_t *)&info->type);
}

/*
==================
ExtraMaps_GetMessage
==================
*/
const char *ExtraMaps_GetMessage (const filelist_item_t *item)
{
	const levelinfo_t *info = ExtraMaps_GetInfo (item);
	return (const char *)Atomic_LoadPtr ((atomic_ptr_t *)&info->message);
}

/*
==================
ExtraMaps_IsStart
==================
*/
qboolean ExtraMaps_IsStart (maptype_t type)
{
	return type == MAPTYPE_CUSTOM_MOD_START || type == MAPTYPE_MOD_START || type == MAPTYPE_CUSTOM_ID_START || type == MAPTYPE_ID_START;
}

/*
==================
ExtraMaps_Sort
==================
*/
static void ExtraMaps_Sort (void)
{
	int				 counts[MAPTYPE_COUNT];
	int				 i, sum;
	filelist_item_t *item;

	memset (counts, 0, sizeof (counts));
	for (item = extralevels; item; item = item->next)
		counts[ExtraMaps_GetType (item)]++;

	for (i = sum = 0; i < MAPTYPE_COUNT; i++)
	{
		int tmp = counts[i];
		counts[i] = sum;
		sum += tmp;
	}
	sum++; // NULL terminator

	extralevels_sorted = (filelist_item_t **)Mem_Realloc (extralevels_sorted, sizeof (*extralevels_sorted) * sum);

	for (item = extralevels; item; item = item->next)
		extralevels_sorted[counts[ExtraMaps_GetType (item)]++] = item;
	extralevels_sorted[sum - 1] = NULL;
}

/*
==================
ExtraMaps_Add
==================
*/
static void ExtraMaps_Add (const char *name, const searchpath_t *source)
{
	filelist_item_t *item;
	levelinfo_t		*info;

	// ignore duplicates so the first (highest priority) searchpath determines the type
	for (item = extralevels; item; item = item->next)
		if (!strcmp (name, item->name))
			return;

	item = FileList_AddEx (name, sizeof (levelinfo_t), &extralevels);
	info = (levelinfo_t *)(item + 1);
	Atomic_StoreUInt32 (&info->type, ExtraMaps_Categorize (name, source));
	maxlevelnamelen = q_max (maxlevelnamelen, strlen (name));
}

/*
==================
ExtraMaps_ParseDescriptions
==================
*/
static int ExtraMaps_ParseDescriptions (void *unused)
{
	char buf[1024];
	int	 i;

	for (i = 0; extralevels_sorted[i]; i++)
	{
		filelist_item_t *item = extralevels_sorted[i];
		levelinfo_t		*info = (levelinfo_t *)(item + 1);
		char			*message = NULL;

		if (Atomic_LoadUInt32 (&extralevels_cancel_parsing))
			return 1;

		if (!Mod_LoadMapDescription (buf, sizeof (buf), item->name))
			Atomic_StoreUInt32 (&info->type, MAPTYPE_BMODEL);
		if (buf[0])
		{
			message = (char *)Mem_Alloc (strlen (buf) + 1);
			strcpy (message, buf);
		}
		Atomic_StorePtr (&info->message, message ? message : (char *)"");
	}

	return 0;
}

/*
==================
ExtraMaps_WaitForParsingThread
==================
*/
static void ExtraMaps_WaitForParsingThread (void)
{
	if (extralevels_parsing_thread)
	{
		SDL_WaitThread (extralevels_parsing_thread, NULL);
		extralevels_parsing_thread = NULL;
		Atomic_StoreUInt32 (&extralevels_cancel_parsing, 0);
	}
}

/*
==================
ExtraMaps_Init
==================
*/
void ExtraMaps_Init (void)
{
	char		  mapname[32];
	char		  ignorepakdir[32];
	searchpath_t *search;
	pack_t		 *pak;
	int			  i;

	// we don't want the maps in the id1 pakfiles to be
	// categorized as custom levels
	q_snprintf (ignorepakdir, sizeof (ignorepakdir), "/%s/", GAMENAME);

	for (search = com_searchpaths; search; search = search->next)
	{
		if (*search->filename) // directory
		{
			char		dir[MAX_OSPATH];
			findfile_t *find;

			q_snprintf (dir, sizeof (dir), "%s/maps", search->filename);
			for (find = Sys_FindFirst (dir, "bsp"); find; find = Sys_FindNext (find))
			{
				if (find->attribs & FA_DIRECTORY)
					continue;
				COM_StripExtension (find->name, mapname, sizeof (mapname));
				ExtraMaps_Add (mapname, search);
			}
		}
		else // pakfile
		{
			qboolean isbase = (strstr (search->pack->filename, ignorepakdir) != NULL);
			for (i = 0, pak = search->pack; i < pak->numfiles; i++)
			{
				if (pak->files[i].filelen > MIN_BSP_MAP_SIZE &&	 // don't list files under 32k (ammo boxes etc)
					!strncmp (pak->files[i].name, "maps/", 5) && // don't list files outside of maps/
					!strchr (pak->files[i].name + 5, '/') &&	 // don't list files in subdirectories
					!strcmp (COM_FileGetExtension (pak->files[i].name), "bsp"))
				{
					COM_StripExtension (pak->files[i].name + 5, mapname, sizeof (mapname));
					ExtraMaps_Add (mapname, isbase ? NULL : search);
				}
			}
		}
	}

	ExtraMaps_Sort ();

	Atomic_StoreUInt32 (&extralevels_cancel_parsing, 0);
	extralevels_parsing_thread = SDL_CreateThread (ExtraMaps_ParseDescriptions, "Map parser", NULL);
}

/*
==================
ExtraMaps_Clear
==================
*/
void ExtraMaps_Clear (void)
{
	filelist_item_t *item;

	Atomic_StoreUInt32 (&extralevels_cancel_parsing, 1);
	ExtraMaps_WaitForParsingThread ();

	maxlevelnamelen = 0;
	for (item = extralevels; item; item = item->next)
	{
		levelinfo_t *info = (levelinfo_t *)(item + 1);
		char		*message = (char *)Atomic_LoadPtr (&info->message);
		if (message && *message)
			Mem_Free (message);
	}

	FileList_Clear (&extralevels);
}

/*
==================
ExtraMaps_ShutDown
==================
*/
void ExtraMaps_ShutDown (void)
{
	ExtraMaps_Clear ();
}

void ExtraMaps_NewGame (void)
{
	ExtraMaps_Clear ();
	ExtraMaps_Init ();
}

/*
==================
Host_Maps_f
==================
*/
static void Host_Maps_f (void)
{
	int				 i;
	filelist_item_t *item;
	const char		*desc;
	const char		*substr = Cmd_Argc () >= 2 ? Cmd_Argv (1) : NULL;
	char			 buf[256], buf2[256];
	char			 padchar = '.' - 0x80; // same bits as ('.' | 0x80) without truncating a constant
	size_t			 ofsdesc = maxlevelnamelen + 2;

	for (item = extralevels, i = 0; item; item = item->next)
	{
		if (ExtraMaps_GetType (item) >= MAPTYPE_ID_START)
			continue;
		desc = ExtraMaps_GetMessage (item);
		if (!desc)
			desc = "";
		if (substr && *substr)
		{
			if (!q_strcasestr (item->name, substr) && !q_strcasestr (desc, substr))
				continue;
			const char *tinted_name = COM_TintSubstring (item->name, substr, buf, sizeof (buf));
			const char *tinted_desc = COM_TintSubstring (desc, substr, buf2, sizeof (buf2));
			if (*desc)
				Con_SafePrintf ("   %s%c%s\n", RightPad (tinted_name, ofsdesc, padchar), padchar, tinted_desc);
			else
				Con_SafePrintf ("   %s\n", tinted_name);
		}
		else
		{
			if (*desc)
				Con_SafePrintf ("   %s%c%s\n", RightPad (item->name, ofsdesc, padchar), padchar, desc);
			else
				Con_SafePrintf ("   %s\n", item->name);
		}
		i++;
	}

	if (substr && *substr)
	{
		if (i)
			Con_SafePrintf ("%i map%s containing \"%s\"\n", i, i == 1 ? "" : "s", substr);
		else
			Con_SafePrintf ("no maps found containing \"%s\"\n", substr);
	}
	else
	{
		if (i)
			Con_SafePrintf ("%i map%s\n", i, i == 1 ? "" : "s");
		else
			Con_SafePrintf ("no maps found\n");
	}
}

//==============================================================================
// johnfitz -- modlist management
//==============================================================================

filelist_item_t *modlist;

typedef struct modinfo_s
{
	char full_name[64]; // friendly display name, empty if unknown
} modinfo_t;

// friendly names for well-known game dirs without metadata of their own (from Ironwail)
// clang-format off
static const char *const knownmods[][2] = {
	{"id1",			"Quake"},
	{"hipnotic",	"Scourge of Armagon"},
	{"rogue",		"Dissolution of Eternity"},
	{"dopa",		"Dimension of the Past"},
	{"mg1",			"Dimension of the Machine"},
	{"mg3",			"Dawn of the Machine"},
	{"q64",			"Quake (Nintendo 64)"},
	{"ctf",			"Capture The Flag"},
	{"udob",		"Underdark Overbright"},
	{"ad",			"Arcane Dimensions"},
};
// clang-format on

/*
==================
Modlist_GetFullName

Returns the friendly display name for a mod list entry, or NULL
==================
*/
const char *Modlist_GetFullName (const filelist_item_t *item)
{
	const modinfo_t *info = (const modinfo_t *)(item + 1);
	size_t			 i;

	if (info->full_name[0])
	{
		// the rerelease mapdb.json uses localization keys like $m_quake; resolve
		// them here since the loc files aren't loaded yet when the list is built
		if (info->full_name[0] == '$')
		{
			const char *value = LOC_GetRawString (info->full_name);
			if (value)
				return value;
		}
		else
			return info->full_name;
	}
	for (i = 0; i < countof (knownmods); i++)
		if (!q_strcasecmp (item->name, knownmods[i][0]))
			return knownmods[i][1];
	return NULL;
}

/*
==================
Modlist_SetNameFromMapDB

Takes the display name from a mapdb.json episode list (from Ironwail).
Base files describe several episodes, so the dir has to match; the same
goes for Copper to avoid naming every Copper-based mod "Underdark
Overbright" when it ships Copper's mapdb.json unmodified.
==================
*/
static void Modlist_SetNameFromMapDB (modinfo_t *info, const char *mapdb, const char *name, qboolean is_base)
{
	json_t *json = JSON_Parse (mapdb);
	if (!json)
		return;

	const jsonentry_t *episodes = JSON_Find (json->root, "episodes", JSON_ARRAY);
	if (episodes)
	{
		const jsonentry_t *entry;
		for (entry = episodes->firstchild; entry; entry = entry->next)
		{
			const char *mod_name = JSON_FindString (entry, "name");
			const char *mod_dir = JSON_FindString (entry, "dir");
			if (!mod_name || !mod_dir)
				continue;
			if ((is_base || !q_strcasecmp (mod_dir, "copper")) && q_strcasecmp (mod_dir, name) != 0)
				continue;
			q_strlcpy (info->full_name, mod_name, sizeof (info->full_name));
			break;
		}
	}
	JSON_Free (json);
}

static void Modlist_Add (const char *base, const char *name)
{
	if ((strlen (name) == 3) && (q_tolower (name[0]) == 'i') && (q_tolower (name[1]) == 'd') && (name[2] == '1'))
		return;
	if (COM_ModForbiddenChars (name))
		return;
	char path[MAX_OSPATH];
	q_snprintf (path, sizeof (path), "%s/%s/pak0.pak", base, name);
	if (Sys_FileType (path) != FS_ENT_FILE)
	{
		q_snprintf (path, sizeof (path), "%s/%s/progs.dat", base, name);
		if (Sys_FileType (path) != FS_ENT_FILE)
		{
			q_snprintf (path, sizeof (path), "%s/%s/csprogs.dat", base, name);
			if (Sys_FileType (path) != FS_ENT_FILE)
			{
				q_snprintf (path, sizeof (path), "%s/%s/maps", base, name);
				if (Sys_FileType (path) != FS_ENT_DIRECTORY)
					return;
			}
		}
	}

	filelist_item_t *item = FileList_AddEx (name, sizeof (modinfo_t), &modlist);
	modinfo_t		*info = (modinfo_t *)(item + 1);

	// use the first non-empty line of a descript.ion file in the mod dir as display name
	if (!info->full_name[0])
	{
		q_snprintf (path, sizeof (path), "%s/%s/descript.ion", base, name);
		char *buf = (char *)COM_LoadMallocFile_TextMode_OSPath (path, NULL);
		if (buf)
		{
			char *description = buf;
			while (q_isspace (*description))
				++description;
			char *end = strchr (description, '\n');
			if (end)
				*end = '\0';
			q_strlcpy (info->full_name, q_strtrim (description), sizeof (info->full_name));
			Mem_Free (buf);
		}
	}

	// otherwise try a loose mapdb.json in the mod dir (Kex add-ons ship one)
	if (!info->full_name[0])
	{
		q_snprintf (path, sizeof (path), "%s/%s/mapdb.json", base, name);
		char *mapdb = (char *)COM_LoadMallocFile_TextMode_OSPath (path, NULL);
		if (mapdb)
		{
			Modlist_SetNameFromMapDB (info, mapdb, name, false);
			Mem_Free (mapdb);
		}
	}
}

static void Modlist_AddRoot (const char *base)
{
	findfile_t *find;

	for (find = Sys_FindFirst (base, NULL); find; find = Sys_FindNext (find))
	{
		if (!(find->attribs & FA_DIRECTORY))
			continue;
		if (!strcmp (find->name, ".") || !strcmp (find->name, ".."))
			continue;
		if (!q_strcasecmp (COM_FileGetExtension (find->name), "app")) // skip .app bundles on macOS
			continue;
		Modlist_Add (base, find->name);
	}
}

/*
==================
Modlist_LoadAddonsJSON

The official rerelease client keeps a catalog of the add-ons it has
downloaded in an addons.json next to them; use it for display names
(their mapdb.json sits inside the pak where the loose-file scan can't see it)
==================
*/
static void Modlist_LoadAddonsJSON (const char *base)
{
	char  path[MAX_OSPATH];
	char *text;

	if ((size_t)q_snprintf (path, sizeof (path), "%s/addons.json", base) >= sizeof (path))
		return;
	text = (char *)COM_LoadMallocFile_TextMode_OSPath (path, NULL);
	if (!text)
		return;

	json_t *json = JSON_Parse (text);
	Mem_Free (text);
	if (!json)
		return;

	const jsonentry_t *addons = JSON_Find (json->root, "addons", JSON_ARRAY);
	if (addons)
	{
		const jsonentry_t *entry;
		for (entry = addons->firstchild; entry; entry = entry->next)
		{
			const char		*gamedir = JSON_FindString (entry, "gamedir");
			const char		*name = JSON_FindString (entry, "name");
			filelist_item_t *item;
			if (!gamedir || !name)
				continue;
			for (item = modlist; item; item = item->next)
			{
				if (!q_strcasecmp (item->name, gamedir))
				{
					modinfo_t *info = (modinfo_t *)(item + 1);
					if (!info->full_name[0])
						q_strlcpy (info->full_name, name, sizeof (info->full_name));
					break;
				}
			}
		}
	}
	JSON_Free (json);
}

void Modlist_Init (void)
{
	filelist_item_t *item;
	unsigned int	 path_id;
	char			*mapdb;
	int				 i;

	for (i = 0; i < com_numbasedirs; i++)
		Modlist_AddRoot (com_basedirs[i]);

	// names from the official client's download catalog
	for (i = 0; i < com_numbasedirs; i++)
		Modlist_LoadAddonsJSON (com_basedirs[i]);

	// the rerelease describes its bundled episodes (hipnotic, rogue, dopa, mg1)
	// in a single mapdb.json inside id1, so look that one up through the searchpath
	mapdb = (char *)COM_LoadFile ("mapdb.json", &path_id);
	if (mapdb)
	{
		// base = the id1 group; only a mapdb.json from an active mod on top of it
		// may name entries without a dir match (e.g. a renamed mod dir)
		qboolean is_base = !com_base_searchpaths || path_id <= com_base_searchpaths->path_id;
		for (item = modlist; item; item = item->next)
		{
			modinfo_t *info = (modinfo_t *)(item + 1);
			if (!info->full_name[0])
				Modlist_SetNameFromMapDB (info, mapdb, item->name, is_base);
		}
		Mem_Free (mapdb);
	}
}

//==============================================================================
// ericw -- demo list management
//==============================================================================

filelist_item_t *demolist;

static void DemoList_Clear (void)
{
	FileList_Clear (&demolist);
}

void DemoList_Rebuild (void)
{
	DemoList_Clear ();
	DemoList_Init ();
}

void DemoList_Init (void)
{
	FileList_Init ("", "dem", &demolist);
}

//==============================================================================
// savegame list management
//==============================================================================

filelist_item_t *savelist;

static void SaveList_Clear (void)
{
	FileList_Clear (&savelist);
}

void SaveList_Rebuild (void)
{
	SaveList_Clear ();
	SaveList_Init ();
}

void SaveList_Init (void)
{
	FileList_Init ("", "sav", &savelist);
}

/*
==================
Host_Mods_f -- johnfitz

list all potential mod directories (contain either a pak file or a progs.dat)
==================
*/
static void Host_Mods_f (void)
{
	int				 i;
	filelist_item_t *mod;

	for (mod = modlist, i = 0; mod; mod = mod->next, i++)
		Con_SafePrintf ("   %s\n", mod->name);

	if (i)
		Con_SafePrintf ("%i mod(s)\n", i);
	else
		Con_SafePrintf ("no mods found\n");
}

//==============================================================================

/*
=============
Host_Mapname_f -- johnfitz
=============
*/
static void Host_Mapname_f (void)
{
	if (sv.active)
	{
		Con_Printf ("\"mapname\" is \"%s\"\n", sv.name);
		return;
	}

	if (cls.state == ca_connected)
	{
		Con_Printf ("\"mapname\" is \"%s\"\n", cl.mapname);
		return;
	}

	Con_Printf ("no map loaded\n");
}

/*
==================
Host_Status_f
==================
*/
static void Host_Status_f (void)
{
	void (*print_fn) (const char *fmt, ...) FUNCP_PRINTF (1, 2);

	client_t *client;
	int		  seconds;
	int		  minutes;
	int		  hours = 0;
	int		  j, i;

	qhostaddr_t addresses[32];
	int			numaddresses;

	if (cmd_source != src_client)
	{
		if (!sv.active)
		{
			Cmd_ForwardToServer ();
			return;
		}
		print_fn = Con_Printf;
	}
	else
		print_fn = SV_ClientPrintf;

	print_fn ("host:    %s\n", Cvar_VariableString ("hostname"));
	print_fn ("version: " ENGINE_NAME_AND_VER "\n");

	numaddresses = NET_ListAddresses (addresses, countof (addresses));
	for (i = 0; i < numaddresses; i++)
	{
		if (*addresses[i] == '[')
			print_fn ("ipv6:    %s\n", addresses[i]); // Spike -- FIXME: we should really have ports displayed here or something
		else
			print_fn ("tcp/ip:  %s\n", addresses[i]); // Spike -- FIXME: we should really have ports displayed here or something
	}
	if (ipv4Available)
		print_fn ("tcp/ip:  %s\n", my_ipv4_address); // Spike -- FIXME: we should really have ports displayed here or something
	if (ipv6Available)
		print_fn ("ipv6:    %s\n", my_ipv6_address);
	if (ipxAvailable)
		print_fn ("ipx:     %s\n", my_ipx_address);
	print_fn ("map:     %s\n", sv.name);
	print_fn ("players: %i active (%i max)\n\n", net_activeconnections, svs.maxclients);
	for (j = 0, client = svs.clients; j < svs.maxclients; j++, client++)
	{
		if (!client->active)
			continue;
		if (client->netconnection)
			seconds = (int)(net_time - NET_QSocketGetTime (client->netconnection));
		else
			seconds = 0;
		minutes = seconds / 60;
		if (minutes)
		{
			seconds -= (minutes * 60);
			hours = minutes / 60;
			if (hours)
				minutes -= (hours * 60);
		}
		else
			hours = 0;
		print_fn ("#%-2u %-16.16s  %3i  %2i:%02i:%02i\n", j + 1, client->name, (int)client->edict->v.frags, hours, minutes, seconds);
		if (cmd_source != src_client)
			print_fn ("   %s\n", client->netconnection ? NET_QSocketGetTrueAddressString (client->netconnection) : "botclient");
		else
			print_fn ("   %s\n", client->netconnection ? NET_QSocketGetMaskedAddressString (client->netconnection) : "botclient");
	}
}

/*
==================
Host_God_f

Sets client to godmode
==================
*/
static void Host_God_f (void)
{
	if (cmd_source != src_client)
	{
		Cmd_ForwardToServer ();
		return;
	}

	if (pr_global_struct->deathmatch)
		return;

	// johnfitz -- allow user to explicitly set god mode to on or off
	switch (Cmd_Argc ())
	{
	case 1:
		sv_player->v.flags = (int)sv_player->v.flags ^ FL_GODMODE;
		if (!((int)sv_player->v.flags & FL_GODMODE))
			SV_ClientPrintf ("godmode OFF\n");
		else
			SV_ClientPrintf ("godmode ON\n");
		break;
	case 2:
		if (atof (Cmd_Argv (1)))
		{
			sv_player->v.flags = (int)sv_player->v.flags | FL_GODMODE;
			SV_ClientPrintf ("godmode ON\n");
		}
		else
		{
			sv_player->v.flags = (int)sv_player->v.flags & ~FL_GODMODE;
			SV_ClientPrintf ("godmode OFF\n");
		}
		break;
	default:
		Con_Printf ("god [value] : toggle god mode. values: 0 = off, 1 = on\n");
		break;
	}
	// johnfitz
}

/*
==================
Host_Notarget_f
==================
*/
static void Host_Notarget_f (void)
{
	if (cmd_source != src_client)
	{
		Cmd_ForwardToServer ();
		return;
	}

	if (pr_global_struct->deathmatch)
		return;

	// johnfitz -- allow user to explicitly set notarget to on or off
	switch (Cmd_Argc ())
	{
	case 1:
		sv_player->v.flags = (int)sv_player->v.flags ^ FL_NOTARGET;
		if (!((int)sv_player->v.flags & FL_NOTARGET))
			SV_ClientPrintf ("notarget OFF\n");
		else
			SV_ClientPrintf ("notarget ON\n");
		break;
	case 2:
		if (atof (Cmd_Argv (1)))
		{
			sv_player->v.flags = (int)sv_player->v.flags | FL_NOTARGET;
			SV_ClientPrintf ("notarget ON\n");
		}
		else
		{
			sv_player->v.flags = (int)sv_player->v.flags & ~FL_NOTARGET;
			SV_ClientPrintf ("notarget OFF\n");
		}
		break;
	default:
		Con_Printf ("notarget [value] : toggle notarget mode. values: 0 = off, 1 = on\n");
		break;
	}
	// johnfitz
}

qboolean noclip_anglehack;

#define NOCLIP_UNSTICK_FINE_RADIUS	  8
#define NOCLIP_UNSTICK_SPHERE_RADIUS  512
#define NOCLIP_UNSTICK_SPHERE_STEP	  8
#define NOCLIP_UNSTICK_SPHERE_SAMPLES 192
#define NOCLIP_UNSTICK_LINE_STEPS	  16

static qboolean Host_Noclip_TestOrigin (edict_t *ent, const vec3_t origin)
{
	vec3_t	 saved;
	qboolean valid;

	VectorCopy (ent->v.origin, saved);
	VectorCopy (origin, ent->v.origin);
	valid = SV_TestEntityPosition (ent) == NULL;
	VectorCopy (saved, ent->v.origin);

	return valid;
}

static float Host_Noclip_DistanceSquared (const vec3_t a, const vec3_t b)
{
	vec3_t delta;

	VectorSubtract (a, b, delta);
	return DotProduct (delta, delta);
}

static qboolean Host_Noclip_SearchFibonacciSphere (edict_t *ent, const vec3_t base, int radius, vec3_t out)
{
	int			i;
	vec3_t		test;
	const float golden_angle = (float)(M_PI * (3.0 - sqrt (5.0)));
	const float inv_samples = 1.0f / NOCLIP_UNSTICK_SPHERE_SAMPLES;

	for (i = 0; i < NOCLIP_UNSTICK_SPHERE_SAMPLES; i++)
	{
		const float y = 1.0f - 2.0f * (i + 0.5f) * inv_samples;
		const float r = sqrt (1.0f - y * y);
		const float theta = golden_angle * i;
		const float x = cos (theta) * r;
		const float z = sin (theta) * r;

		test[0] = base[0] + x * radius;
		test[1] = base[1] + y * radius;
		test[2] = base[2] + z * radius;
		if (Host_Noclip_TestOrigin (ent, test))
		{
			VectorCopy (test, out);
			return true;
		}
	}

	return false;
}

static int Host_Noclip_NextSearchRadius (int radius)
{
	if (radius < NOCLIP_UNSTICK_FINE_RADIUS)
		return radius + 1;
	return radius + NOCLIP_UNSTICK_SPHERE_STEP;
}

static qboolean Host_Noclip_FindNearbyValidOrigin (edict_t *ent, vec3_t out)
{
	int	   radius;
	vec3_t base;

	VectorCopy (ent->v.origin, base);

	if (Host_Noclip_TestOrigin (ent, base))
	{
		VectorCopy (base, out);
		return true;
	}

	for (radius = 1; radius <= NOCLIP_UNSTICK_SPHERE_RADIUS; radius = Host_Noclip_NextSearchRadius (radius))
		if (Host_Noclip_SearchFibonacciSphere (ent, base, radius, out))
			return true;

	return false;
}

static qboolean Host_Noclip_FindValidOriginTowardOldOrigin (edict_t *ent, vec3_t out)
{
	int	   i;
	vec3_t current, low, high, mid;

	VectorCopy (ent->v.origin, current);
	if (!Host_Noclip_TestOrigin (ent, ent->v.oldorigin))
		return false;

	VectorCopy (ent->v.oldorigin, low);
	VectorCopy (current, high);
	for (i = 0; i < NOCLIP_UNSTICK_LINE_STEPS; i++)
	{
		mid[0] = (low[0] + high[0]) * 0.5f;
		mid[1] = (low[1] + high[1]) * 0.5f;
		mid[2] = (low[2] + high[2]) * 0.5f;

		if (Host_Noclip_TestOrigin (ent, mid))
			VectorCopy (mid, low);
		else
			VectorCopy (mid, high);
	}

	VectorCopy (low, out);
	return true;
}

static void Host_Noclip_Off (void)
{
	float	 best_dist, dist;
	qboolean found;
	vec3_t	 base, candidate, origin;

	noclip_anglehack = false;
	VectorCopy (sv_player->v.origin, base);

	best_dist = 0;
	found = false;
	if (Host_Noclip_FindNearbyValidOrigin (sv_player, candidate))
	{
		VectorCopy (candidate, origin);
		best_dist = Host_Noclip_DistanceSquared (base, candidate);
		found = true;
	}

	if (Host_Noclip_FindValidOriginTowardOldOrigin (sv_player, candidate))
	{
		dist = Host_Noclip_DistanceSquared (base, candidate);
		if (!found || dist < best_dist)
		{
			VectorCopy (candidate, origin);
			found = true;
		}
	}

	if (found)
	{
		VectorCopy (origin, sv_player->v.origin);
		VectorCopy (origin, sv_player->v.oldorigin);
	}

	sv_player->v.movetype = MOVETYPE_WALK;
	SV_ClientPrintf ("noclip OFF\n");
}

/*
==================
Host_Noclip_f
==================
*/
static void Host_Noclip_f (void)
{
	if (cmd_source != src_client)
	{
		Cmd_ForwardToServer ();
		return;
	}

	if (pr_global_struct->deathmatch)
		return;

	// johnfitz -- allow user to explicitly set noclip to on or off
	switch (Cmd_Argc ())
	{
	case 1:
		if (sv_player->v.movetype != MOVETYPE_NOCLIP)
		{
			noclip_anglehack = true;
			sv_player->v.movetype = MOVETYPE_NOCLIP;
			SV_ClientPrintf ("noclip ON\n");
		}
		else
		{
			Host_Noclip_Off ();
		}
		break;
	case 2:
		if (atof (Cmd_Argv (1)))
		{
			noclip_anglehack = true;
			sv_player->v.movetype = MOVETYPE_NOCLIP;
			SV_ClientPrintf ("noclip ON\n");
		}
		else
		{
			Host_Noclip_Off ();
		}
		break;
	default:
		Con_Printf ("noclip [value] : toggle noclip mode. values: 0 = off, 1 = on\n");
		break;
	}
	// johnfitz
}

/*
====================
Host_SetPos_f

adapted from fteqw, originally by Alex Shadowalker
====================
*/
static void Host_SetPos_f (void)
{
	if (cmd_source != src_client)
	{
		Cmd_ForwardToServer ();
		return;
	}

	if (pr_global_struct->deathmatch)
		return;

	if (Cmd_Argc () != 7 && Cmd_Argc () != 4)
	{
		SV_ClientPrintf ("usage:\n");
		SV_ClientPrintf ("   setpos <x> <y> <z>\n");
		SV_ClientPrintf ("   setpos <x> <y> <z> <pitch> <yaw> <roll>\n");
		SV_ClientPrintf ("current values:\n");
		SV_ClientPrintf (
			"   %i %i %i %i %i %i\n", (int)sv_player->v.origin[0], (int)sv_player->v.origin[1], (int)sv_player->v.origin[2], (int)sv_player->v.v_angle[0],
			(int)sv_player->v.v_angle[1], (int)sv_player->v.v_angle[2]);
		return;
	}

	if (sv_player->v.movetype != MOVETYPE_NOCLIP)
	{
		noclip_anglehack = true;
		sv_player->v.movetype = MOVETYPE_NOCLIP;
		SV_ClientPrintf ("noclip ON\n");
	}

	// make sure they're not going to whizz away from it
	sv_player->v.velocity[0] = 0;
	sv_player->v.velocity[1] = 0;
	sv_player->v.velocity[2] = 0;

	sv_player->v.origin[0] = atof (Cmd_Argv (1));
	sv_player->v.origin[1] = atof (Cmd_Argv (2));
	sv_player->v.origin[2] = atof (Cmd_Argv (3));

	if (Cmd_Argc () == 7)
	{
		sv_player->v.angles[0] = atof (Cmd_Argv (4));
		sv_player->v.angles[1] = atof (Cmd_Argv (5));
		sv_player->v.angles[2] = atof (Cmd_Argv (6));
		sv_player->v.fixangle = 1;
	}

	SV_LinkEdict (sv_player, false);
}

/*
==================
Host_Fly_f

Sets client to flymode
==================
*/
static void Host_Fly_f (void)
{
	if (cmd_source != src_client)
	{
		Cmd_ForwardToServer ();
		return;
	}

	if (pr_global_struct->deathmatch)
		return;

	// johnfitz -- allow user to explicitly set noclip to on or off
	switch (Cmd_Argc ())
	{
	case 1:
		if (sv_player->v.movetype != MOVETYPE_FLY)
		{
			sv_player->v.movetype = MOVETYPE_FLY;
			SV_ClientPrintf ("flymode ON\n");
		}
		else
		{
			sv_player->v.movetype = MOVETYPE_WALK;
			SV_ClientPrintf ("flymode OFF\n");
		}
		break;
	case 2:
		if (atof (Cmd_Argv (1)))
		{
			sv_player->v.movetype = MOVETYPE_FLY;
			SV_ClientPrintf ("flymode ON\n");
		}
		else
		{
			sv_player->v.movetype = MOVETYPE_WALK;
			SV_ClientPrintf ("flymode OFF\n");
		}
		break;
	default:
		Con_Printf ("fly [value] : toggle fly mode. values: 0 = off, 1 = on\n");
		break;
	}
	// johnfitz
}

/*
==================
Host_Ping_f

==================
*/
static void Host_Ping_f (void)
{
	int		  i, j;
	float	  total;
	client_t *client;

	if (cmd_source != src_client)
	{
		Cmd_ForwardToServer ();
		return;
	}

	SV_ClientPrintf ("Client ping times:\n");
	for (i = 0, client = svs.clients; i < svs.maxclients; i++, client++)
	{
		if (!client->spawned || !client->netconnection)
			continue;
		total = 0;
		for (j = 0; j < NUM_PING_TIMES; j++)
			total += client->ping_times[j];
		total /= NUM_PING_TIMES;
		SV_ClientPrintf ("%4i %s\n", (int)(total * 1000), client->name);
	}
}

/*
===============================================================================

SERVER TRANSITIONS

===============================================================================
*/

/*
======================
Host_Map_f

handle a
map <servername>
command from the console.  Active clients are kicked off.
======================
*/
static void Host_Map_f (void)
{
	int	 i;
	char name[MAX_QPATH], *p;

	if (Cmd_Argc () < 2) // no map name given
	{
		if (cls.state == ca_dedicated)
		{
			if (sv.active)
				Con_Printf ("Current map: %s\n", sv.name);
			else
				Con_Printf ("Server not active\n");
		}
		else if (cls.state == ca_connected)
		{
			Con_Printf ("Current map: %s ( %s )\n", cl.levelname, cl.mapname);
		}
		else
		{
			Con_Printf ("map <levelname>: start a new server\n");
		}
		return;
	}

	if (cmd_source != src_command)
		return;

	cls.demonum = -1; // stop demo loop in case this fails

	CL_Disconnect ();
	Host_ShutdownServer (false);

	if (cls.state != ca_dedicated)
	{
		IN_Activate ();
		key_dest = key_game; // remove console or menu
		SCR_BeginLoadingPlaque ();
	}

	svs.serverflags = 0; // haven't completed an episode yet
	q_strlcpy (name, Cmd_Argv (1), sizeof (name));
	// remove (any) trailing ".bsp" from mapname -- S.A.
	p = strrchr (name, '.');
	if (p != NULL)
	{
		if (strcmp (p, ".bsp") == 0)
			*p = '\0';
	}
	PR_SwitchQCVM (&sv.qcvm);
	SV_SpawnServer (name);
	PR_SwitchQCVM (NULL);
	if (!sv.active)
	{
		SCR_EndLoadingPlaque ();
		return;
	}

	if (cls.state != ca_dedicated)
	{
		memset (cls.spawnparms, 0, MAX_MAPSTRING);
		for (i = 2; i < Cmd_Argc (); i++)
		{
			q_strlcat (cls.spawnparms, Cmd_Argv (i), MAX_MAPSTRING);
			q_strlcat (cls.spawnparms, " ", MAX_MAPSTRING);
		}

		Cmd_ExecuteString ("connect local", src_command);
	}
}

/*
======================
Host_Randmap_f

Loads a random map from the "maps" list.
======================
*/
static void Host_Randmap_f (void)
{
	int				 i, randlevel, numlevels;
	filelist_item_t *level;

	if (cmd_source != src_command)
		return;

	for (level = extralevels, numlevels = 0; level; level = level->next)
		numlevels++;

	if (numlevels == 0)
	{
		Con_Printf ("no maps\n");
		return;
	}

	randlevel = (COM_Rand () % numlevels);

	for (level = extralevels, i = 0; level; level = level->next, i++)
	{
		if (i == randlevel)
		{
			Con_Printf ("Starting map %s...\n", level->name);
			Cbuf_AddText (va ("map %s\n", level->name));
			return;
		}
	}
}

/*
==================
Host_Changelevel_f

Goes to a new map, taking all clients along
==================
*/
static void Host_Changelevel_f (void)
{
	char level[MAX_QPATH];

	if (Cmd_Argc () != 2)
	{
		Con_Printf ("changelevel <levelname> : continue game on a new level\n");
		return;
	}
	if (!sv.active || cls.demoplayback)
	{
		Con_Printf ("Only the server may changelevel\n");
		return;
	}

	if (autoload.value && sv.lastsave[0] && !q_strcasecmp (sv.name, Cmd_Argv (1)) && current_skill == (int)(skill.value + 0.5) && svs.maxclients == 1 &&
		!cl.intermission && svs.clients[0].active && (svs.clients[0].edict->v.health <= 0))
	{
		Cbuf_AddText ("\nrestart\n");
		return;
	}

	// johnfitz -- check for client having map before anything else
	q_snprintf (level, sizeof (level), "maps/%s.bsp", Cmd_Argv (1));
	if (!COM_FileExists (level, NULL))
		Host_Error ("cannot find map %s", level);
	// johnfitz

	if (cls.state != ca_dedicated)
		IN_Activate ();	 // -- S.A.
	key_dest = key_game; // remove console or menu
	PR_SwitchQCVM (&sv.qcvm);
	SV_SaveSpawnparms ();
	q_strlcpy (level, Cmd_Argv (1), sizeof (level));
	SV_SpawnServer (level);
	PR_SwitchQCVM (NULL);
	// also issue an error if spawn failed -- O.S.
	if (!sv.active)
		Host_Error ("cannot run map %s", level);
}

/*
==================
Host_Restart_f

Restarts the current server for a dead player
==================
*/
static void Host_Restart_f (void)
{
	char mapname[MAX_QPATH];

	if (cls.demoplayback || !sv.active)
		return;

	if (cmd_source != src_command)
		return;

	if (autoload.value && sv.lastsave[0] && q_strcasecmp (Cmd_Argv (1), "noload") && q_strcasecmp (Cmd_Argv (1), "force"))
	{
		Cbuf_AddText (va ("-use;-jump;-attack;%sload \"%s\"\n", autofastload.value > 0 ? "fast" : "", sv.lastsave));
		svs.changelevel_issued = false;
		return;
	}

	q_strlcpy (mapname, sv.name, sizeof (mapname)); // mapname gets cleared in spawnserver
	PR_SwitchQCVM (&sv.qcvm);
	SV_SpawnServer (mapname);
	PR_SwitchQCVM (NULL);
	if (!sv.active)
		Host_Error ("cannot restart map %s", mapname);
}

/*
==================
Host_Reconnect_f

This command causes the client to wait for the signon messages again.
This is sent just before a server changes levels
==================
*/
static void Host_Reconnect_f (void)
{
	if (cls.demoplayback) // cross-map demo playback fix from Baker
		return;

	if (key_dest == key_game)
		IN_Activate ();
	SCR_BeginLoadingPlaque ();
	cls.signon = 0; // need new connection messages
}

/*
=====================
Host_Connect_f

User command to connect to server
=====================
*/
static void Host_Connect_f (void)
{
	char name[MAX_QPATH];

	cls.demonum = -1; // stop demo loop in case this fails
	if (cls.demoplayback)
	{
		CL_StopPlayback ();
		CL_Disconnect ();
	}
	q_strlcpy (name, Cmd_Argv (1), sizeof (name));
	SCR_BeginLoadingPlaque ();
	CL_EstablishConnection (name);
	Host_Reconnect_f ();
}

/*
===============================================================================

LOAD / SAVE GAME

===============================================================================
*/

#define SAVEGAME_VERSION 5

/*
===============
Host_SavegameComment

Writes a SAVEGAME_COMMENT_LENGTH character comment describing the current
===============
*/
static void Host_SavegameComment (char text[SAVEGAME_COMMENT_LENGTH + 1])
{
	int	 i;
	char kills[20];

	for (i = 0; i < SAVEGAME_COMMENT_LENGTH; i++)
		text[i] = ' ';
	text[SAVEGAME_COMMENT_LENGTH] = '\0';

	// Remove CR/LFs from level name to avoid broken saves, e.g. with autumn_sp map:
	// sanitize Level name:
	char cleanname[sizeof (cl.levelname)];
	COM_SanitizeDescriptionString (cleanname, sizeof (cleanname), cl.levelname, true);

	i = (int)strlen (cleanname);
	if (i > 22)
		i = 22;
	memcpy (text, cleanname, (size_t)i);

	sprintf (kills, "kills:%3i/%3i", cl.stats[STAT_MONSTERS], cl.stats[STAT_TOTALMONSTERS]);
	memcpy (text + 22, kills, strlen (kills));

	// convert space to _ to make stdio happy
	for (i = 0; i < SAVEGAME_COMMENT_LENGTH; i++)
	{
		if (text[i] == ' ')
			text[i] = '_';
	}
}

/*
===============
Host_Savegame_f
===============
*/
static void Host_Savegame_f (void)
{
	char  name[MAX_OSPATH];
	FILE *f;
	int	  i;
	char  comment[SAVEGAME_COMMENT_LENGTH + 1];

	if (cmd_source != src_command)
		return;

	if (!sv.active)
	{
		Con_Printf ("Not playing a local game.\n");
		return;
	}

	if (sv.nomonsters)
	{
		Con_Printf ("Can't save when using \"nomonsters\".\n");
		return;
	}

	if (cl.intermission)
	{
		Con_Printf ("Can't save in intermission.\n");
		return;
	}

	if (svs.maxclients != 1)
	{
		Con_Printf ("Can't save multiplayer games.\n");
		return;
	}

	if (Cmd_Argc () != 2)
	{
		Con_Printf ("save <savename> : save a game\n");
		return;
	}

	if (strstr (Cmd_Argv (1), ".."))
	{
		Con_Printf ("Relative pathnames are not allowed.\n");
		return;
	}

	for (i = 0; i < svs.maxclients; i++)
	{
		if (svs.clients[i].active && (svs.clients[i].edict->v.health <= 0))
		{
			Con_Printf ("Can't savegame with a dead player\n");
			return;
		}
	}

	q_snprintf (name, sizeof (name), "%s/%s", com_gamedir, Cmd_Argv (1));
	COM_AddExtension (name, ".sav", sizeof (name));

	Con_SafePrintf ("Saving game to ");
	Con_LinkPrintf (name, "%s", name);
	Con_SafePrintf ("...\n");
	f = Sys_fopen (name, "w");
	if (!f)
	{
		Con_Printf ("ERROR: couldn't open.\n");
		return;
	}

	PR_SwitchQCVM (&sv.qcvm);

	fprintf (f, "%i\n", SAVEGAME_VERSION);
	Host_SavegameComment (comment);
	fprintf (f, "%s\n", comment);
	for (i = 0; i < NUM_BASIC_SPAWN_PARMS; i++)
		fprintf (f, "%f\n", svs.clients->spawn_parms[i]);
	fprintf (f, "%d\n", current_skill);
	fprintf (f, "%s\n", sv.name);
	fprintf (f, "%f\n", qcvm->time);

	// write the light styles
	for (i = 0; i < MAX_LIGHTSTYLES; i++)
	{
		if (sv.lightstyles[i])
			fprintf (f, "%s\n", sv.lightstyles[i]);
		else
			fprintf (f, "m\n");
	}

	ED_WriteGlobals (f);
	for (i = 0; i < qcvm->num_edicts; i++)
	{
		ED_Write (f, EDICT_NUM (i));
	}

	// add extra info (lightstyles, precaches, etc) in a way that's supposed to be compatible with DP.
	// sidenote - this provides extended lightstyles and support for late precaches
	// it does NOT protect against spawnfunc precache changes - we would need to include makestatics here too (and optionally baselines, or just recalculate
	// those).
	fprintf (f, "/*\n");
	fprintf (f, "// QuakeSpasm extended savegame\n");
	for (i = MAX_LIGHTSTYLES; i < MAX_LIGHTSTYLES; i++)
	{
		if (sv.lightstyles[i])
			fprintf (f, "sv.lightstyles %i \"%s\"\n", i, sv.lightstyles[i]);
	}
	for (i = 1; i < MAX_MODELS; i++)
	{
		if (sv.model_precache[i])
			fprintf (f, "sv.model_precache %i \"%s\"\n", i, sv.model_precache[i]);
	}
	for (i = 1; i < MAX_SOUNDS; i++)
	{
		if (sv.sound_precache[i])
			fprintf (f, "sv.sound_precache %i \"%s\"\n", i, sv.sound_precache[i]);
	}
	for (i = 1; i < MAX_PARTICLETYPES; i++)
	{
		if (sv.particle_precache[i])
			fprintf (f, "sv.particle_precache %i \"%s\"\n", i, sv.particle_precache[i]);
	}

	fprintf (f, "sv.serverflags %i\n", svs.serverflags);
	for (i = NUM_BASIC_SPAWN_PARMS; i < NUM_TOTAL_SPAWN_PARMS; i++)
	{
		if (svs.clients->spawn_parms[i])
			fprintf (f, "spawnparm %i \"%f\"\n", i + 1, svs.clients->spawn_parms[i]);
	}

	const char *fog_cmd = Fog_GetFogCommand (true);
	if (fog_cmd)
		fprintf (f, "%s", &fog_cmd[1]);

	const char *sky_cmd = Sky_GetSkyCommand (true);
	if (sky_cmd)
		fprintf (f, "%s", &sky_cmd[1]);

	fprintf (f, "*/\n");

	fclose (f);

	// Take the occasion to check the free-list
	// this is a long operation anyway.
	ED_CheckFreeList ();

	Con_Printf ("done.\n");

	PR_SwitchQCVM (NULL);
	SaveList_Rebuild ();

	if (strlen (Cmd_Argv (1)) < sizeof (sv.lastsave) - 1)
		strcpy (sv.lastsave, Cmd_Argv (1));
}

static void Send_Spawn_Info (client_t *c, qboolean loadgame)
{
	int		  i;
	client_t *client;
	edict_t	 *ent;

	// send all current names, colors, and frag counts
	SZ_Clear (&c->message);

	// send time of update
	MSG_WriteByte (&c->message, svc_time);
	MSG_WriteFloat (&c->message, qcvm->time);
	if (c->protocol_pext2 & PEXT2_PREDINFO)
		MSG_WriteShort (&c->message, (c->lastmovemessage & 0xffff));

	for (i = 0, client = svs.clients; i < svs.maxclients; i++, client++)
	{
		if (!client->knowntoqc)
			continue;

		MSG_WriteByte (&c->message, svc_updatename);
		MSG_WriteByte (&c->message, i);
		MSG_WriteString (&c->message, client->name);
		MSG_WriteByte (&c->message, svc_updatecolors);
		MSG_WriteByte (&c->message, i);
		MSG_WriteByte (&c->message, client->colors);

		MSG_WriteByte (&c->message, svc_updatefrags);
		MSG_WriteByte (&c->message, i);
		MSG_WriteShort (&c->message, client->old_frags);
	}

	// send all current light styles
	for (i = 0; i < MAX_LIGHTSTYLES; i++)
	{
		MSG_WriteByte (&c->message, svc_lightstyle);
		MSG_WriteByte (&c->message, (char)i);
		MSG_WriteString (&c->message, sv.lightstyles[i]);
	}

	//
	// send some stats
	//
	MSG_WriteByte (&c->message, svc_updatestat);
	MSG_WriteByte (&c->message, STAT_TOTALSECRETS);
	MSG_WriteLong (&c->message, pr_global_struct->total_secrets);

	MSG_WriteByte (&c->message, svc_updatestat);
	MSG_WriteByte (&c->message, STAT_TOTALMONSTERS);
	MSG_WriteLong (&c->message, pr_global_struct->total_monsters);

	MSG_WriteByte (&c->message, svc_updatestat);
	MSG_WriteByte (&c->message, STAT_SECRETS);
	MSG_WriteLong (&c->message, pr_global_struct->found_secrets);

	MSG_WriteByte (&c->message, svc_updatestat);
	MSG_WriteByte (&c->message, STAT_MONSTERS);
	MSG_WriteLong (&c->message, pr_global_struct->killed_monsters);

	//
	// send a fixangle
	// Never send a roll angle, because savegames can catch the server
	// in a state where it is expecting the client to correct the angle
	// and it won't happen if the game was just loaded, so you wind up
	// with a permanent head tilt
	ent = EDICT_NUM (1 + (c - svs.clients));
	MSG_WriteByte (&c->message, svc_setangle);
	for (i = 0; i < 2; i++)
		if (loadgame)
			MSG_WriteAngle (&c->message, ent->v.v_angle[i], sv.protocolflags);
		else
			MSG_WriteAngle (&c->message, ent->v.angles[i], sv.protocolflags);
	MSG_WriteAngle (&c->message, 0, sv.protocolflags);

	if (!(c->protocol_pext2 & PEXT2_REPLACEMENTDELTAS))
		SV_WriteClientdataToMessage (c, &c->message);
}

/*
===============
Host_Loadgame_f
===============
*/
static void Host_Loadgame_f (void)
{
	static char *start;

	char		name[MAX_OSPATH];
	char		legacy_dir[MAX_OSPATH];
	char		mapname[MAX_QPATH];
	float		time, tfloat;
	const char *data;
	int			i;
	edict_t	   *ent;
	int			entnum;
	int			version;
	float		spawn_parms[NUM_TOTAL_SPAWN_PARMS];
	qboolean	was_recording = cls.demorecording;
	int			old_skill = current_skill;
	qboolean	fastload = !!strstr (Cmd_Argv (0), "fast") || autofastload.value;

	if (cmd_source != src_command)
		return;

	if (Cmd_Argc () != 2)
	{
		Con_Printf ("%s <savename> : load a game\n", Cmd_Argv (0));
		return;
	}

	if (strstr (Cmd_Argv (1), ".."))
	{
		Con_Printf ("Relative pathnames are not allowed.\n");
		return;
	}

	if (nomonsters.value)
	{
		Con_Warning ("\"%s\" disabled automatically.\n", nomonsters.name);
		Cvar_SetValueQuick (&nomonsters, 0.f);
	}

	cls.demonum = -1; // stop demo loop in case this fails

	// avoid leaking if the previous Host_Loadgame_f failed with a Host_Error
	if (start != NULL)
		Mem_Free (start);

	q_snprintf (name, sizeof (name), "%s/%s", com_gamedir, Cmd_Argv (1));
	COM_AddExtension (name, ".sav", sizeof (name));
	start = (char *)COM_LoadMallocFile_TextMode_OSPath (name, NULL);
	if (!start && COM_GetLegacySaveDir (legacy_dir, sizeof (legacy_dir)))
	{
		q_snprintf (name, sizeof (name), "%s/%s", legacy_dir, Cmd_Argv (1));
		COM_AddExtension (name, ".sav", sizeof (name));
		start = (char *)COM_LoadMallocFile_TextMode_OSPath (name, NULL);
	}
	if (!start)
	{
		SCR_EndLoadingPlaque ();
		Con_Printf ("ERROR: couldn't open.\n");
		return;
	}

	Con_Printf ("Loading game from %s...\n", name);

	data = start;
	data = COM_ParseIntNewline (data, &version);
	if (version != SAVEGAME_VERSION)
	{
		Mem_Free (start);
		start = NULL;
		Host_Error ("Savegame is version %i, not %i", version, SAVEGAME_VERSION);
		return;
	}
	data = COM_ParseStringNewline (data);
	for (i = 0; i < NUM_BASIC_SPAWN_PARMS; i++)
		data = COM_ParseFloatNewline (data, &spawn_parms[i]);
	for (; i < NUM_TOTAL_SPAWN_PARMS; i++)
		spawn_parms[i] = 0;
	// this silliness is so we can load 1.06 save files, which have float skill values
	data = COM_ParseFloatNewline (data, &tfloat);
	current_skill = (int)(tfloat + 0.1);
	Cvar_SetValue ("skill", (float)current_skill);

	data = COM_ParseStringNewline (data);
	q_strlcpy (mapname, com_token, sizeof (mapname));
	data = COM_ParseFloatNewline (data, &time);

	if (fastload && (!sv.active || cls.signon != SIGNONS || svs.maxclients != 1))
	{
		Con_Printf ("Can't fastload (first load, or is a client multiplayer game)\n");
		fastload = 0;
	}
	if (fastload && (strcmp (mapname, sv.name) || current_skill != old_skill))
	{
		Con_Printf ("Can't fastload (%s skill %d vs %s skill %d)\n", mapname, current_skill, sv.name, old_skill);
		fastload = 0;
	}
	if (fastload && cl.intermission)
	{
		// we could if we reset cl.intermission and the music, but some mods still struggle
		Con_Printf ("Can't fastload during an intermission\n");
		fastload = 0;
	}

	if (!fastload)
	{
		SCR_BeginLoadingPlaque ();
		CL_Disconnect_f ();
	}
	else if (cls.demorecording) // demo playback can't deal with backward timestamps, so record a map change
		CL_Stop_f ();

	PR_SwitchQCVM (&sv.qcvm);

	if (!fastload)
		SV_SpawnServer (mapname);

	if (!sv.active)
	{
		PR_SwitchQCVM (NULL);
		Mem_Free (start);
		start = NULL;
		SCR_EndLoadingPlaque ();
		Con_Printf ("Couldn't load map\n");
		return;
	}
	if (!fastload)
	{
		sv.paused = true; // pause until all clients connect
		sv.loadgame = true;
	}
	else
		S_StopAllSounds (true, true); // do this before parsing the edicts, since that may take a while

	if (was_recording)
		CL_Resume_Record (fastload);

	// load the light styles
	for (i = 0; i < MAX_LIGHTSTYLES; i++)
	{
		data = COM_ParseStringNewline (data);
		sv.lightstyles[i] = (const char *)q_strdup (com_token);
	}

	if (fastload) // can be done for normal loads too, but keep the previous behavior
		PR_ClearEdictStrings ();

	// load the edicts out of the savegame file
	entnum = -1; // -1 is the globals
	while (*data)
	{
		while (*data == ' ' || *data == '\r' || *data == '\n')
			data++;
		if (data[0] == '/' && data[1] == '*' && (data[2] == '\r' || data[2] == '\n'))
		{ // looks like an extended saved game
			char	   *end;
			const char *ext;
			ext = data + 2;
			while ((end = (char *)strchr (ext, '\n')))
			{
				*end = 0;
				ext = COM_Parse (ext);
				if (!strcmp (com_token, "sv.lightstyles"))
				{
					int idx;
					ext = COM_Parse (ext);
					idx = atoi (com_token);
					ext = COM_Parse (ext);
					if (idx >= 0 && idx < MAX_LIGHTSTYLES)
					{
						if (*com_token)
							sv.lightstyles[idx] = (const char *)q_strdup (com_token);
						else
							sv.lightstyles[idx] = NULL;
					}
				}
				else if (!strcmp (com_token, "sv.model_precache"))
				{
					int idx;
					ext = COM_Parse (ext);
					idx = atoi (com_token);
					ext = COM_Parse (ext);
					if (idx >= 1 && idx < MAX_MODELS)
					{
						sv.model_precache[idx] = (const char *)q_strdup (com_token);
						sv.models[idx] = Mod_ForName (sv.model_precache[idx], idx == 1);
						// if (idx == 1)
						//	sv.worldmodel = sv.models[idx];
					}
				}
				else if (!strcmp (com_token, "sv.sound_precache"))
				{
					int idx;
					ext = COM_Parse (ext);
					idx = atoi (com_token);
					ext = COM_Parse (ext);
					if (idx >= 1 && idx < MAX_MODELS)
						sv.sound_precache[idx] = (const char *)q_strdup (com_token);
				}
				else if (!strcmp (com_token, "sv.particle_precache"))
				{
					int idx;
					ext = COM_Parse (ext);
					idx = atoi (com_token);
					ext = COM_Parse (ext);
					if (idx >= 1 && idx < MAX_PARTICLETYPES)
					{
						Mem_Free (sv.particle_precache[idx]);
						sv.particle_precache[idx] = (const char *)q_strdup (com_token);
					}
				}
				else if (!strcmp (com_token, "sv.serverflags") || !strcmp (com_token, "svs.serverflags"))
				{
					int fl;
					ext = COM_Parse (ext);
					fl = atoi (com_token);
					svs.serverflags = fl;
				}
				else if (!strcmp (com_token, "spawnparm"))
				{
					int idx;
					ext = COM_Parse (ext);
					idx = atoi (com_token);
					ext = COM_Parse (ext);
					if (idx >= 1 && idx <= NUM_TOTAL_SPAWN_PARMS)
						spawn_parms[idx - 1] = atof (com_token);
				}
				else if (!strcmp (com_token, "fog") && fastload)
				{
					float d, r, g, b;
					ext = COM_Parse (ext);
					d = atof (com_token);
					ext = COM_Parse (ext);
					r = atof (com_token);
					ext = COM_Parse (ext);
					g = atof (com_token);
					ext = COM_Parse (ext);
					b = atof (com_token);
					Fog_Update (d, r, g, b, 0.0f);
				}
				else if (!strcmp (com_token, "sky") && fastload)
				{
					ext = COM_Parse (ext);
					Sky_LoadSkyBox (com_token);
				}
				else if (!strcmp (com_token, "skyfog") && fastload)
				{
					ext = COM_Parse (ext);
					Sky_SetSkyfog (atof (com_token));
				}
				*end = '\n';
				ext = end + 1;
			}
		}

		data = COM_Parse (data);
		if (!com_token[0])
			break; // end of file
		if (strcmp (com_token, "{"))
		{
			Host_Error ("First token isn't a brace");
		}

		if (entnum == -1)
		{ // parse the global vars
			data = ED_ParseGlobals (data);
		}
		else
		{ // parse an edict
			ent = EDICT_NUM (entnum);
			if (entnum < qcvm->num_edicts)
			{
				ent->free = false;
				memset (&ent->v, 0, qcvm->progs->entityfields * 4);
			}
			else
			{
				// adjust qcvm->num_edicts for consistency:
				qcvm->num_edicts = q_max (qcvm->num_edicts, entnum + 1);
				memset (ent, 0, qcvm->edict_size);

				assert (!ent->free);

				ent->baseline = nullentitystate;
#if defined(DEBUG) || defined(_DEBUG)
				// fill debug fields, they were overwriten above:
				ent->qcvm_owner = qcvm;
				ent->edict_ptr = ent;
				ent->edict_num = entnum;
#endif
			}
			data = ED_ParseEdict (data, ent);

			// link it into the bsp tree
			if (!ent->free)
				SV_LinkEdict (ent, false);
		}

		entnum++;
	}

	qcvm->time = time;

	// we finished the edicts loading, free the excess > entnum
	for (i = entnum; i < qcvm->num_edicts; i++)
	{
		ED_Free (EDICT_NUM (i));
	}
	// adjust to the effective nb of edicts
	qcvm->num_edicts = entnum;

	// The loading process purposefully bypassed the free-list
	// usage, so rebuild it now
	ED_RebuildFreeList (true);

	if (fastload)
	{
		sv.lastchecktime = 0.0;
		memset (cl_dlights, 0, sizeof (cl_dlights));
		memset (cl_temp_entities, 0, sizeof (cl_temp_entities));
		memset (cl_beams, 0, sizeof (cl_beams));
		V_ResetBlend ();
		Fog_ResetFade ();
		R_ClearParticles ();
#ifdef PSET_SCRIPT
		PScript_ClearParticles (false);
#endif
		SCR_CenterPrintClear ();

		Send_Spawn_Info (svs.clients, true);
	}

	Mem_Free (start);
	start = NULL;

	for (i = 0; i < NUM_TOTAL_SPAWN_PARMS; i++)
		svs.clients->spawn_parms[i] = spawn_parms[i];

	PR_SwitchQCVM (NULL);

	if (cls.state != ca_dedicated && !fastload)
	{
		CL_EstablishConnection ("local");
		Host_Reconnect_f ();
	}
	else
		SCR_EndLoadingPlaque ();

	if (strlen (Cmd_Argv (1)) < sizeof (sv.lastsave) - 1)
		strcpy (sv.lastsave, Cmd_Argv (1));
}

//============================================================================

/*
======================
Host_Name_f
======================
*/
static void Host_Name_f (void)
{
	char newName[32];

	if (Cmd_Argc () == 1)
	{
		Con_Printf ("\"name\" is \"%s\"\n", cl_name.string);
		return;
	}
	if (Cmd_Argc () == 2)
		q_strlcpy (newName, Cmd_Argv (1), sizeof (newName));
	else
		q_strlcpy (newName, Cmd_Args (), sizeof (newName));
	newName[15] = 0; // client_t structure actually says name[32].

	if (cmd_source != src_client)
	{
		if (strcmp (cl_name.string, newName) == 0)
			return;
		Cvar_Set ("_cl_name", newName);
		if (cls.state == ca_connected)
			Cmd_ForwardToServer ();
		return;
	}

	// set the name into the userinfo, otherwise SV_DecodeUserInfo resets
	// it to "unnamed" as soon as another key (e.g. topcolor) is updated
	SV_UpdateInfo ((host_client - svs.clients) + 1, "name", newName);
}

static void Host_Say (qboolean teamonly)
{
	int			j;
	client_t   *client;
	client_t   *save;
	const char *p;
	char		text[MAXCMDLINE], *p2;
	qboolean	quoted;
	qboolean	fromServer = false;

	if (cmd_source == src_command)
	{
		if (cls.state != ca_dedicated)
		{
			Cmd_ForwardToServer ();
			return;
		}
		fromServer = true;
		teamonly = false;
	}

	if (Cmd_Argc () < 2)
		return;

	save = host_client;

	p = Cmd_Args ();
	// remove quotes if present
	quoted = false;
	if (*p == '\"')
	{
		p++;
		quoted = true;
	}
	// turn on color set 1
	if (!fromServer)
		q_snprintf (text, sizeof (text), "\001%s: %s", save->name, p);
	else
		q_snprintf (text, sizeof (text), "\001<%s> %s", hostname.string, p);

	// check length & truncate if necessary
	j = (int)strlen (text);
	if (j >= (int)sizeof (text) - 1)
	{
		text[sizeof (text) - 2] = '\n';
		text[sizeof (text) - 1] = '\0';
	}
	else
	{
		p2 = text + j;
		while ((const char *)p2 > (const char *)text && (p2[-1] == '\r' || p2[-1] == '\n' || (p2[-1] == '\"' && quoted)))
		{
			if (p2[-1] == '\"' && quoted)
				quoted = false;
			p2[-1] = '\0';
			p2--;
		}
		p2[0] = '\n';
		p2[1] = '\0';
	}

	for (j = 0, client = svs.clients; j < svs.maxclients; j++, client++)
	{
		if (!client || !client->active || !client->spawned)
			continue;
		if (teamplay.value && teamonly && client->edict->v.team != save->edict->v.team)
			continue;
		host_client = client;
		SV_ClientPrintf ("%s", text);
	}
	host_client = save;

	if (cls.state == ca_dedicated)
		Sys_Printf ("%s", &text[1]);
}

static void Host_Say_f (void)
{
	Host_Say (false);
}

static void Host_Say_Team_f (void)
{
	Host_Say (true);
}

static void Host_Tell_f (void)
{
	int			j;
	client_t   *client;
	client_t   *save;
	const char *p;
	char		text[MAXCMDLINE], *p2;
	qboolean	quoted;

	if (cmd_source != src_client)
	{
		Cmd_ForwardToServer ();
		return;
	}

	if (Cmd_Argc () < 3)
		return;

	p = Cmd_Args ();
	// remove quotes if present
	quoted = false;
	if (*p == '\"')
	{
		p++;
		quoted = true;
	}
	q_snprintf (text, sizeof (text), "%s: %s", host_client->name, p);

	// check length & truncate if necessary
	j = (int)strlen (text);
	if (j >= (int)sizeof (text) - 1)
	{
		text[sizeof (text) - 2] = '\n';
		text[sizeof (text) - 1] = '\0';
	}
	else
	{
		p2 = text + j;
		while ((const char *)p2 > (const char *)text && (p2[-1] == '\r' || p2[-1] == '\n' || (p2[-1] == '\"' && quoted)))
		{
			if (p2[-1] == '\"' && quoted)
				quoted = false;
			p2[-1] = '\0';
			p2--;
		}
		p2[0] = '\n';
		p2[1] = '\0';
	}

	save = host_client;
	for (j = 0, client = svs.clients; j < svs.maxclients; j++, client++)
	{
		if (!client->active || !client->spawned)
			continue;
		if (q_strcasecmp (client->name, Cmd_Argv (1)))
			continue;
		host_client = client;
		SV_ClientPrintf ("%s", text);
		break;
	}
	host_client = save;
}

/*
==================
Host_Color_f
==================
*/
static void Host_Color_f (void)
{
	const char *top, *bottom;

	if (Cmd_Argc () == 1)
	{
		// TODO : do better and print color names instead like QSS ?
		Con_Printf ("\"color\" is \"%i %i\"\n", (int)cl_topcolor.value, (int)cl_bottomcolor.value);
		Con_Printf ("color <0-13> [0-13]\n");
		return;
	}

	if (Cmd_Argc () == 2)
		top = bottom = Cmd_Argv (1);
	else
	{
		top = Cmd_Argv (1);
		bottom = Cmd_Argv (2);
	}

	if (cmd_source != src_client)
	{
		Cvar_Set ("topcolor", top);
		Cvar_Set ("bottomcolor", bottom);

		if (cls.state == ca_connected)
			Cmd_ForwardToServer ();
		return;
	}

	SV_UpdateInfo ((host_client - svs.clients) + 1, "topcolor", top);
	SV_UpdateInfo ((host_client - svs.clients) + 1, "bottomcolor", bottom);
}

/*
==================
Host_Kill_f
==================
*/
static void Host_Kill_f (void)
{
	if (cmd_source != src_client)
	{
		Cmd_ForwardToServer ();
		return;
	}

	if (sv_player->v.health <= 0)
	{
		SV_ClientPrintf ("Can't suicide -- already dead!\n");
		return;
	}

	pr_global_struct->time = qcvm->time;
	pr_global_struct->self = EDICT_TO_PROG (sv_player);
	PR_ExecuteProgram (pr_global_struct->ClientKill);
}

/*
==================
Host_Pause_f
==================
*/
static void Host_Pause_f (void)
{
	// ericw -- demo pause support (inspired by MarkV)
	if (cls.demoplayback)
	{
		cls.demopaused = !cls.demopaused;
		cl.paused = cls.demopaused;
		if (cls.demospeed == 0.f && !cls.demopaused)
			cls.demospeed = 1.f;
		return;
	}

	if (cmd_source != src_client)
	{
		Cmd_ForwardToServer ();
		return;
	}
	if (!pausable.value)
		SV_ClientPrintf ("Pause not allowed.\n");
	else
	{
		sv.paused ^= 1;

		if (sv.paused)
		{
			SV_BroadcastPrintf ("%s paused the game\n", PR_GetString (sv_player->v.netname));
		}
		else
		{
			SV_BroadcastPrintf ("%s unpaused the game\n", PR_GetString (sv_player->v.netname));
		}

		// send notification to all clients
		MSG_WriteByte (&sv.reliable_datagram, svc_setpause);
		MSG_WriteByte (&sv.reliable_datagram, sv.paused);
	}
}

//===========================================================================

/*
==================
Host_PreSpawn_f
==================
*/
static void Host_PreSpawn_f (void)
{
	if (cmd_source != src_client)
	{
		Con_Printf ("prespawn is not valid from the console\n");
		return;
	}

	if (host_client->spawned)
	{
		Con_Printf ("prespawn not valid -- already spawned\n");
		return;
	}

	// will start splurging out prespawn data
	host_client->sendsignon = 2;
	host_client->signonidx = 0;
}

/*
==================
Host_Spawn_f
==================
*/
static void Host_Spawn_f (void)
{
	int		 i;
	edict_t *ent;

	if (cmd_source != src_client)
	{
		Con_Printf ("spawn is not valid from the console\n");
		return;
	}

	if (host_client->spawned)
	{
		Con_Printf ("Spawn not valid -- already spawned\n");
		return;
	}

	host_client->knowntoqc = true;
	host_client->lastmovetime = qcvm->time;
	// run the entrance script
	if (sv.loadgame)
	{ // loaded games are fully inited already
		// if this is the last client to be connected, unpause
		sv.paused = false;
	}
	else
	{
		// set up the edict
		ent = host_client->edict;

		memset (&ent->v, 0, qcvm->progs->entityfields * 4);
		ent->v.colormap = NUM_FOR_EDICT (ent);
		ent->v.team = (host_client->colors & 15) + 1;
		ent->v.netname = PR_SetEngineString (host_client->name);

		// copy spawn parms out of the client_t
		for (i = 0; i < NUM_BASIC_SPAWN_PARMS; i++)
			(&pr_global_struct->parm1)[i] = host_client->spawn_parms[i];
		if (pr_checkextension.value)
		{ // extended spawn parms
			for (; i < NUM_TOTAL_SPAWN_PARMS; i++)
			{
				ddef_t *g = ED_FindGlobal (va ("parm%i", i + 1));
				if (g)
					qcvm->globals[g->ofs] = host_client->spawn_parms[i];
			}
		}
		// call the spawn function
		pr_global_struct->time = qcvm->time;
		pr_global_struct->self = EDICT_TO_PROG (sv_player);
		PR_ExecuteProgram (pr_global_struct->ClientConnect);

		if ((Sys_DoubleTime () - NET_QSocketGetTime (host_client->netconnection)) <= qcvm->time)
			Sys_Printf ("%s entered the game\n", host_client->name);

		PR_ExecuteProgram (pr_global_struct->PutClientInServer);
	}

	Send_Spawn_Info (host_client, sv.loadgame);

	MSG_WriteByte (&host_client->message, svc_signonnum);
	MSG_WriteByte (&host_client->message, 3);
	host_client->sendsignon = true;
}

/*
==================
Host_Begin_f
==================
*/
static void Host_Begin_f (void)
{
	if (cmd_source != src_client)
	{
		Con_Printf ("begin is not valid from the console\n");
		return;
	}

	host_client->spawned = true;
}

//===========================================================================

/*
==================
Host_Kick_f

Kicks a user off of the server
==================
*/
static void Host_Kick_f (void)
{
	const char *who;
	const char *message = NULL;
	client_t   *save;
	int			i;
	qboolean	byNumber = false;

	if (cmd_source != src_client)
	{
		if (!sv.active)
		{
			Cmd_ForwardToServer ();
			return;
		}
	}
	else if (pr_global_struct->deathmatch)
		return;

	save = host_client;

	if (Cmd_Argc () > 2 && strcmp (Cmd_Argv (1), "#") == 0)
	{
		i = atof (Cmd_Argv (2)) - 1;
		if (i < 0 || i >= svs.maxclients)
			return;
		if (!svs.clients[i].active)
			return;
		host_client = &svs.clients[i];
		byNumber = true;
	}
	else
	{
		for (i = 0, host_client = svs.clients; i < svs.maxclients; i++, host_client++)
		{
			if (!host_client->active)
				continue;
			if (q_strcasecmp (host_client->name, Cmd_Argv (1)) == 0)
				break;
		}
	}

	if (i < svs.maxclients)
	{
		if (cmd_source != src_client)
			if (cls.state == ca_dedicated)
				who = "Console";
			else
				who = cl_name.string;
		else
			who = save->name;

		// can't kick yourself!
		if (host_client == save)
			return;

		if (Cmd_Argc () > 2)
		{
			message = COM_Parse (Cmd_Args ());
			if (byNumber)
			{
				message++;				// skip the #
				while (*message == ' ') // skip white space
					message++;
				message += strlen (Cmd_Argv (2)); // skip the number
			}
			while (*message && *message == ' ')
				message++;
		}
		if (message)
			SV_ClientPrintf ("Kicked by %s: %s\n", who, message);
		else
			SV_ClientPrintf ("Kicked by %s\n", who);
		SV_DropClient (false);
	}

	host_client = save;
}

/*
===============================================================================

DEBUGGING TOOLS

===============================================================================
*/

/*
==================
Host_Give_f
==================
*/
static void Host_Give_f (void)
{
	const char *t;
	int			v;
	eval_t	   *val;

	if (cmd_source != src_client)
	{
		Cmd_ForwardToServer ();
		return;
	}

	if (pr_global_struct->deathmatch)
		return;

	t = Cmd_Argv (1);
	v = atoi (Cmd_Argv (2));

	if (strcmp (t, "all") == 0)
	{
		for (int i = 0; i < 9; ++i)
		{
			if (hipnotic)
				sv_player->v.items = (int)sv_player->v.items | HIT_PROXIMITY_GUN | HIT_LASER_CANNON | HIT_MJOLNIR;
			for (i = 0; i <= 9; ++i)
				sv_player->v.items = (int)sv_player->v.items | (IT_SHOTGUN << i);
			sv_player->v.items = sv_player->v.items - ((int)(sv_player->v.items) & (int)(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR3;
			sv_player->v.items = (int)sv_player->v.items | (int)(IT_KEY1 | IT_KEY2);
			sv_player->v.ammo_shells = 999;
			sv_player->v.ammo_nails = 999;
			sv_player->v.ammo_rockets = 999;
			sv_player->v.ammo_cells = 999;
			sv_player->v.armortype = 0.8;
			sv_player->v.armorvalue = 200;
		}
	}
	else
	{
		switch (t[0])
		{
		case '0':
		case '1':
		case '2':
		case '3':
		case '4':
		case '5':
		case '6':
		case '7':
		case '8':
		case '9':
			// MED 01/04/97 added hipnotic give stuff
			if (hipnotic)
			{
				if (t[0] == '6')
				{
					if (t[1] == 'a')
						sv_player->v.items = (int)sv_player->v.items | HIT_PROXIMITY_GUN;
					else
						sv_player->v.items = (int)sv_player->v.items | IT_GRENADE_LAUNCHER;
				}
				else if (t[0] == '9')
					sv_player->v.items = (int)sv_player->v.items | HIT_LASER_CANNON;
				else if (t[0] == '0')
					sv_player->v.items = (int)sv_player->v.items | HIT_MJOLNIR;
				else if (t[0] >= '2')
					sv_player->v.items = (int)sv_player->v.items | (IT_SHOTGUN << (t[0] - '2'));
			}
			else
			{
				if (t[0] >= '2')
					sv_player->v.items = (int)sv_player->v.items | (IT_SHOTGUN << (t[0] - '2'));
			}
			break;

		case 's':
			if (rogue)
			{
				val = GetEdictFieldValue (sv_player, ED_FindFieldOffset ("ammo_shells1"));
				if (val)
					val->_float = v;
			}
			sv_player->v.ammo_shells = v;
			break;

		case 'n':
			if (rogue)
			{
				val = GetEdictFieldValue (sv_player, ED_FindFieldOffset ("ammo_nails1"));
				if (val)
				{
					val->_float = v;
					if (sv_player->v.weapon <= IT_LIGHTNING)
						sv_player->v.ammo_nails = v;
				}
			}
			else
			{
				sv_player->v.ammo_nails = v;
			}
			break;

		case 'l':
			if (rogue)
			{
				val = GetEdictFieldValue (sv_player, ED_FindFieldOffset ("ammo_lava_nails"));
				if (val)
				{
					val->_float = v;
					if (sv_player->v.weapon > IT_LIGHTNING)
						sv_player->v.ammo_nails = v;
				}
			}
			break;

		case 'r':
			if (rogue)
			{
				val = GetEdictFieldValue (sv_player, ED_FindFieldOffset ("ammo_rockets1"));
				if (val)
				{
					val->_float = v;
					if (sv_player->v.weapon <= IT_LIGHTNING)
						sv_player->v.ammo_rockets = v;
				}
			}
			else
			{
				sv_player->v.ammo_rockets = v;
			}
			break;

		case 'm':
			if (rogue)
			{
				val = GetEdictFieldValue (sv_player, ED_FindFieldOffset ("ammo_multi_rockets"));
				if (val)
				{
					val->_float = v;
					if (sv_player->v.weapon > IT_LIGHTNING)
						sv_player->v.ammo_rockets = v;
				}
			}
			break;

		case 'h':
			sv_player->v.health = v;
			break;

		case 'c':
			if (rogue)
			{
				val = GetEdictFieldValue (sv_player, ED_FindFieldOffset ("ammo_cells1"));
				if (val)
				{
					val->_float = v;
					if (sv_player->v.weapon <= IT_LIGHTNING)
						sv_player->v.ammo_cells = v;
				}
			}
			else
			{
				sv_player->v.ammo_cells = v;
			}
			break;

		case 'p':
			if (rogue)
			{
				val = GetEdictFieldValue (sv_player, ED_FindFieldOffset ("ammo_plasma"));
				if (val)
				{
					val->_float = v;
					if (sv_player->v.weapon > IT_LIGHTNING)
						sv_player->v.ammo_cells = v;
				}
			}
			break;

		// johnfitz -- give armour
		case 'a':
			if (v > 150)
			{
				sv_player->v.armortype = 0.8;
				sv_player->v.armorvalue = v;
				sv_player->v.items = sv_player->v.items - ((int)(sv_player->v.items) & (int)(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR3;
			}
			else if (v > 100)
			{
				sv_player->v.armortype = 0.6;
				sv_player->v.armorvalue = v;
				sv_player->v.items = sv_player->v.items - ((int)(sv_player->v.items) & (int)(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR2;
			}
			else if (v >= 0)
			{
				sv_player->v.armortype = 0.3;
				sv_player->v.armorvalue = v;
				sv_player->v.items = sv_player->v.items - ((int)(sv_player->v.items) & (int)(IT_ARMOR1 | IT_ARMOR2 | IT_ARMOR3)) + IT_ARMOR1;
			}
			break;
			// johnfitz

		case 'k':
			sv_player->v.items = (int)sv_player->v.items | (int)(IT_KEY1 | IT_KEY2);
			break;
		}
	}

	// johnfitz -- update currentammo to match new ammo (so statusbar updates correctly)
	switch ((int)(sv_player->v.weapon))
	{
	case IT_SHOTGUN:
	case IT_SUPER_SHOTGUN:
		sv_player->v.currentammo = sv_player->v.ammo_shells;
		break;
	case IT_NAILGUN:
	case IT_SUPER_NAILGUN:
	case RIT_LAVA_SUPER_NAILGUN:
		sv_player->v.currentammo = sv_player->v.ammo_nails;
		break;
	case IT_GRENADE_LAUNCHER:
	case IT_ROCKET_LAUNCHER:
	case RIT_MULTI_GRENADE:
	case RIT_MULTI_ROCKET:
		sv_player->v.currentammo = sv_player->v.ammo_rockets;
		break;
	case IT_LIGHTNING:
	case HIT_LASER_CANNON:
	case HIT_MJOLNIR:
		sv_player->v.currentammo = sv_player->v.ammo_cells;
		break;
	case RIT_LAVA_NAILGUN: // same as IT_AXE
		if (rogue)
			sv_player->v.currentammo = sv_player->v.ammo_nails;
		break;
	case RIT_PLASMA_GUN: // same as HIT_PROXIMITY_GUN
		if (rogue)
			sv_player->v.currentammo = sv_player->v.ammo_cells;
		if (hipnotic)
			sv_player->v.currentammo = sv_player->v.ammo_rockets;
		break;
	}
	// johnfitz
}

static edict_t *FindViewthing (void)
{
	int		 i;
	edict_t *e = NULL;

	PR_SwitchQCVM (&sv.qcvm);
	i = qcvm->num_edicts;

	if (i == qcvm->num_edicts)
	{
		for (i = 0; i < qcvm->num_edicts; i++)
		{
			e = EDICT_NUM (i);
			if (!strcmp (PR_GetString (e->v.classname), "viewthing"))
				break;
		}
	}

	if (i == qcvm->num_edicts)
	{
		for (i = 0; i < qcvm->num_edicts; i++)
		{
			e = EDICT_NUM (i);
			if (!strcmp (PR_GetString (e->v.classname), "info_player_start"))
				break;
		}
	}

	if (i == qcvm->num_edicts)
	{
		e = NULL;
		Con_Printf ("No viewthing on map\n");
	}

	PR_SwitchQCVM (NULL);
	return e;
}

/*
==================
Host_Viewmodel_f
==================
*/
static void Host_Viewmodel_f (void)
{
	edict_t	 *e;
	qmodel_t *m;

	e = FindViewthing ();
	if (!e)
		return;

	if (!*Cmd_Argv (1))
		m = NULL;
	else
	{
		m = Mod_ForName (Cmd_Argv (1), false);
		if (!m)
		{
			Con_Printf ("Can't load %s\n", Cmd_Argv (1));
			return;
		}
	}

	PR_SwitchQCVM (&sv.qcvm);
	e->v.modelindex = m ? SV_Precache_Model (m->name) : 0;
	e->v.model = PR_SetEngineString (sv.model_precache[(int)e->v.modelindex]);
	e->v.frame = 0;
	PR_SwitchQCVM (NULL);
}

/*
==================
Host_Viewframe_f
==================
*/
static void Host_Viewframe_f (void)
{
	edict_t	 *e;
	int		  f;
	qmodel_t *m;

	e = FindViewthing ();
	if (!e)
		return;
	m = cl.model_precache[(int)e->v.modelindex];
	if (m)
	{
		f = atoi (Cmd_Argv (1));
		if (f >= m->numframes)
			f = m->numframes - 1;

		e->v.frame = f;
	}
}

static void PrintFrameName (qmodel_t *m, int frame)
{
	aliashdr_t		  *hdr;
	maliasframedesc_t *pframedesc;

	hdr = (aliashdr_t *)Mod_Extradata (m);
	if (!hdr || m->type != mod_alias)
		return;
	pframedesc = &hdr->frames[frame];

	Con_Printf ("frame %i: %s\n", frame, pframedesc->name);
}

/*
==================
Host_Viewnext_f
==================
*/
static void Host_Viewnext_f (void)
{
	edict_t	 *e;
	qmodel_t *m;

	e = FindViewthing ();
	if (!e)
		return;
	m = cl.model_precache[(int)e->v.modelindex];
	if (m)
	{
		e->v.frame = e->v.frame + 1;
		if (e->v.frame >= m->numframes)
			e->v.frame = m->numframes - 1;

		PrintFrameName (m, e->v.frame);
	}
}

/*
==================
Host_Viewprev_f
==================
*/
static void Host_Viewprev_f (void)
{
	edict_t	 *e;
	qmodel_t *m;

	e = FindViewthing ();
	if (!e)
		return;

	m = cl.model_precache[(int)e->v.modelindex];
	if (m)
	{
		e->v.frame = e->v.frame - 1;
		if (e->v.frame < 0)
			e->v.frame = 0;

		PrintFrameName (m, e->v.frame);
	}
}

/*
===============================================================================

DEMO LOOP CONTROL

===============================================================================
*/

/*
==================
Host_Startdemos_f
==================
*/
static void Host_Startdemos_f (void)
{
	int i, c;

	if (cls.state == ca_dedicated)
		return;

	c = Cmd_Argc () - 1;
	if (c > MAX_DEMOS)
	{
		Con_Printf ("Max %i demos in demoloop\n", MAX_DEMOS);
		c = MAX_DEMOS;
	}
	Con_Printf ("%i demo(s) in loop\n", c);

	for (i = 1; i < c + 1; i++)
		q_strlcpy (cls.demos[i - 1], Cmd_Argv (i), sizeof (cls.demos[0]));

	if (!sv.active && cls.demonum != -1 && !cls.demoplayback)
	{
		cls.demonum = 0;
		if (!cl_startdemos.value)
		{ /* QuakeSpasm customization: */
			/* go straight to menu, no CL_NextDemo */
			cls.demonum = -1;
			Cbuf_InsertText ("menu_main\n");
			return;
		}
		CL_NextDemo ();
	}
	else
	{
		cls.demonum = -1;
	}
}

/*
==================
Host_Demos_f

Return to looping demos
==================
*/
static void Host_Demos_f (void)
{
	if (cls.state == ca_dedicated)
		return;
	if (cls.demonum == -1)
		cls.demonum = 1;
	CL_Disconnect_f ();
	CL_NextDemo ();
}

/*
==================
Host_Stopdemo_f

Return to looping demos
==================
*/
static void Host_Stopdemo_f (void)
{
	if (cls.state == ca_dedicated)
		return;
	if (!cls.demoplayback)
		return;
	CL_StopPlayback ();
	CL_Disconnect ();
}

/*
==================
Host_Resetdemos

Clear looping demo list (called on game change)
==================
*/
void Host_Resetdemos (void)
{
	memset (cls.demos, 0, sizeof (cls.demos));
	cls.demonum = 0;
}

static void Info_ClientPrint_Callback (void *ctx, const char *key, const char *val)
{
	SV_ClientPrintf ("%20s: %s\n", key, val);
}

static void Host_Serverinfo_f (void)
{
	// serverinfo command
	if (cmd_source == src_client)
	{
		Info_Enumerate (svs.serverinfo, Info_ClientPrint_Callback, NULL);
		return;
	}
	if (Cmd_Argc () != 3)
	{
		Con_Printf ("Serverinfo:\n");
		if (cls.state >= ca_connected && cmd_source != src_client)
			Info_Print (cl.serverinfo);
		else
			Info_Print (svs.serverinfo);
	}
	else if (cmd_source == src_command)
	{
		const char *key = Cmd_Argv (1);
		const char *val = Cmd_Argv (2);
		if (*key == '*')
		{
			Con_Printf ("Refusing to set key \"%s\"\n", key);
			return;
		}
		SV_UpdateInfo (0, key, val);
	}
	else
		Con_Printf ("Serverinfo may not be changed here\n");
}

static void Host_Setinfo_f (void)
{
	const char *key = Cmd_Argv (1);
	const char *val = Cmd_Argv (2);

	if (cmd_source == src_client)
	{ // clc_stringcmd version
		if (Cmd_Argc () != 3)
		{
			SV_ClientPrintf ("Your Serverside User Info:\n");
			Info_Enumerate (host_client->userinfo, Info_ClientPrint_Callback, NULL);
		}
		else
		{
			if (*key == '*')
				return; // users may not change * keys (beyond initial connection anyway).
			SV_UpdateInfo ((host_client - svs.clients) + 1, key, val);
		}
	}
	else
	{ // console version
		if (Cmd_Argc () != 3)
		{
			Con_Printf ("User Info:\n");
			Info_Print (cls.userinfo);
		}
		else
		{
			cvar_t *var = Cvar_FindVar (key);
			if (var && var->flags & CVAR_USERINFO)
				Cvar_Set (key, val);
			else
			{
				Info_SetKey (cls.userinfo, sizeof (cls.userinfo), key, val);
				if (cls.state == ca_connected)
					Cmd_ForwardToServer ();
			}
		}
	}
}
static void Host_User_f (void)
{
	/*if (sv.active)
	{
		int i;
		if (Cmd_Argc() == 2)
		{
			i = atoi(Cmd_Argv(1));

			if (i >= cl.maxclients)
				return;	//not a valid slot.

			Con_Printf("User %i (%s):\n", i, svs.clients[i].name);
			Info_Print(svs.clients[i].userinfo);
		}
		else
		{
			for (i = 0; i < svs.maxclients; i++)
			{
				if (*svs.clients[i].name)
				{
					Con_Printf("User %i (%s):\n", i, svs.clients[i].name);
					Info_Print(svs.clients[i].userinfo);
				}
			}
		}
	}
	else*/
	if (cls.state == ca_connected)
	{
		int i;
		if (Cmd_Argc () == 2)
		{
			i = atoi (Cmd_Argv (1));

			if (i >= cl.maxclients)
				return; // not a valid slot.

			Con_Printf ("User %i (%s):\n", i, cl.scores[i].name);
			Info_Print (cl.scores[i].userinfo);
		}
		else
		{
			for (i = 0; i < cl.maxclients; i++)
			{
				if (*cl.scores[i].name)
				{
					Con_Printf ("User %i (%s):\n", i, cl.scores[i].name);
					Info_Print (cl.scores[i].userinfo);
				}
			}
		}
	}
}

//=============================================================================

/*
==================
Host_InitCommands
==================
*/
void Host_InitCommands (void)
{
	Cmd_AddCommand ("maps", Host_Maps_f);		// johnfitz
	Cmd_AddCommand ("mods", Host_Mods_f);		// johnfitz
	Cmd_AddCommand ("games", Host_Mods_f);		// as an alias to "mods" -- S.A. / QuakeSpasm
	Cmd_AddCommand ("mapname", Host_Mapname_f); // johnfitz
	Cmd_AddCommand ("randmap", Host_Randmap_f); // ericw

	Cmd_AddCommand_ClientCommand ("serverinfo", Host_Serverinfo_f); // spike
	Cmd_AddCommand_ClientCommand ("setinfo", Host_Setinfo_f);		// spike
	Cmd_AddCommand ("user", Host_User_f);							// spike

	Cmd_AddCommand ("status", Host_Status_f);
	Cmd_AddCommand ("quit", Host_Quit_f);
	Cmd_AddCommand ("god", Host_God_f);
	Cmd_AddCommand ("notarget", Host_Notarget_f);
	Cmd_AddCommand ("fly", Host_Fly_f);
	Cmd_AddCommand ("map", Host_Map_f);
	Cmd_AddCommand ("restart", Host_Restart_f);
	Cmd_AddCommand ("changelevel", Host_Changelevel_f);
	Cmd_AddCommand ("connect", Host_Connect_f);
	Cmd_AddCommand ("reconnect", Host_Reconnect_f);
	Cmd_AddCommand ("name", Host_Name_f);
	Cmd_AddCommand ("noclip", Host_Noclip_f);
	Cmd_AddCommand ("setpos", Host_SetPos_f); // QuakeSpasm

	Cmd_AddCommand ("say", Host_Say_f);
	Cmd_AddCommand ("say_team", Host_Say_Team_f);
	Cmd_AddCommand ("tell", Host_Tell_f);
	Cmd_AddCommand ("color", Host_Color_f);
	Cmd_AddCommand ("kill", Host_Kill_f);
	Cmd_AddCommand ("pause", Host_Pause_f);
	Cmd_AddCommand ("spawn", Host_Spawn_f);
	Cmd_AddCommand ("begin", Host_Begin_f);
	Cmd_AddCommand ("prespawn", Host_PreSpawn_f);
	Cmd_AddCommand ("kick", Host_Kick_f);
	Cmd_AddCommand ("ping", Host_Ping_f);
	Cmd_AddCommand ("load", Host_Loadgame_f);
	Cmd_AddCommand ("fastload", Host_Loadgame_f);
	Cmd_AddCommand ("save", Host_Savegame_f);
	Cmd_AddCommand ("give", Host_Give_f);

	Cmd_AddCommand ("startdemos", Host_Startdemos_f);
	Cmd_AddCommand ("demos", Host_Demos_f);
	Cmd_AddCommand ("stopdemo", Host_Stopdemo_f);

	Cmd_AddCommand ("viewmodel", Host_Viewmodel_f);
	Cmd_AddCommand ("viewframe", Host_Viewframe_f);
	Cmd_AddCommand ("viewnext", Host_Viewnext_f);
	Cmd_AddCommand ("viewprev", Host_Viewprev_f);

	Cmd_AddCommand ("mcache", Mod_Print);
}
==> Starting build()...
vkQuake-1.36.0 has no wrap files
+ exec meson setup --prefix /usr --libexecdir lib --sbindir bin --buildtype plain --auto-features enabled --wrap-mode nodownload -D b_lto=false -D b_pie=true -D python.bytecompile=1 build -D do_userdirs=enabled -D mp3_lib=mpg123 -D use_codec_flac=enabled -D use_codec_mp3=enabled -D use_codec_opus=enabled -D use_codec_vorbis=enabled -D vorbis_lib=vorbis vkQuake-1.36.0
The Meson build system
Version: 1.12.0
Source dir: /build/quake/src/vkQuake-1.36.0
Build dir: /build/quake/src/build
Build type: native build
Project name: vkquake
Project version: undefined
C compiler for the host machine: cc (gcc 16.1.1 "aarch64-unknown-linux-gnu-gcc (GCC) 16.1.1 20260430")
C linker for the host machine: cc ld.bfd 2.46.0
Host machine cpu family: aarch64
Host machine cpu: aarch64
Compiler for C supports arguments -fno-omit-frame-pointer: YES 
Compiler for C supports arguments /Oy-: NO 
Header "sched.h" has symbol "CPU_ZERO" : YES 
Message: Info: Task affinity support enabled.
Found pkg-config: YES (/usr/bin/pkg-config) 3.0.7
Run-time dependency sdl3 found: YES 3.4.16
Message: Info: Using SDL3.
Program glslangValidator found: YES (/usr/bin/glslangValidator)
Program spirv-opt found: YES (/usr/bin/spirv-opt)
Compiler for C supports arguments -Wno-trigraphs: YES 
Compiler for C supports arguments -Wno-microsoft-enum-forward-reference: NO 
Library m found: YES
Library dl found: YES
Run-time dependency threads found: YES
Run-time dependency vulkan found: YES 1.4.357
Run-time dependency libmpg123 found: YES 1.33.7
Run-time dependency flac found: YES 1.5.0
Run-time dependency ogg found: YES 1.3.6
Run-time dependency vorbisfile found: YES 1.3.7
Run-time dependency vorbis found: YES 1.3.7
Run-time dependency opus found: YES 1.6.1
Run-time dependency opusfile found: YES 0.12
Build targets in project: 206

vkquake undefined

  User defined options
    auto_features     : enabled
    b_lto             : false
    b_pie             : true
    buildtype         : plain
    do_userdirs       : enabled
    libexecdir        : lib
    mp3_lib           : mpg123
    prefix            : /usr
    python.bytecompile: 1
    sbindir           : bin
    use_codec_flac    : enabled
    use_codec_mp3     : enabled
    use_codec_opus    : enabled
    use_codec_vorbis  : enabled
    vorbis_lib        : vorbis
    wrap_mode         : nodownload

Found ninja-1.13.2 at /usr/bin/ninja

Generating targets:   0%|          | 0/206 eta ?
Generating targets: 100%|██████████| 206/206 eta 00:00
                                                      

Writing build.ninja:   0%|          | 0/389 eta ?
                                                 
ninja: Entering directory `/build/quake/src/build'
[1/363] Compiling C object mkpak.p/Misc_vq_pak_mkpak.c.o
[2/363] Linking target mkpak
[3/363] Generating draw_pic_alphatest_frag_raw_spv with a custom command
[4/363] Generating draw_pic_frag_raw_spv with a custom command
[5/363] Generating alias_vert_raw_spv with a custom command
[6/363] Generating basic_alphatest_frag_raw_spv with a custom command
[7/363] Generating basic_vert_raw_spv with a custom command
[8/363] Generating md5_vert_raw_spv with a custom command
[9/363] Generating draw_pic_xbr_frag_raw_spv with a custom command
[10/363] Generating basic_notex_frag_raw_spv with a custom command
[11/363] Generating draw_pic_xbr_alphatest_frag_raw_spv with a custom command
[12/363] Generating draw_pic_xbr_vert_raw_spv with a custom command
[13/363] Generating cs_tex_warp_comp_raw_spv with a custom command
[14/363] Generating postprocess_frag_raw_spv with a custom command
[15/363] Compiling C object bintoc.p/Shaders_bintoc.c.o
[16/363] Generating indirect_clear_comp_raw_spv with a custom command
[17/363] Generating indirect_comp_raw_spv with a custom command
[18/363] Generating showtris_frag_raw_spv with a custom command
[19/363] Generating postprocess_vert_raw_spv with a custom command
[20/363] Generating showtris_vert_raw_spv with a custom command
[21/363] Generating md5_debug_vert_raw_spv with a custom command
[22/363] Generating sky_box_frag_raw_spv with a custom command
[23/363] Generating world_vert_raw_spv with a custom command
[24/363] Generating sky_layer_vert_raw_spv with a custom command
[25/363] Generating sky_layer_frag_raw_spv with a custom command
[26/363] Generating ray_debug_comp_raw_spv with a custom command
[27/363] Generating mesh_interpolate_comp_raw_spv with a custom command
[28/363] Generating sky_cube_vert_raw_spv with a custom command
[29/363] Generating skinning_comp_raw_spv with a custom command
[30/363] Generating basic_oit_frag_raw_spv with a custom command
[31/363] Generating sky_cube_frag_raw_spv with a custom command
[32/363] Generating basic_mboit_moment_frag_raw_spv with a custom command
[33/363] Generating basic_mboit_composite_frag_raw_spv with a custom command
[34/363] Generating basic_frag_raw_spv with a custom command
[35/363] Generating basic_mboit_composite_msaa_frag_raw_spv with a custom command
[36/363] Generating world_frag_raw_spv with a custom command
[37/363] Generating world_oit_frag_raw_spv with a custom command
[38/363] Generating world_mboit_moment_frag_raw_spv with a custom command
[39/363] Generating world_mboit_composite_frag_raw_spv with a custom command
[40/363] Generating alias_frag_raw_spv with a custom command
[41/363] Generating alias_alphatest_frag_raw_spv with a custom command
[42/363] Generating alias_alphatest_mboit_moment_frag_raw_spv with a custom command
[43/363] Generating alias_oit_frag_raw_spv with a custom command
[44/363] Generating alias_mboit_composite_frag_raw_spv with a custom command
[45/363] Generating alias_mboit_moment_frag_raw_spv with a custom command
[46/363] Generating alias_alphatest_mboit_composite_frag_raw_spv with a custom command
[47/363] Generating world_mboit_composite_msaa_frag_raw_spv with a custom command
[48/363] Generating alias_mboit_composite_msaa_frag_raw_spv with a custom command
[49/363] Generating alias_alphatest_oit_frag_raw_spv with a custom command
[50/363] Generating alias_alphatest_mboit_composite_msaa_frag_raw_spv with a custom command
[51/363] Generating md5_mboit_composite_msaa_frag_raw_spv with a custom command
[52/363] Generating md5_alphatest_mboit_composite_msaa_frag_raw_spv with a custom command
[53/363] Generating md5_8_vert_raw_spv with a custom command
[54/363] Generating wboit_resolve_frag_raw_spv with a custom command
[55/363] Generating md5_mboit_composite_frag_raw_spv with a custom command
[56/363] Generating md5_alphatest_mboit_composite_frag_raw_spv with a custom command
[57/363] Generating wboit_resolve_msaa_frag_raw_spv with a custom command
[58/363] Generating mboit_resolve_frag_raw_spv with a custom command
[59/363] Generating mboit_resolve_msaa_frag_raw_spv with a custom command
[60/363] Generating screen_effects_8bit_scale_comp_raw_spv with a custom command
[61/363] Generating screen_effects_10bit_comp_raw_spv with a custom command
[62/363] Generating screen_effects_10bit_scale_comp_raw_spv with a custom command
[63/363] Generating screen_effects_8bit_scale_sops_comp_raw_spv with a custom command
[64/363] Generating run-mkpak with a custom command
[65/363] Linking target bintoc
[66/363] Generating alias_vert_spv with a custom command
[67/363] Generating screen_effects_8bit_comp_raw_spv with a custom command
[68/363] Generating basic_alphatest_frag_spv with a custom command
[69/363] Generating screen_effects_10bit_scale_sops_comp_raw_spv with a custom command
[70/363] Generating basic_vert_spv with a custom command
[71/363] Generating md5_vert_spv with a custom command
[72/363] Generating basic_notex_frag_spv with a custom command
[73/363] Generating draw_pic_frag_spv with a custom command
[74/363] Generating draw_pic_xbr_vert_spv with a custom command
[75/363] Generating draw_pic_alphatest_frag_spv with a custom command
[76/363] Generating cs_tex_warp_comp_spv with a custom command
[77/363] Generating update_lightmap_8bit_rt_comp_raw_spv with a custom command
[78/363] Generating indirect_comp_spv with a custom command
[79/363] Generating indirect_clear_comp_spv with a custom command
[80/363] Generating postprocess_frag_spv with a custom command
[81/363] Generating showtris_frag_spv with a custom command
[82/363] Generating postprocess_vert_spv with a custom command
[83/363] Generating md5_debug_vert_spv with a custom command
[84/363] Generating showtris_vert_spv with a custom command
[85/363] Generating sky_box_frag_spv with a custom command
[86/363] Generating sky_layer_vert_spv with a custom command
[87/363] Generating sky_cube_vert_spv with a custom command
[88/363] Generating sky_cube_frag_spv with a custom command
[89/363] Generating sky_layer_frag_spv with a custom command
[90/363] Generating mesh_interpolate_comp_spv with a custom command
[91/363] Generating draw_pic_xbr_alphatest_frag_spv with a custom command
[92/363] Generating world_vert_spv with a custom command
[93/363] Generating ray_debug_comp_spv with a custom command
[94/363] Generating draw_pic_xbr_frag_spv with a custom command
[95/363] Generating basic_mboit_moment_frag_spv with a custom command
[96/363] Generating skinning_comp_spv with a custom command
[97/363] Generating basic_frag_spv with a custom command
[98/363] Generating basic_oit_frag_spv with a custom command
[99/363] Generating world_frag_spv with a custom command
[100/363] Generating basic_mboit_composite_msaa_frag_spv with a custom command
[101/363] Generating basic_mboit_composite_frag_spv with a custom command
[102/363] Generating update_lightmap_8bit_comp_raw_spv with a custom command
[103/363] Generating world_oit_frag_spv with a custom command
[104/363] Generating alias_frag_spv with a custom command
[105/363] Generating world_mboit_moment_frag_spv with a custom command
[106/363] Generating alias_alphatest_frag_spv with a custom command
[107/363] Generating alias_oit_frag_spv with a custom command
[108/363] Generating alias_alphatest_oit_frag_spv with a custom command
[109/363] Generating alias_mboit_moment_frag_spv with a custom command
[110/363] Generating world_mboit_composite_frag_spv with a custom command
[111/363] Generating world_mboit_composite_msaa_frag_spv with a custom command
[112/363] Generating update_lightmap_10bit_comp_raw_spv with a custom command
[113/363] Generating alias_alphatest_mboit_moment_frag_spv with a custom command
[114/363] Generating alias_alphatest_mboit_composite_frag_spv with a custom command
[115/363] Generating alias_alphatest_mboit_composite_msaa_frag_spv with a custom command
[116/363] Generating alias_mboit_composite_frag_spv with a custom command
[117/363] Generating update_lightmap_10bit_rt_comp_raw_spv with a custom command
[118/363] Generating alias_mboit_composite_msaa_frag_spv with a custom command
[119/363] Generating md5_mboit_composite_frag_spv with a custom command
[120/363] Generating md5_alphatest_mboit_composite_frag_spv with a custom command
[121/363] Generating mboit_resolve_frag_spv with a custom command
[122/363] Generating wboit_resolve_frag_spv with a custom command
[123/363] Generating md5_mboit_composite_msaa_frag_spv with a custom command
[124/363] Generating mboit_resolve_msaa_frag_spv with a custom command
[125/363] Generating md5_alphatest_mboit_composite_msaa_frag_spv with a custom command
[126/363] Generating wboit_resolve_msaa_frag_spv with a custom command
[127/363] Generating md5_8_vert_spv with a custom command
[128/363] Generating screen_effects_8bit_comp_spv with a custom command
[129/363] Generating screen_effects_10bit_comp_spv with a custom command
[130/363] Generating screen_effects_8bit_scale_comp_spv with a custom command
[131/363] Generating screen_effects_10bit_scale_comp_spv with a custom command
[132/363] Generating alias_vert_c with a custom command
[133/363] Generating basic_vert_c with a custom command
[134/363] Generating screen_effects_8bit_scale_sops_comp_spv with a custom command
[135/363] Generating md5_vert_c with a custom command
[136/363] Generating basic_alphatest_frag_c with a custom command
[137/363] Generating draw_pic_frag_c with a custom command
[138/363] Generating basic_notex_frag_c with a custom command
[139/363] Generating draw_pic_alphatest_frag_c with a custom command
[140/363] Generating draw_pic_xbr_frag_c with a custom command
[141/363] Generating draw_pic_xbr_alphatest_frag_c with a custom command
[142/363] Generating draw_pic_xbr_vert_c with a custom command
[143/363] Generating cs_tex_warp_comp_c with a custom command
[144/363] Generating indirect_comp_c with a custom command
[145/363] Generating indirect_clear_comp_c with a custom command
[146/363] Generating postprocess_frag_c with a custom command
[147/363] Generating skinning_8_comp_raw_spv with a custom command
[148/363] Generating postprocess_vert_c with a custom command
[149/363] Generating showtris_frag_c with a custom command
[150/363] Generating showtris_vert_c with a custom command
[151/363] Generating sky_box_frag_c with a custom command
[152/363] Generating update_lightmap_8bit_rt_comp_spv with a custom command
[153/363] Generating sky_cube_frag_c with a custom command
[154/363] Generating sky_cube_vert_c with a custom command
[155/363] Generating md5_debug_vert_c with a custom command
[156/363] Generating sky_layer_frag_c with a custom command
[157/363] Generating sky_layer_vert_c with a custom command
[158/363] Generating world_vert_c with a custom command
[159/363] Generating ray_debug_comp_c with a custom command
[160/363] Generating update_lightmap_10bit_comp_spv with a custom command
[161/363] Generating screen_effects_10bit_scale_sops_comp_spv with a custom command
[162/363] Generating skinning_8_comp_spv with a custom command
[163/363] Generating update_lightmap_8bit_comp_spv with a custom command
[164/363] Generating basic_frag_c with a custom command
[165/363] Generating mesh_interpolate_comp_c with a custom command
[166/363] Generating skinning_comp_c with a custom command
[167/363] Generating basic_oit_frag_c with a custom command
[168/363] Generating basic_mboit_moment_frag_c with a custom command
[169/363] Generating basic_mboit_composite_frag_c with a custom command
[170/363] Generating basic_mboit_composite_msaa_frag_c with a custom command
[171/363] Generating update_lightmap_10bit_rt_comp_spv with a custom command
[172/363] Generating world_frag_c with a custom command
[173/363] Generating world_oit_frag_c with a custom command
[174/363] Generating world_mboit_moment_frag_c with a custom command
[175/363] Generating world_mboit_composite_frag_c with a custom command
[176/363] Generating world_mboit_composite_msaa_frag_c with a custom command
[177/363] Generating alias_frag_c with a custom command
[178/363] Generating alias_alphatest_frag_c with a custom command
[179/363] Generating alias_alphatest_oit_frag_c with a custom command
[180/363] Generating alias_mboit_moment_frag_c with a custom command
[181/363] Generating alias_oit_frag_c with a custom command
[182/363] Generating alias_alphatest_mboit_moment_frag_c with a custom command
[183/363] Generating alias_mboit_composite_frag_c with a custom command
[184/363] Generating alias_alphatest_mboit_composite_frag_c with a custom command
[185/363] Generating md5_mboit_composite_msaa_frag_c with a custom command
[186/363] Generating md5_alphatest_mboit_composite_frag_c with a custom command
[187/363] Generating md5_alphatest_mboit_composite_msaa_frag_c with a custom command
[188/363] Generating md5_8_vert_c with a custom command
[189/363] Generating alias_mboit_composite_msaa_frag_c with a custom command
[190/363] Generating alias_alphatest_mboit_composite_msaa_frag_c with a custom command
[191/363] Generating wboit_resolve_frag_c with a custom command
[192/363] Generating md5_mboit_composite_frag_c with a custom command
[193/363] Generating wboit_resolve_msaa_frag_c with a custom command
[194/363] Generating mboit_resolve_frag_c with a custom command
[195/363] Generating mboit_resolve_msaa_frag_c with a custom command
[196/363] Generating screen_effects_8bit_comp_c with a custom command
[197/363] Generating screen_effects_8bit_scale_sops_comp_c with a custom command
[198/363] Generating run-embed_vkquake_pak with a custom command
[199/363] Generating screen_effects_10bit_scale_comp_c with a custom command
[200/363] Generating screen_effects_10bit_scale_sops_comp_c with a custom command
[201/363] Generating update_lightmap_8bit_rt_comp_c with a custom command
[202/363] Generating screen_effects_10bit_comp_c with a custom command
[203/363] Generating update_lightmap_8bit_comp_c with a custom command
[204/363] Generating screen_effects_8bit_scale_comp_c with a custom command
[205/363] Generating skinning_8_comp_c with a custom command
[206/363] Generating update_lightmap_10bit_comp_c with a custom command
[207/363] Generating update_lightmap_10bit_rt_comp_c with a custom command
[208/363] Precompiling header ../vkQuake-1.36.0/Quake/quakedef.h
[209/363] Compiling C object vkquake.p/meson-generated_.._alias.vert.c.o
distcc[1407] ERROR: compile alias.vert.c on 10.3.0.16:3932/8 failed
distcc[1407] (dcc_build_somewhere) Warning: remote compilation of 'alias.vert.c' failed, retrying locally
distcc[1407] Warning: failed to distribute alias.vert.c to 10.3.0.16:3932/8, running locally instead
distcc[1407] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'alias.vert.c' failed, retried locally and got a different result.
[210/363] Compiling C object vkquake.p/meson-generated_.._basic.vert.c.o
distcc[1409] ERROR: compile basic.vert.c on 10.3.0.15:3932/8 failed
distcc[1409] (dcc_build_somewhere) Warning: remote compilation of 'basic.vert.c' failed, retrying locally
distcc[1409] Warning: failed to distribute basic.vert.c to 10.3.0.15:3932/8, running locally instead
distcc[1409] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'basic.vert.c' failed, retried locally and got a different result.
[211/363] Compiling C object vkquake.p/meson-generated_.._basic_notex.frag.c.o
distcc[1411] ERROR: compile basic_notex.frag.c on 10.3.0.15:3932/8 failed
distcc[1411] (dcc_build_somewhere) Warning: remote compilation of 'basic_notex.frag.c' failed, retrying locally
distcc[1411] Warning: failed to distribute basic_notex.frag.c to 10.3.0.15:3932/8, running locally instead
distcc[1411] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'basic_notex.frag.c' failed, retried locally and got a different result.
[212/363] Compiling C object vkquake.p/meson-generated_.._draw_pic_xbr.vert.c.o
distcc[1444] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[213/363] Compiling C object vkquake.p/meson-generated_.._cs_tex_warp.comp.c.o
distcc[1445] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[214/363] Compiling C object vkquake.p/meson-generated_.._indirect.comp.c.o
distcc[1446] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[215/363] Compiling C object vkquake.p/meson-generated_.._embedded_pak.c.o
distcc[1406] ERROR: compile embedded_pak.c on 10.3.0.16:3932/8 failed
distcc[1406] (dcc_build_somewhere) Warning: remote compilation of 'embedded_pak.c' failed, retrying locally
distcc[1406] Warning: failed to distribute embedded_pak.c to 10.3.0.16:3932/8, running locally instead
distcc[1406] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'embedded_pak.c' failed, retried locally and got a different result.
[216/363] Compiling C object vkquake.p/meson-generated_.._postprocess.frag.c.o
distcc[1457] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[217/363] Compiling C object vkquake.p/meson-generated_.._indirect_clear.comp.c.o
distcc[1456] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[218/363] Compiling C object vkquake.p/meson-generated_.._postprocess.vert.c.o
distcc[1458] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[219/363] Compiling C object vkquake.p/meson-generated_.._showtris.frag.c.o
distcc[1468] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[220/363] Compiling C object vkquake.p/meson-generated_.._showtris.vert.c.o
distcc[1472] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[221/363] Compiling C object vkquake.p/meson-generated_.._sky_box.frag.c.o
distcc[1474] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[222/363] Compiling C object vkquake.p/meson-generated_.._md5_debug.vert.c.o
distcc[1473] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[223/363] Compiling C object vkquake.p/meson-generated_.._sky_cube.frag.c.o
distcc[1478] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[224/363] Compiling C object vkquake.p/meson-generated_.._world.vert.c.o
distcc[1491] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[225/363] Compiling C object vkquake.p/meson-generated_.._sky_layer.vert.c.o
distcc[1490] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[226/363] Compiling C object vkquake.p/meson-generated_.._sky_cube.vert.c.o
distcc[1488] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[227/363] Compiling C object vkquake.p/meson-generated_.._sky_layer.frag.c.o
distcc[1489] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[228/363] Compiling C object vkquake.p/meson-generated_.._mesh_interpolate.comp.c.o
distcc[1505] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[229/363] Compiling C object vkquake.p/meson-generated_.._ray_debug.comp.c.o
distcc[1504] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[230/363] Compiling C object vkquake.p/meson-generated_.._skinning.comp.c.o
distcc[1506] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[231/363] Compiling C object vkquake.p/meson-generated_.._basic.frag.c.o
distcc[1507] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[232/363] Compiling C object vkquake.p/meson-generated_.._basic_oit.frag.c.o
distcc[1524] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[233/363] Compiling C object vkquake.p/meson-generated_.._basic_mboit_moment.frag.c.o
distcc[1525] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[234/363] Compiling C object vkquake.p/meson-generated_.._basic_alphatest.frag.c.o
distcc[1410] ERROR: compile basic_alphatest.frag.c on 10.3.0.16:3932/8 failed
distcc[1410] (dcc_build_somewhere) Warning: remote compilation of 'basic_alphatest.frag.c' failed, retrying locally
distcc[1410] Warning: failed to distribute basic_alphatest.frag.c to 10.3.0.16:3932/8, running locally instead
distcc[1410] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'basic_alphatest.frag.c' failed, retried locally and got a different result.
[235/363] Compiling C object vkquake.p/meson-generated_.._draw_pic.frag.c.o
distcc[1412] ERROR: compile draw_pic.frag.c on 10.3.0.16:3932/8 failed
distcc[1412] (dcc_build_somewhere) Warning: remote compilation of 'draw_pic.frag.c' failed, retrying locally
distcc[1412] Warning: failed to distribute draw_pic.frag.c to 10.3.0.16:3932/8, running locally instead
distcc[1412] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'draw_pic.frag.c' failed, retried locally and got a different result.
[236/363] Compiling C object vkquake.p/meson-generated_.._world_mboit_moment.frag.c.o
distcc[1542] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[237/363] Compiling C object vkquake.p/meson-generated_.._world.frag.c.o
distcc[1540] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[238/363] Compiling C object vkquake.p/meson-generated_.._world_oit.frag.c.o
distcc[1541] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[239/363] Compiling C object vkquake.p/meson-generated_.._world_mboit_composite.frag.c.o
distcc[1543] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[240/363] Compiling C object vkquake.p/meson-generated_.._alias.frag.c.o
distcc[1557] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[241/363] Compiling C object vkquake.p/meson-generated_.._alias_alphatest.frag.c.o
distcc[1558] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[242/363] Compiling C object vkquake.p/meson-generated_.._alias_oit.frag.c.o
distcc[1559] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[243/363] Compiling C object vkquake.p/meson-generated_.._world_mboit_composite_msaa.frag.c.o
distcc[1556] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[244/363] Compiling C object vkquake.p/meson-generated_.._alias_mboit_moment.frag.c.o
distcc[1573] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[245/363] Compiling C object vkquake.p/meson-generated_.._alias_mboit_composite.frag.c.o
distcc[1575] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[246/363] Compiling C object vkquake.p/meson-generated_.._alias_alphatest_oit.frag.c.o
distcc[1572] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[247/363] Compiling C object vkquake.p/meson-generated_.._alias_alphatest_mboit_moment.frag.c.o
distcc[1574] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[248/363] Compiling C object vkquake.p/meson-generated_.._alias_alphatest_mboit_composite.frag.c.o
distcc[1588] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[249/363] Compiling C object vkquake.p/meson-generated_.._alias_mboit_composite_msaa.frag.c.o
distcc[1589] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[250/363] Compiling C object vkquake.p/meson-generated_.._alias_alphatest_mboit_composite_msaa.frag.c.o
distcc[1590] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[251/363] Compiling C object vkquake.p/meson-generated_.._md5_mboit_composite.frag.c.o
distcc[1591] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[252/363] Compiling C object vkquake.p/meson-generated_.._md5_alphatest_mboit_composite.frag.c.o
distcc[1604] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[253/363] Compiling C object vkquake.p/meson-generated_.._md5_mboit_composite_msaa.frag.c.o
distcc[1605] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[254/363] Compiling C object vkquake.p/meson-generated_.._md5_alphatest_mboit_composite_msaa.frag.c.o
distcc[1606] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[255/363] Compiling C object vkquake.p/meson-generated_.._md5_8.vert.c.o
distcc[1607] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[256/363] Compiling C object vkquake.p/meson-generated_.._wboit_resolve.frag.c.o
distcc[1620] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[257/363] Compiling C object vkquake.p/meson-generated_.._draw_pic_alphatest.frag.c.o
distcc[1413] ERROR: compile draw_pic_alphatest.frag.c on 10.3.0.16:3932/8 failed
distcc[1413] (dcc_build_somewhere) Warning: remote compilation of 'draw_pic_alphatest.frag.c' failed, retrying locally
distcc[1413] Warning: failed to distribute draw_pic_alphatest.frag.c to 10.3.0.16:3932/8, running locally instead
distcc[1413] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'draw_pic_alphatest.frag.c' failed, retried locally and got a different result.
[258/363] Compiling C object vkquake.p/meson-generated_.._wboit_resolve_msaa.frag.c.o
distcc[1621] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[259/363] Compiling C object vkquake.p/meson-generated_.._mboit_resolve.frag.c.o
distcc[1622] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[260/363] Compiling C object vkquake.p/meson-generated_.._screen_effects_8bit.comp.c.o
distcc[1636] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[261/363] Compiling C object vkquake.p/meson-generated_.._screen_effects_8bit_scale.comp.c.o
distcc[1637] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[262/363] Compiling C object vkquake.p/meson-generated_.._screen_effects_10bit.comp.c.o
distcc[1639] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[263/363] Compiling C object vkquake.p/meson-generated_.._screen_effects_8bit_scale_sops.comp.c.o
distcc[1638] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[264/363] Compiling C object vkquake.p/meson-generated_.._screen_effects_10bit_scale_sops.comp.c.o
distcc[1653] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[265/363] Compiling C object vkquake.p/meson-generated_.._screen_effects_10bit_scale.comp.c.o
distcc[1652] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[266/363] Compiling C object vkquake.p/meson-generated_.._update_lightmap_8bit_rt.comp.c.o
distcc[1655] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[267/363] Compiling C object vkquake.p/meson-generated_.._update_lightmap_8bit.comp.c.o
distcc[1654] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[268/363] Compiling C object vkquake.p/meson-generated_.._skinning_8.comp.c.o
distcc[1670] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[269/363] Compiling C object vkquake.p/meson-generated_.._update_lightmap_10bit.comp.c.o
distcc[1668] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[270/363] Compiling C object vkquake.p/meson-generated_.._update_lightmap_10bit_rt.comp.c.o
distcc[1669] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[271/363] Compiling C object vkquake.p/Quake_cd_null.c.o
distcc[1684] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[272/363] Compiling C object vkquake.p/Quake_chase.c.o
distcc[1686] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[273/363] Compiling C object vkquake.p/Quake_cfgfile.c.o
distcc[1685] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[274/363] Compiling C object vkquake.p/Quake_bgmusic.c.o
distcc[1671] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[275/363] Compiling C object vkquake.p/meson-generated_.._draw_pic_xbr_alphatest.frag.c.o
distcc[1415] ERROR: compile draw_pic_xbr_alphatest.frag.c on 10.3.0.15:3932/8 failed
distcc[1415] (dcc_build_somewhere) Warning: remote compilation of 'draw_pic_xbr_alphatest.frag.c' failed, retrying locally
distcc[1415] Warning: failed to distribute draw_pic_xbr_alphatest.frag.c to 10.3.0.15:3932/8, running locally instead
distcc[1415] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'draw_pic_xbr_alphatest.frag.c' failed, retried locally and got a different result.
[276/363] Compiling C object vkquake.p/Quake_cl_demo.c.o
distcc[1696] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[277/363] Compiling C object vkquake.p/Quake_cl_tent.c.o
distcc[1712] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[278/363] Compiling C object vkquake.p/Quake_cl_input.c.o
distcc[1700] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[279/363] Compiling C object vkquake.p/Quake_cmd.c.o
distcc[1716] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[280/363] Compiling C object vkquake.p/Quake_crc.c.o
distcc[1728] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[281/363] Compiling C object vkquake.p/Quake_cl_parse.c.o
distcc[1708] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[282/363] Compiling C object vkquake.p/Quake_cvar.c.o
distcc[1732] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[283/363] Compiling C object vkquake.p/Quake_gl_fog.c.o
distcc[1740] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[284/363] Compiling C object vkquake.p/Quake_console.c.o
distcc[1724] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[285/363] Compiling C object vkquake.p/Quake_gl_heap.c.o
distcc[1744] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[286/363] Compiling C object vkquake.p/Quake_gl_draw.c.o
distcc[1736] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[287/363] Compiling C object vkquake.p/Quake_gl_refrag.c.o
distcc[1756] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[288/363] Compiling C object vkquake.p/Quake_gl_mesh.c.o
distcc[1748] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[289/363] Compiling C object vkquake.p/Quake_gl_rlight.c.o
distcc[1760] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[290/363] Compiling C object vkquake.p/Quake_gl_rmain.c.o
distcc[1764] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[291/363] Compiling C object vkquake.p/Quake_gl_screen.c.o
distcc[1772] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[292/363] Compiling C object vkquake.p/Quake_gl_sky.c.o
distcc[1776] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[293/363] Compiling C object vkquake.p/Quake_gl_rmisc.c.o
distcc[1768] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[294/363] Compiling C object vkquake.p/Quake_common.c.o
distcc[1720] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[295/363] Compiling C object vkquake.p/Quake_cl_main.c.o
distcc[1704] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[296/363] Compiling C object vkquake.p/Quake_gl_model.c.o
distcc[1752] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[297/363] Compiling C object vkquake.p/Quake_gl_warp.c.o
distcc[1788] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[298/363] Compiling C object vkquake.p/Quake_host.c.o
distcc[1792] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[299/363] Compiling C object vkquake.p/Quake_json.c.o
distcc[1804] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[300/363] Compiling C object vkquake.p/Quake_in_sdl.c.o
distcc[1808] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[301/363] Compiling C object vkquake.p/Quake_in_sdl2.c.o
distcc[1812] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[302/363] Compiling C object vkquake.p/Quake_in_sdl3.c.o
distcc[1816] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[303/363] Compiling C object vkquake.p/Quake_host_cmd.c.o
distcc[1796] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[304/363] Compiling C object vkquake.p/Quake_main_sdl.c.o
distcc[1824] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[305/363] Compiling C object vkquake.p/Quake_keys.c.o
distcc[1820] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[306/363] Compiling C object vkquake.p/Quake_gl_vidsdl.c.o
distcc[1784] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[307/363] Compiling C object vkquake.p/Quake_mdfour.c.o
distcc[1832] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[308/363] Compiling C object vkquake.p/Quake_mathlib.c.o
distcc[1828] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[309/363] Compiling C object vkquake.p/Quake_net_dgrm.c.o
distcc[1844] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[310/363] Compiling C object vkquake.p/Quake_net_loop.c.o
distcc[1848] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[311/363] Compiling C object vkquake.p/Quake_net_main.c.o
distcc[1852] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[312/363] Compiling C object vkquake.p/Quake_palette.c.o
distcc[1856] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[313/363] Compiling C object vkquake.p/Quake_pr_cmds.c.o
distcc[1860] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[314/363] Compiling C object vkquake.p/Quake_menu.c.o
distcc[1840] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[315/363] Compiling C object vkquake.p/Quake_pr_exec.c.o
distcc[1868] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[316/363] Compiling C object vkquake.p/Quake_image.c.o
distcc[1800] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[317/363] Compiling C object vkquake.p/Quake_pr_edict.c.o
distcc[1864] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[318/363] Compiling C object vkquake.p/Quake_r_alias.c.o
distcc[1876] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[319/363] Compiling C object vkquake.p/Quake_r_part.c.o
distcc[1884] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[320/363] Compiling C object vkquake.p/Quake_r_brush.c.o
distcc[1880] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[321/363] Compiling C object vkquake.p/Quake_r_sprite.c.o
distcc[1892] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[322/363] Compiling C object vkquake.p/Quake_pr_ext.c.o
distcc[1872] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[323/363] Compiling C object vkquake.p/Quake_mem.c.o
distcc[1836] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[324/363] Compiling C object vkquake.p/Quake_snd_codec.c.o
distcc[1904] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[325/363] Compiling C object vkquake.p/meson-generated_.._basic_mboit_composite_msaa.frag.c.o
distcc[1527] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[326/363] Compiling C object vkquake.p/Quake_r_world.c.o
distcc[1896] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[327/363] Compiling C object vkquake.p/Quake_snd_mem.c.o
distcc[1912] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[328/363] Compiling C object vkquake.p/Quake_snd_sdl.c.o
distcc[1920] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[329/363] Compiling C object vkquake.p/Quake_snd_sdl3.c.o
distcc[1924] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[330/363] Compiling C object vkquake.p/Quake_snd_umx.c.o
distcc[1928] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[331/363] Compiling C object vkquake.p/Quake_snd_mix.c.o
distcc[1916] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[332/363] Compiling C object vkquake.p/Quake_snd_wave.c.o
distcc[1932] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[333/363] Compiling C object vkquake.p/Quake_strlcat.c.o
distcc[1940] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[334/363] Compiling C object vkquake.p/Quake_strlcpy.c.o
distcc[1944] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[335/363] Compiling C object vkquake.p/Quake_sbar.c.o
distcc[1900] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[336/363] Compiling C object vkquake.p/Quake_steam.c.o
distcc[1936] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[337/363] Compiling C object vkquake.p/Quake_sv_move.c.o
distcc[1952] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[338/363] Compiling C object vkquake.p/Quake_sv_user.c.o
distcc[1960] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[339/363] Compiling C object vkquake.p/meson-generated_.._draw_pic_xbr.frag.c.o
distcc[1414] ERROR: compile draw_pic_xbr.frag.c on 10.3.0.15:3932/8 failed
distcc[1414] (dcc_build_somewhere) Warning: remote compilation of 'draw_pic_xbr.frag.c' failed, retrying locally
distcc[1414] Warning: failed to distribute draw_pic_xbr.frag.c to 10.3.0.15:3932/8, running locally instead
distcc[1414] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'draw_pic_xbr.frag.c' failed, retried locally and got a different result.
[340/363] Compiling C object vkquake.p/Quake_tasks.c.o
distcc[1968] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[341/363] Compiling C object vkquake.p/Quake_view.c.o
distcc[1972] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[342/363] Compiling C object vkquake.p/Quake_sv_phys.c.o
distcc[1956] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[343/363] Compiling C object vkquake.p/Quake_wad.c.o
distcc[1976] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[344/363] Compiling C object vkquake.p/Quake_hash_map.c.o
distcc[1984] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[345/363] Compiling C object vkquake.p/Quake_net_bsd.c.o
distcc[1988] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[346/363] Compiling C object vkquake.p/Quake_r_part_fte.c.o
distcc[1888] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[347/363] Compiling C object vkquake.p/Quake_sv_main.c.o
distcc[1948] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[348/363] Compiling C object vkquake.p/Quake_pl_linux.c.o
distcc[1996] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[349/363] Compiling C object vkquake.p/Quake_snd_mpg123.c.o
distcc[2004] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[350/363] Compiling C object vkquake.p/Quake_world.c.o
distcc[1980] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[351/363] Compiling C object vkquake.p/Quake_net_udp.c.o
distcc[1992] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[352/363] Compiling C object vkquake.p/Quake_snd_flac.c.o
distcc[2012] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[353/363] Compiling C object vkquake.p/Quake_snd_mp3tag.c.o
distcc[2008] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[354/363] Compiling C object vkquake.p/Quake_snd_vorbis.c.o
distcc[2016] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[355/363] Compiling C object vkquake.p/Quake_sys_sdl_unix.c.o
distcc[2000] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
../vkQuake-1.36.0/Quake/sys_sdl_unix.c: In function ‘Sys_PinCurrentThread’:
../vkQuake-1.36.0/Quake/sys_sdl_unix.c:761:9: note: ‘#pragma message: Info : Pinned tasks support for *Nix enabled using pthread_setaffinity_np()...’
  761 | #pragma message("Info : Pinned tasks support for *Nix enabled using pthread_setaffinity_np()...")
      |         ^~~~~~~
[356/363] Compiling C object vkquake.p/Quake_snd_opus.c.o
distcc[2020] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[357/363] Compiling C object vkquake.p/meson-generated_.._basic_mboit_composite.frag.c.o
distcc[1526] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[358/363] Compiling C object vkquake.p/meson-generated_.._md5.vert.c.o
distcc[1408] ERROR: compile md5.vert.c on 10.3.0.15:3932/8 failed
distcc[1408] (dcc_build_somewhere) Warning: remote compilation of 'md5.vert.c' failed, retrying locally
distcc[1408] Warning: failed to distribute md5.vert.c to 10.3.0.15:3932/8, running locally instead
distcc[1408] (dcc_please_send_email_after_investigation) Warning: remote compilation of 'md5.vert.c' failed, retried locally and got a different result.
[359/363] Compiling C object vkquake.p/meson-generated_.._mboit_resolve_msaa.frag.c.o
distcc[1623] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[360/363] Compiling C object vkquake.p/Quake_snd_dma.c.o
distcc[1908] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[361/363] Compiling C object vkquake.p/Quake_sys_sdl.c.o
distcc[1965] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[362/363] Compiling C object vkquake.p/Quake_gl_texmgr.c.o
distcc[1780] (dcc_build_somewhere) Warning: failed to distribute, running locally instead
[363/363] Linking target vkquake
INFO: autodetecting backend as ninja
INFO: calculating backend command to run: /usr/bin/ninja -C /build/quake/src/build
==> Entering fakeroot environment...
==> Starting package()...
'librequake-0.09-beta/id1' -> '/build/quake/pkg/quake/usr/share/librequake/id1'
'librequake-0.09-beta/id1/accessibility.txt' -> '/build/quake/pkg/quake/usr/share/librequake/id1/accessibility.txt'
'librequake-0.09-beta/id1/dev.cfg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/dev.cfg'
'librequake-0.09-beta/id1/docs' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs'
'librequake-0.09-beta/id1/docs/COPYING' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/COPYING'
'librequake-0.09-beta/id1/docs/CREDITS' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/CREDITS'
'librequake-0.09-beta/id1/docs/README-IMPORTANT-LICENCE-INFO' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/README-IMPORTANT-LICENCE-INFO'
'librequake-0.09-beta/id1/docs/README.md' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/README.md'
'librequake-0.09-beta/id1/docs/branding' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding'
'librequake-0.09-beta/id1/docs/branding/button.png' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/button.png'
'librequake-0.09-beta/id1/docs/branding/header.png' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/header.png'
'librequake-0.09-beta/id1/docs/branding/icon.ico' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/icon.ico'
'librequake-0.09-beta/id1/docs/branding/icon.pixel.ico' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/icon.pixel.ico'
'librequake-0.09-beta/id1/docs/branding/icon.svg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/icon.svg'
'librequake-0.09-beta/id1/docs/branding/steam' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam'
'librequake-0.09-beta/id1/docs/branding/steam/capsule-tall.png' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/capsule-tall.png'
'librequake-0.09-beta/id1/docs/branding/steam/capsule-wide.png' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/capsule-wide.png'
'librequake-0.09-beta/id1/docs/branding/steam/hero.png' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/hero.png'
'librequake-0.09-beta/id1/docs/branding/steam/icon.pixel.png' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/icon.pixel.png'
'librequake-0.09-beta/id1/docs/branding/steam/icon.png' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/icon.png'
'librequake-0.09-beta/id1/docs/branding/steam/logo.png' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/logo.png'
'librequake-0.09-beta/id1/docs/deathmatch-setup-guide.txt' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/deathmatch-setup-guide.txt'
'librequake-0.09-beta/id1/docs/freedoom-docs' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/freedoom-docs'
'librequake-0.09-beta/id1/docs/freedoom-docs/COPYING.adoc' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/freedoom-docs/COPYING.adoc'
'librequake-0.09-beta/id1/docs/freedoom-docs/CREDITS' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/freedoom-docs/CREDITS'
'librequake-0.09-beta/id1/docs/freedoom-docs/README.adoc' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/freedoom-docs/README.adoc'
'librequake-0.09-beta/id1/docs/misc-docs' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/misc-docs'
'librequake-0.09-beta/id1/docs/misc-docs/COPYING' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/misc-docs/COPYING'
'librequake-0.09-beta/id1/docs/misc-docs/LibreProgsDeluxe.md' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/misc-docs/LibreProgsDeluxe.md'
'librequake-0.09-beta/id1/docs/misc-docs/pop.lmp.md' -> '/build/quake/pkg/quake/usr/share/librequake/id1/docs/misc-docs/pop.lmp.md'
'librequake-0.09-beta/id1/maps' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps'
'librequake-0.09-beta/id1/maps/lqdm1.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm1.bsp'
'librequake-0.09-beta/id1/maps/lqdm10.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm10.bsp'
'librequake-0.09-beta/id1/maps/lqdm10.lit' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm10.lit'
'librequake-0.09-beta/id1/maps/lqdm11.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm11.bsp'
'librequake-0.09-beta/id1/maps/lqdm12.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm12.bsp'
'librequake-0.09-beta/id1/maps/lqdm13.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm13.bsp'
'librequake-0.09-beta/id1/maps/lqdm2.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm2.bsp'
'librequake-0.09-beta/id1/maps/lqdm2.lit' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm2.lit'
'librequake-0.09-beta/id1/maps/lqdm3.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm3.bsp'
'librequake-0.09-beta/id1/maps/lqdm3.lit' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm3.lit'
'librequake-0.09-beta/id1/maps/lqdm4.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm4.bsp'
'librequake-0.09-beta/id1/maps/lqdm4.lit' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm4.lit'
'librequake-0.09-beta/id1/maps/lqdm5.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm5.bsp'
'librequake-0.09-beta/id1/maps/lqdm5.lit' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm5.lit'
'librequake-0.09-beta/id1/maps/lqdm6.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm6.bsp'
'librequake-0.09-beta/id1/maps/lqdm6.lit' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm6.lit'
'librequake-0.09-beta/id1/maps/lqdm7.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm7.bsp'
'librequake-0.09-beta/id1/maps/lqdm7.lit' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm7.lit'
'librequake-0.09-beta/id1/maps/lqdm8.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm8.bsp'
'librequake-0.09-beta/id1/maps/lqdm8.lit' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm8.lit'
'librequake-0.09-beta/id1/maps/lqdm9.bsp' -> '/build/quake/pkg/quake/usr/share/librequake/id1/maps/lqdm9.bsp'
'librequake-0.09-beta/id1/music' -> '/build/quake/pkg/quake/usr/share/librequake/id1/music'
'librequake-0.09-beta/id1/music/track02.ogg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/music/track02.ogg'
'librequake-0.09-beta/id1/music/track03.ogg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/music/track03.ogg'
'librequake-0.09-beta/id1/music/track04.ogg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/music/track04.ogg'
'librequake-0.09-beta/id1/music/track05.ogg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/music/track05.ogg'
'librequake-0.09-beta/id1/music/track06.ogg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/music/track06.ogg'
'librequake-0.09-beta/id1/music/track07.ogg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/music/track07.ogg'
'librequake-0.09-beta/id1/music/track08.ogg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/music/track08.ogg'
'librequake-0.09-beta/id1/music/track09.ogg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/music/track09.ogg'
'librequake-0.09-beta/id1/music/track10.ogg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/music/track10.ogg'
'librequake-0.09-beta/id1/music/track11.ogg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/music/track11.ogg'
'librequake-0.09-beta/id1/pak0.pak' -> '/build/quake/pkg/quake/usr/share/librequake/id1/pak0.pak'
'librequake-0.09-beta/id1/pak1.pak' -> '/build/quake/pkg/quake/usr/share/librequake/id1/pak1.pak'
'librequake-0.09-beta/id1/style_fte_modern.cfg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/style_fte_modern.cfg'
'librequake-0.09-beta/id1/style_fte_retro.cfg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/style_fte_retro.cfg'
'librequake-0.09-beta/id1/style_ironwail_modern.cfg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/style_ironwail_modern.cfg'
'librequake-0.09-beta/id1/style_ironwail_retro.cfg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/style_ironwail_retro.cfg'
'librequake-0.09-beta/id1/zoom120.cfg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/zoom120.cfg'
'librequake-0.09-beta/id1/zoom90.cfg' -> '/build/quake/pkg/quake/usr/share/librequake/id1/zoom90.cfg'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/README-IMPORTANT-LICENCE-INFO'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/README.md'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/COPYING'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/freedoom-docs/README.adoc'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/freedoom-docs/COPYING.adoc'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/freedoom-docs/CREDITS'
removed directory '/build/quake/pkg/quake/usr/share/librequake/id1/docs/freedoom-docs'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/header.png'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/button.png'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/icon.pixel.png'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/capsule-tall.png'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/hero.png'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/logo.png'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/icon.png'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam/capsule-wide.png'
removed directory '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/steam'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/icon.pixel.ico'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/icon.ico'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding/icon.svg'
removed directory '/build/quake/pkg/quake/usr/share/librequake/id1/docs/branding'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/deathmatch-setup-guide.txt'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/CREDITS'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/misc-docs/LibreProgsDeluxe.md'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/misc-docs/COPYING'
removed '/build/quake/pkg/quake/usr/share/librequake/id1/docs/misc-docs/pop.lmp.md'
removed directory '/build/quake/pkg/quake/usr/share/librequake/id1/docs/misc-docs'
removed directory '/build/quake/pkg/quake/usr/share/librequake/id1/docs'
==> Tidying install...
  -> Removing libtool files...
  -> Removing static library files...
  -> Purging unwanted files...
  -> Stripping unneeded symbols from binaries and libraries...
  -> Compressing man and info pages...
==> Checking for packaging issues...
==> Creating package "quake"...
  -> Generating .PKGINFO file...
  -> Generating .BUILDINFO file...
  -> Generating .MTREE file...
  -> Compressing package...
==> Leaving fakeroot environment.
==> Finished making: quake 1.36.0-3 (Fri Sep 11 00:08:31 2026)
==> Cleaning up...
[?12l[?25h