From af15a5945cd76fa9fcabaf1e6f8998cf82cbabdf Mon Sep 17 00:00:00 2001 From: Mark Olsen Date: Mon, 11 Jan 2010 17:39:56 +0000 Subject: [PATCH] Fixed the demolist usercmd to output to the user rather than the server console. Fixed all file-related functionality in sv_mvd.c to actually work. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@3493 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/server/sv_mvd.c | 14 +++++++------- engine/server/sv_user.c | 4 ++-- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/engine/server/sv_mvd.c b/engine/server/sv_mvd.c index b86888311..cf3662eca 100644 --- a/engine/server/sv_mvd.c +++ b/engine/server/sv_mvd.c @@ -681,7 +681,7 @@ dir_t *Sys_listdir (char *path, char *ext, qboolean usesorting) dir->files = (file_t*)(dir+1); dir->maxfiles = maxfiles; - Q_strncpyz(searchterm, va("%s/*.%s", path, ext), sizeof(searchterm)); + Q_strncpyz(searchterm, va("%s/*%s", path, ext), sizeof(searchterm)); COM_EnumerateFiles(searchterm, Sys_listdirFound, dir); return dir; @@ -2444,12 +2444,12 @@ void SV_UserCmdMVDList_f (void) float f; int i,j,show; - Con_Printf("available demos\n"); + SV_ClientPrintf(host_client, PRINT_HIGH, "available demos:\n"); dir = Sys_listdir(sv_demoDir.string, ".mvd", SORT_BY_DATE); list = dir->files; if (!list->name[0]) { - Con_Printf("no demos\n"); + SV_ClientPrintf(host_client, PRINT_HIGH, "no demos\n"); } for (i = 1; i <= dir->numfiles; i++, list++) @@ -2464,23 +2464,23 @@ void SV_UserCmdMVDList_f (void) for (d = demo.dest; d; d = d->nextdest) { if (!strcmp(list->name, d->name)) - Con_Printf("*%d: %s %dk\n", i, list->name, d->totalsize/1024); + SV_ClientPrintf(host_client, PRINT_HIGH, "*%d: %s %dk\n", i, list->name, d->totalsize/1024); } if (!d) - Con_Printf("%d: %s %dk\n", i, list->name, list->size/1024); + SV_ClientPrintf(host_client, PRINT_HIGH, "%d: %s %dk\n", i, list->name, list->size/1024); } } for (d = demo.dest; d; d = d->nextdest) dir->size += d->totalsize; - Con_Printf("\ndirectory size: %.1fMB\n",(float)dir->size/(1024*1024)); + SV_ClientPrintf(host_client, PRINT_HIGH, "\ndirectory size: %.1fMB\n",(float)dir->size/(1024*1024)); if (sv_demoMaxDirSize.value) { f = (sv_demoMaxDirSize.value*1024 - dir->size)/(1024*1024); if ( f < 0) f = 0; - Con_Printf("space available: %.1fMB\n", f); + SV_ClientPrintf(host_client, PRINT_HIGH, "space available: %.1fMB\n", f); } Sys_freedir(dir); diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index 77d7c5d41..21033097b 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -3841,7 +3841,7 @@ void SV_DisableClientsCSQC(void) #endif } -void SV_MVDList_f (void); +void SV_UserCmdMVDList_f (void); void SV_MVDInfo_f (void); typedef struct { @@ -3905,7 +3905,7 @@ ucmd_t ucmds[] = {"setpos", Cmd_SetPos_f}, {"stopdownload", SV_StopDownload_f}, - {"demolist", SV_MVDList_f}, + {"demolist", SV_UserCmdMVDList_f}, {"demoinfo", SV_MVDInfo_f}, {NULL, NULL}