diff options
Diffstat (limited to 'src/ui')
-rw-r--r-- | src/ui/ui_atoms.c | 5 | ||||
-rw-r--r-- | src/ui/ui_gameinfo.c | 23 | ||||
-rw-r--r-- | src/ui/ui_local.h | 13 | ||||
-rw-r--r-- | src/ui/ui_main.c | 75 | ||||
-rw-r--r-- | src/ui/ui_public.h | 10 | ||||
-rw-r--r-- | src/ui/ui_syscalls.asm | 3 | ||||
-rw-r--r-- | src/ui/ui_syscalls.c | 12 |
7 files changed, 21 insertions, 120 deletions
diff --git a/src/ui/ui_atoms.c b/src/ui/ui_atoms.c index 850a1ac2..64efa914 100644 --- a/src/ui/ui_atoms.c +++ b/src/ui/ui_atoms.c @@ -377,11 +377,6 @@ qboolean UI_ConsoleCommand( int realTime ) } } - if ( Q_stricmp (cmd, "ui_cdkey") == 0 ) { - //UI_CDKeyMenu_f(); - return qtrue; - } - return qfalse; } diff --git a/src/ui/ui_gameinfo.c b/src/ui/ui_gameinfo.c index 451e54af..ab3ce6da 100644 --- a/src/ui/ui_gameinfo.c +++ b/src/ui/ui_gameinfo.c @@ -124,6 +124,19 @@ static void UI_LoadArenasFromFile( char *filename ) { } /* +================= +UI_MapNameCompare +================= +*/ +static int UI_MapNameCompare( const void *a, const void *b ) +{ + mapInfo *A = (mapInfo *)a; + mapInfo *B = (mapInfo *)b; + + return Q_stricmp( A->mapName, B->mapName ); +} + +/* =============== UI_LoadArenas =============== @@ -140,14 +153,6 @@ void UI_LoadArenas( void ) { ui_numArenas = 0; uiInfo.mapCount = 0; -/* trap_Cvar_Register( &arenasFile, "g_arenasFile", "", CVAR_INIT|CVAR_ROM ); - if( *arenasFile.string ) { - UI_LoadArenasFromFile(arenasFile.string); - } - else { - UI_LoadArenasFromFile("scripts/arenas.txt"); - }*/ - // get all arenas from .arena files numdirs = trap_FS_GetFileList("scripts", ".arena", dirlist, 1024 ); dirptr = dirlist; @@ -183,6 +188,8 @@ void UI_LoadArenas( void ) { if( uiInfo.mapCount >= MAX_MAPS ) break; } + + qsort( uiInfo.mapList, uiInfo.mapCount, sizeof( mapInfo ), UI_MapNameCompare ); } diff --git a/src/ui/ui_local.h b/src/ui/ui_local.h index 865ce927..d8340695 100644 --- a/src/ui/ui_local.h +++ b/src/ui/ui_local.h @@ -88,9 +88,6 @@ extern vmCvar_t ui_server14; extern vmCvar_t ui_server15; extern vmCvar_t ui_server16; -extern vmCvar_t ui_cdkey; -extern vmCvar_t ui_cdkeychecked; - extern vmCvar_t ui_captureLimit; extern vmCvar_t ui_fragLimit; extern vmCvar_t ui_gameType; @@ -432,13 +429,6 @@ extern void UI_ModsMenu( void ); extern void UI_ModsMenu_Cache( void ); // -// ui_cdkey.c -// -extern void UI_CDKeyMenu( void ); -extern void UI_CDKeyMenu_Cache( void ); -extern void UI_CDKeyMenu_f( void ); - -// // ui_playermodel.c // extern void UI_PlayerModelMenu( void ); @@ -1059,8 +1049,6 @@ void trap_LAN_ResetPings(int n); int trap_LAN_ServerStatus( const char *serverAddress, char *serverStatus, int maxLen ); int trap_LAN_CompareServers( int source, int sortKey, int sortDir, int s1, int s2 ); int trap_MemoryRemaining( void ); -void trap_GetCDKey( char *buf, int buflen ); -void trap_SetCDKey( char *buf ); void trap_R_RegisterFont(const char *pFontname, int pointSize, fontInfo_t *font); void trap_S_StopBackgroundTrack( void ); void trap_S_StartBackgroundTrack( const char *intro, const char *loop); @@ -1071,7 +1059,6 @@ void trap_CIN_DrawCinematic (int handle); void trap_CIN_SetExtents (int handle, int x, int y, int w, int h); int trap_RealTime(qtime_t *qtime); void trap_R_RemapShader( const char *oldShader, const char *newShader, const char *timeOffset ); -qboolean trap_VerifyCDKey( const char *key, const char *chksum); void trap_SetPbClStatus( int status ); diff --git a/src/ui/ui_main.c b/src/ui/ui_main.c index bf00c5fa..198a33f6 100644 --- a/src/ui/ui_main.c +++ b/src/ui/ui_main.c @@ -199,9 +199,6 @@ long vmMain( long command, long arg0, long arg1, long arg2, long arg3, case UI_DRAW_CONNECT_SCREEN: UI_DrawConnectScreen( arg0 ); return 0; - case UI_HASUNIQUECDKEY: // mod authors need to observe this - return qfalse; // bk010117 - change this to qfalse for mods! - } return -1; @@ -4002,37 +3999,6 @@ static void UI_RunMenuScript(char **args) { Controls_SetDefaults(); trap_Cvar_Set("com_introPlayed", "1" ); trap_Cmd_ExecuteText( EXEC_APPEND, "vid_restart\n" ); - } else if (Q_stricmp(name, "getCDKey") == 0) { - char out[17]; - trap_GetCDKey(buff, 17); - trap_Cvar_Set("cdkey1", ""); - trap_Cvar_Set("cdkey2", ""); - trap_Cvar_Set("cdkey3", ""); - trap_Cvar_Set("cdkey4", ""); - if (strlen(buff) == CDKEY_LEN) { - Q_strncpyz(out, buff, 5); - trap_Cvar_Set("cdkey1", out); - Q_strncpyz(out, buff + 4, 5); - trap_Cvar_Set("cdkey2", out); - Q_strncpyz(out, buff + 8, 5); - trap_Cvar_Set("cdkey3", out); - Q_strncpyz(out, buff + 12, 5); - trap_Cvar_Set("cdkey4", out); - } - - } else if (Q_stricmp(name, "verifyCDKey") == 0) { - buff[0] = '\0'; - Q_strcat(buff, 1024, UI_Cvar_VariableString("cdkey1")); - Q_strcat(buff, 1024, UI_Cvar_VariableString("cdkey2")); - Q_strcat(buff, 1024, UI_Cvar_VariableString("cdkey3")); - Q_strcat(buff, 1024, UI_Cvar_VariableString("cdkey4")); - trap_Cvar_Set("cdkey", buff); - if (trap_VerifyCDKey(buff, UI_Cvar_VariableString("cdkeychecksum"))) { - trap_Cvar_Set("ui_cdkeyvalid", "CD Key Appears to be valid."); - trap_SetCDKey(buff); - } else { - trap_Cvar_Set("ui_cdkeyvalid", "CD Key does not appear to be valid."); - } } else if (Q_stricmp(name, "loadArenas") == 0) { UI_LoadArenas(); UI_MapCountByGameType(qfalse); @@ -4601,10 +4567,6 @@ static void UI_BuildServerDisplayList(qboolean force) { // do motd updates here too trap_Cvar_VariableStringBuffer( "cl_motdString", uiInfo.serverStatus.motd, sizeof(uiInfo.serverStatus.motd) ); len = strlen(uiInfo.serverStatus.motd); - if (len == 0) { - strcpy(uiInfo.serverStatus.motd, "Welcome to Tremulous!"); - len = strlen(uiInfo.serverStatus.motd); - } if (len != uiInfo.serverStatus.motdLen) { uiInfo.serverStatus.motdLen = len; uiInfo.serverStatus.motdWidth = -1; @@ -4670,13 +4632,6 @@ static void UI_BuildServerDisplayList(qboolean force) { } } - //TA: only show tremulous servers - if( Q_stricmp( Info_ValueForKey( info, "game" ), "tremulous" ) != 0 ) - { - trap_LAN_MarkServerVisible( ui_netSource.integer, i, qfalse ); - continue; - } - // make sure we never add a favorite server twice if (ui_netSource.integer == AS_FAVORITES) { UI_RemoveServerFromDisplayList(i); @@ -5173,13 +5128,13 @@ static const char *UI_FeederItemText(float feederID, int index, int column, qhan return UI_SelectedMap(index, &actual); } else if (feederID == FEEDER_SERVERS) { if (index >= 0 && index < uiInfo.serverStatus.numDisplayServers) { - int ping, punkbuster; + int ping; if (lastColumn != column || lastTime > uiInfo.uiDC.realTime + 5000) { trap_LAN_GetServerInfo(ui_netSource.integer, uiInfo.serverStatus.displayServers[index], info, MAX_STRING_CHARS); lastColumn = column; lastTime = uiInfo.uiDC.realTime; } - /*return "bah";*/ + ping = atoi(Info_ValueForKey(info, "ping")); if (ping == -1) { // if we ever see a ping that is out of date, do a server refresh @@ -5213,13 +5168,6 @@ static const char *UI_FeederItemText(float feederID, int index, int column, qhan } else { return Info_ValueForKey(info, "ping"); } - case SORT_PUNKBUSTER: - punkbuster = atoi(Info_ValueForKey(info, "punkbuster")); - if ( punkbuster ) { - return "Yes"; - } else { - return "No"; - } } } } else if (feederID == FEEDER_SERVERSTATUS) { @@ -5831,18 +5779,6 @@ void _UI_SetActiveMenu( uiMenuCommand_t menu ) { trap_Key_SetCatcher( KEYCATCH_UI ); Menus_ActivateByName("team"); return; - case UIMENU_NEED_CD: - // no cd check in TA - //trap_Key_SetCatcher( KEYCATCH_UI ); - //Menus_ActivateByName("needcd"); - //UI_ConfirmMenu( "Insert the CD", NULL, NeedCDAction ); - return; - case UIMENU_BAD_CD_KEY: - // no cd check in TA - //trap_Key_SetCatcher( KEYCATCH_UI ); - //Menus_ActivateByName("badcd"); - //UI_ConfirmMenu( "Bad CD Key", NULL, NeedCDKeyAction ); - return; case UIMENU_POSTGAME: //trap_Cvar_Set( "sv_killserver", "1" ); trap_Key_SetCatcher( KEYCATCH_UI ); @@ -5851,7 +5787,6 @@ void _UI_SetActiveMenu( uiMenuCommand_t menu ) { } Menus_CloseAll(); Menus_ActivateByName("endofgame"); - //UI_ConfirmMenu( "Bad CD Key", NULL, NeedCDKeyAction ); return; case UIMENU_INGAME: trap_Cvar_Set( "cl_paused", "1" ); @@ -6198,8 +6133,6 @@ vmCvar_t ui_server14; vmCvar_t ui_server15; vmCvar_t ui_server16; -vmCvar_t ui_cdkeychecked; - vmCvar_t ui_redteam; vmCvar_t ui_redteam1; vmCvar_t ui_redteam2; @@ -6321,7 +6254,6 @@ static cvarTable_t cvarTable[] = { { &ui_server14, "server14", "", CVAR_ARCHIVE }, { &ui_server15, "server15", "", CVAR_ARCHIVE }, { &ui_server16, "server16", "", CVAR_ARCHIVE }, - { &ui_cdkeychecked, "ui_cdkeychecked", "0", CVAR_ROM }, { &ui_new, "ui_new", "0", CVAR_TEMP }, { &ui_debug, "ui_debug", "0", CVAR_TEMP }, { &ui_initialized, "ui_initialized", "0", CVAR_TEMP }, @@ -6504,7 +6436,8 @@ static void UI_StartServerRefresh(qboolean full) qtime_t q; trap_RealTime(&q); - trap_Cvar_Set( va("ui_lastServerRefresh_%i", ui_netSource.integer), va("%s-%i, %i at %i:%i", MonthAbbrev[q.tm_mon],q.tm_mday, 1900+q.tm_year,q.tm_hour,q.tm_min)); + trap_Cvar_Set( va("ui_lastServerRefresh_%i", ui_netSource.integer), + va("%s-%i, %i at %i:%02i", MonthAbbrev[q.tm_mon],q.tm_mday, 1900+q.tm_year,q.tm_hour,q.tm_min)); if (!full) { UI_UpdatePendingPings(); diff --git a/src/ui/ui_public.h b/src/ui/ui_public.h index 2308256d..9e39d52b 100644 --- a/src/ui/ui_public.h +++ b/src/ui/ui_public.h @@ -89,8 +89,6 @@ typedef enum { UI_CVAR_REGISTER, UI_CVAR_UPDATE, UI_MEMORY_REMAINING, - UI_GET_CDKEY, - UI_SET_CDKEY, UI_R_REGISTERFONT, UI_R_MODELBOUNDS, UI_PC_ADD_GLOBAL_DEFINE, @@ -117,7 +115,6 @@ typedef enum { UI_CIN_DRAWCINEMATIC, UI_CIN_SETEXTENTS, UI_R_REMAP_SHADER, - UI_VERIFY_CDKEY, UI_LAN_SERVERSTATUS, UI_LAN_GETSERVERPING, UI_LAN_SERVERISVISIBLE, @@ -141,8 +138,6 @@ typedef enum { UIMENU_NONE, UIMENU_MAIN, UIMENU_INGAME, - UIMENU_NEED_CD, - UIMENU_BAD_CD_KEY, UIMENU_TEAM, UIMENU_POSTGAME } uiMenuCommand_t; @@ -152,7 +147,6 @@ typedef enum SORT_HOST, SORT_MAP, SORT_CLIENTS, - SORT_PUNKBUSTER, SORT_PING } serverSortField_t; @@ -183,9 +177,9 @@ typedef enum { UI_CONSOLE_COMMAND, // qboolean UI_ConsoleCommand( int realTime ); - UI_DRAW_CONNECT_SCREEN, + UI_DRAW_CONNECT_SCREEN // void UI_DrawConnectScreen( qboolean overlay ); - UI_HASUNIQUECDKEY + // if !overlay, the background will be drawn, otherwise it will be // overlayed over whatever the cgame has drawn. // a GetClientState syscall will be made to get the current strings diff --git a/src/ui/ui_syscalls.asm b/src/ui/ui_syscalls.asm index 54255f29..d84ce335 100644 --- a/src/ui/ui_syscalls.asm +++ b/src/ui/ui_syscalls.asm @@ -53,8 +53,6 @@ equ trap_LAN_GetPingInfo -50 equ trap_Cvar_Register -51 equ trap_Cvar_Update -52 equ trap_MemoryRemaining -53 -equ trap_GetCDKey -54 -equ trap_SetCDKey -55 equ trap_R_RegisterFont -56 equ trap_R_ModelBounds -57 equ trap_PC_AddGlobalDefine -58 @@ -81,7 +79,6 @@ equ trap_CIN_RunCinematic -78 equ trap_CIN_DrawCinematic -79 equ trap_CIN_SetExtents -80 equ trap_R_RemapShader -81 -equ trap_VerifyCDKey -82 equ trap_LAN_ServerStatus -83 equ trap_LAN_GetServerPing -84 equ trap_LAN_ServerIsVisible -85 diff --git a/src/ui/ui_syscalls.c b/src/ui/ui_syscalls.c index d0a17b77..3aba4d69 100644 --- a/src/ui/ui_syscalls.c +++ b/src/ui/ui_syscalls.c @@ -316,14 +316,6 @@ int trap_MemoryRemaining( void ) { return syscall( UI_MEMORY_REMAINING ); } -void trap_GetCDKey( char *buf, int buflen ) { - syscall( UI_GET_CDKEY, buf, buflen ); -} - -void trap_SetCDKey( char *buf ) { - syscall( UI_SET_CDKEY, buf ); -} - int trap_PC_AddGlobalDefine( char *define ) { return syscall( UI_PC_ADD_GLOBAL_DEFINE, define ); } @@ -390,10 +382,6 @@ void trap_R_RemapShader( const char *oldShader, const char *newShader, const ch syscall( UI_R_REMAP_SHADER, oldShader, newShader, timeOffset ); } -qboolean trap_VerifyCDKey( const char *key, const char *chksum) { - return syscall( UI_VERIFY_CDKEY, key, chksum); -} - void trap_SetPbClStatus( int status ) { syscall( UI_SET_PBCLSTATUS, status ); } |