Grey out non-demo servers if playing with demo pak0

- don't allow players to even start a MP game on a non-demo server
- fixed the website url
- updated the message about the demo in the main menu
This commit is contained in:
Simon 2022-05-19 19:10:38 +01:00
parent c01c8b3484
commit b45d7cd653
5 changed files with 49 additions and 14 deletions

View file

@ -163,7 +163,7 @@ Special Thanks to the whole discord!
UI_DrawProportionalString(320, y, "original ioquake3 contributors!", UI_CENTER | UI_SMALLFONT, color_orange); UI_DrawProportionalString(320, y, "original ioquake3 contributors!", UI_CENTER | UI_SMALLFONT, color_orange);
} }
UI_DrawString( 320, 459, "Quake3Quest: https://www.quake3.quakevr.com/", UI_CENTER|UI_SMALLFONT, color_red ); UI_DrawString( 320, 459, "Quake3Quest: https://quake3.quakevr.com/", UI_CENTER|UI_SMALLFONT, color_red );
} }

View file

@ -229,7 +229,7 @@ static void Main_MenuDraw( void ) {
int yPos = 410; int yPos = 410;
if (uis.demoversion) { if (uis.demoversion) {
yPos = 372; yPos = 372;
UI_DrawString( 320, yPos, "Demo: Play the 1st tier of SP or MP on our demo servers", UI_CENTER|UI_SMALLFONT, color_white ); UI_DrawString( 320, yPos, "DEMO: You can only play on Demo-Servers and play first part of SP!", UI_CENTER|UI_SMALLFONT, color_white );
yPos += SMALLCHAR_HEIGHT; yPos += SMALLCHAR_HEIGHT;
UI_DrawString( 320, yPos, "Install full game for more!", UI_CENTER|UI_SMALLFONT, color_white ); UI_DrawString( 320, yPos, "Install full game for more!", UI_CENTER|UI_SMALLFONT, color_white );
yPos += SMALLCHAR_HEIGHT; yPos += SMALLCHAR_HEIGHT;

View file

@ -194,6 +194,7 @@ typedef struct servernode_s {
int minPing; int minPing;
int maxPing; int maxPing;
qboolean bPB; qboolean bPB;
qboolean demo;
} servernode_t; } servernode_t;
@ -395,7 +396,6 @@ static void ArenaServers_UpdatePicture( void ) {
servernodeptr = g_arenaservers.table[g_arenaservers.list.curvalue].servernode; servernodeptr = g_arenaservers.table[g_arenaservers.list.curvalue].servernode;
Com_sprintf( picname, sizeof(picname), "levelshots/%s.tga", servernodeptr->mapname ); Com_sprintf( picname, sizeof(picname), "levelshots/%s.tga", servernodeptr->mapname );
g_arenaservers.mappic.generic.name = picname; g_arenaservers.mappic.generic.name = picname;
} }
// force shader update during draw // force shader update during draw
@ -490,9 +490,6 @@ static void ArenaServers_UpdateMenu( void ) {
g_arenaservers.punkbuster.generic.flags &= ~QMF_GRAYED; g_arenaservers.punkbuster.generic.flags &= ~QMF_GRAYED;
} }
//Specify should always be grayed out
g_arenaservers.specify.generic.flags |= QMF_GRAYED;
// zero out list box // zero out list box
g_arenaservers.list.numitems = 0; g_arenaservers.list.numitems = 0;
g_arenaservers.list.curvalue = 0; g_arenaservers.list.curvalue = 0;
@ -503,6 +500,16 @@ static void ArenaServers_UpdateMenu( void ) {
return; return;
} }
//Specify should always be grayed out
g_arenaservers.specify.generic.flags |= QMF_GRAYED;
servernode_t* servernode;
servernode = g_arenaservers.table[g_arenaservers.list.curvalue].servernode;
if( servernode && uis.demoversion && !servernode->demo) {
//Demo pak cannot connect to a non-demo server
g_arenaservers.go.generic.flags |= QMF_GRAYED;
}
// build list box strings - apply culling filters // build list box strings - apply culling filters
servernodeptr = g_arenaservers.serverlist; servernodeptr = g_arenaservers.serverlist;
count = *g_arenaservers.numservers; count = *g_arenaservers.numservers;
@ -565,10 +572,20 @@ static void ArenaServers_UpdateMenu( void ) {
pingColor = S_COLOR_RED; pingColor = S_COLOR_RED;
} }
if (uis.demoversion && !servernodeptr->demo)
{
Com_sprintf( buff, MAX_LISTBOXWIDTH, S_COLOR_MID_GREY "%-20.20s %-12.12s %2d/%2d %-8.8s %4s%s%3d " S_COLOR_YELLOW "%s",
servernodeptr->hostname, servernodeptr->mapname, servernodeptr->numclients,
servernodeptr->maxclients, servernodeptr->gamename,
netnames[servernodeptr->nettype], pingColor, servernodeptr->pingtime, servernodeptr->bPB ? "Yes" : "No" );
}
else
{
Com_sprintf( buff, MAX_LISTBOXWIDTH, "%-20.20s %-12.12s %2d/%2d %-8.8s %4s%s%3d " S_COLOR_YELLOW "%s", Com_sprintf( buff, MAX_LISTBOXWIDTH, "%-20.20s %-12.12s %2d/%2d %-8.8s %4s%s%3d " S_COLOR_YELLOW "%s",
servernodeptr->hostname, servernodeptr->mapname, servernodeptr->numclients, servernodeptr->hostname, servernodeptr->mapname, servernodeptr->numclients,
servernodeptr->maxclients, servernodeptr->gamename, servernodeptr->maxclients, servernodeptr->gamename,
netnames[servernodeptr->nettype], pingColor, servernodeptr->pingtime, servernodeptr->bPB ? "Yes" : "No" ); netnames[servernodeptr->nettype], pingColor, servernodeptr->pingtime, servernodeptr->bPB ? "Yes" : "No" );
}
j++; j++;
} }
@ -685,6 +702,7 @@ static void ArenaServers_Insert( char* adrstr, char* info, int pingtime )
servernodeptr->minPing = atoi( Info_ValueForKey( info, "minPing") ); servernodeptr->minPing = atoi( Info_ValueForKey( info, "minPing") );
servernodeptr->maxPing = atoi( Info_ValueForKey( info, "maxPing") ); servernodeptr->maxPing = atoi( Info_ValueForKey( info, "maxPing") );
servernodeptr->bPB = atoi( Info_ValueForKey( info, "punkbuster") ); servernodeptr->bPB = atoi( Info_ValueForKey( info, "punkbuster") );
servernodeptr->demo = (strcasestr(info, "demo") != NULL);
/* /*
s = Info_ValueForKey( info, "nettype" ); s = Info_ValueForKey( info, "nettype" );
@ -1242,6 +1260,17 @@ static void ArenaServers_Event( void* ptr, int event ) {
case ID_LIST: case ID_LIST:
if( event == QM_GOTFOCUS ) { if( event == QM_GOTFOCUS ) {
ArenaServers_UpdatePicture(); ArenaServers_UpdatePicture();
servernode_t* servernode;
servernode = g_arenaservers.table[g_arenaservers.list.curvalue].servernode;
if( servernode && uis.demoversion && !servernode->demo) {
//Demo pak cannot connect to a non-demo server
g_arenaservers.go.generic.flags |= QMF_GRAYED;
}
else
{
g_arenaservers.go.generic.flags &= ~QMF_GRAYED;
}
} }
break; break;

View file

@ -47,7 +47,7 @@ vec4_t colorLtGrey = {0.75, 0.75, 0.75, 1};
vec4_t colorMdGrey = {0.5, 0.5, 0.5, 1}; vec4_t colorMdGrey = {0.5, 0.5, 0.5, 1};
vec4_t colorDkGrey = {0.25, 0.25, 0.25, 1}; vec4_t colorDkGrey = {0.25, 0.25, 0.25, 1};
vec4_t g_color_table[8] = vec4_t g_color_table[10] =
{ {
{0.0, 0.0, 0.0, 1.0}, {0.0, 0.0, 0.0, 1.0},
{1.0, 0.0, 0.0, 1.0}, {1.0, 0.0, 0.0, 1.0},
@ -57,6 +57,8 @@ vec4_t g_color_table[8] =
{0.0, 1.0, 1.0, 1.0}, {0.0, 1.0, 1.0, 1.0},
{1.0, 0.0, 1.0, 1.0}, {1.0, 0.0, 1.0, 1.0},
{1.0, 1.0, 1.0, 1.0}, {1.0, 1.0, 1.0, 1.0},
{0.75, 0.75, 0.75, 1.0},
{0.5, 0.5, 0.5, 1.0},
}; };

View file

@ -431,7 +431,9 @@ qboolean Q_IsColorString(const char *p); // ^[0-9a-zA-Z]
#define COLOR_CYAN '5' #define COLOR_CYAN '5'
#define COLOR_MAGENTA '6' #define COLOR_MAGENTA '6'
#define COLOR_WHITE '7' #define COLOR_WHITE '7'
#define ColorIndexForNumber(c) ((c) & 0x07) #define COLOR_LIGHT_GREY '8'
#define COLOR_MID_GREY '9'
#define ColorIndexForNumber(c) ((c) & 0x0f)
#define ColorIndex(c) (ColorIndexForNumber((c) - '0')) #define ColorIndex(c) (ColorIndexForNumber((c) - '0'))
#define S_COLOR_BLACK "^0" #define S_COLOR_BLACK "^0"
@ -442,8 +444,10 @@ qboolean Q_IsColorString(const char *p); // ^[0-9a-zA-Z]
#define S_COLOR_CYAN "^5" #define S_COLOR_CYAN "^5"
#define S_COLOR_MAGENTA "^6" #define S_COLOR_MAGENTA "^6"
#define S_COLOR_WHITE "^7" #define S_COLOR_WHITE "^7"
#define S_COLOR_LIGHT_GREY "^8"
#define S_COLOR_MID_GREY "^9"
extern vec4_t g_color_table[8]; extern vec4_t g_color_table[10];
#define MAKERGB( v, r, g, b ) v[0]=r;v[1]=g;v[2]=b #define MAKERGB( v, r, g, b ) v[0]=r;v[1]=g;v[2]=b
#define MAKERGBA( v, r, g, b, a ) v[0]=r;v[1]=g;v[2]=b;v[3]=a #define MAKERGBA( v, r, g, b, a ) v[0]=r;v[1]=g;v[2]=b;v[3]=a