Skip to content

Commit

Permalink
We now only show games that are newer, or the same version. (Until th…
Browse files Browse the repository at this point in the history
…e time we have a good way to filter games via GUI control)
  • Loading branch information
vexed committed Feb 16, 2013
1 parent 1215889 commit 303fba6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
11 changes: 11 additions & 0 deletions lib/netplay/netplay.cpp
Expand Up @@ -181,6 +181,17 @@ bool NETisCorrectVersion(uint32_t game_version_major, uint32_t game_version_mino
{
return (NETCODE_VERSION_MAJOR == game_version_major && NETCODE_VERSION_MINOR == game_version_minor);
}

int NETGetMajorVersion(void)
{
return NETCODE_VERSION_MAJOR;
}

int NETGetMinorVersion(void)
{
return NETCODE_VERSION_MINOR;
}

// Sets if the game is password protected or not
void NETGameLocked( bool flag)
{
Expand Down
2 changes: 2 additions & 0 deletions lib/netplay/netplay.h
Expand Up @@ -332,6 +332,8 @@ extern void NETsetGamePassword(const char *password);
extern void NETBroadcastPlayerInfo(uint32_t index);
void NETBroadcastTwoPlayerInfo(uint32_t index1, uint32_t index2);
extern bool NETisCorrectVersion(uint32_t game_version_major, uint32_t game_version_minor);
extern int NETGetMajorVersion(void);
extern int NETGetMinorVersion(void);
void NET_InitPlayer(int i, bool initPosition);
extern void NET_InitPlayers(void);

Expand Down
7 changes: 4 additions & 3 deletions src/multiint.cpp
Expand Up @@ -923,9 +923,9 @@ static void addGames(void)
static const char *badModTip = "Your loaded mods are incompatible with this game. (Check mods/autoload/?)";

//count games to see if need two columns.
for(i=0;i<MaxGames;i++) // draw games
for (i=0; i < MaxGames; i++)
{
if( NetPlay.games[i].desc.dwSize !=0)
if (NetPlay.games[i].desc.dwSize !=0)
{
gcount++;
}
Expand Down Expand Up @@ -955,7 +955,8 @@ static void addGames(void)
for (i=0; i<MaxGames; i++) // draw games
{
widgDelete(psWScreen, GAMES_GAMESTART+i); // remove old icon.
if (NetPlay.games[i].desc.dwSize !=0)
// Since we lack a filter GUI button, we only show newer or same versions.
if (NetPlay.games[i].desc.dwSize !=0 && ((NetPlay.games[i].game_version_major >= NETGetMajorVersion()) && (NetPlay.games[i].game_version_minor >= NETGetMinorVersion())))
{

sButInit.id = GAMES_GAMESTART+i;
Expand Down

0 comments on commit 303fba6

Please sign in to comment.