Esempio n. 1
0
void DoShowNetGameHelp (void)
{
    CMenu		m (30);
    char		szText [MENU_MAX_TEXTLEN];
    int		i, eff;
#if DBG
    int pl;
#endif
    //char *eff_strings[]={"trashing", "really hurting", "seriously affecting", "hurting", "affecting", "tarnishing"};

    sprintf (szText, TXT_INFO_GAME, netGame.m_info.szGameName);
    m.AddText (szText);
    sprintf (szText, TXT_INFO_MISSION, netGame.m_info.szMissionTitle);
    m.AddText (szText);
    sprintf (szText, TXT_INFO_LEVEL, netGame.m_info.GetLevel ());
    m.AddText (szText);
    sprintf (szText, TXT_INFO_SKILL, MENU_DIFFICULTY_TEXT (netGame.m_info.difficulty));
    m.AddText (szText);
    sprintf (szText, TXT_INFO_MODE, GT (537 + netGame.m_info.gameMode));
    m.AddText (szText);
    sprintf (szText, TXT_INFO_SERVER, gameData.multiplayer.players [NetworkWhoIsMaster()].callsign);
    m.AddText (szText);
    sprintf (szText, TXT_INFO_PLRNUM, NetworkHowManyConnected (), netGame.m_info.nMaxPlayers);
    m.AddText (szText);
    sprintf (szText, TXT_INFO_PPS, netGame.GetPacketsPerSec ());
    m.AddText (szText);
    sprintf (szText, TXT_INFO_SHORTPKT, netGame.GetShortPackets () ? "Yes" : "No");
    m.AddText (szText);
#if DBG
    pl = (int) ((double (networkData.nTotalMissedPackets) / double (networkData.nTotalPacketsGot + networkData.nTotalMissedPackets)) * 100.0);
    if (pl < 0)
        pl = 0;
    sprintf (szText, TXT_INFO_LOSTPKT, networkData.nTotalMissedPackets, pl);
    m.AddText (szText);
#endif
    if (netGame.GetScoreGoal ())
        sprintf (szText, TXT_INFO_SCOREGOAL, netGame.GetScoreGoal () * 5);
    sprintf (szText, " ");
    sprintf (szText, TXT_INFO_PLRSCONN);
    netPlayers.m_info.players [gameData.multiplayer.nLocalPlayer].rank = GetMyNetRanking ();
    for (i = 0; i < gameData.multiplayer.nPlayers; i++)
        if (gameData.multiplayer.players [i].connected) {
            if (!gameOpts->multi.bNoRankings) {
                if (i == gameData.multiplayer.nLocalPlayer)
                    sprintf (szText, "%s%s (%d/%d)",
                             pszRankStrings [netPlayers.m_info.players [i].rank],
                             gameData.multiplayer.players [i].callsign,
                             networkData.nNetLifeKills,
                             networkData.nNetLifeKilled);
                else
                    sprintf (szText, "%s%s %d/%d",
                             pszRankStrings[netPlayers.m_info.players [i].rank],
                             gameData.multiplayer.players [i].callsign,
                             gameData.multigame.kills.matrix[gameData.multiplayer.nLocalPlayer][i],
                             gameData.multigame.kills.matrix[i][gameData.multiplayer.nLocalPlayer]);
            }
            else
                sprintf (szText, "%s", gameData.multiplayer.players [i].callsign);
            m.AddText (szText);
        }
    m.AddText ("");
    eff = (int)((double)((double) networkData.nNetLifeKills / ((double) networkData.nNetLifeKilled + (double) networkData.nNetLifeKills))*100.0);
    if (eff < 0)
        eff = 0;
    if (gameData.app.nGameMode & GM_HOARD) {
        if (gameData.score.nPhallicMan == -1)
            sprintf (szText, TXT_NO_RECORD2);
        else
            sprintf (szText, TXT_RECORD3, gameData.multiplayer.players [gameData.score.nPhallicMan].callsign, gameData.score.nPhallicLimit);
    }
    else if (!gameOpts->multi.bNoRankings) {
        sprintf (szText, TXT_EFF_LIFETIME, eff);
        m.AddText (szText);
        if (eff < 60)
            sprintf (szText, TXT_EFF_INFLUENCE, GT(546 + eff / 10));
        else
            sprintf (szText, TXT_EFF_SERVEWELL);
        m.AddText (szText);
    }
//paletteManager.SuspendEffect();
    bPauseableMenu = 1;
    m.TinyMenu (NULL, "NetGame Information");
//paletteManager.ResumeEffect ();
}
Esempio n. 2
0
void ShowNetGameInfo (int choice)
 {
	CMenu	m (30);
   char	mTexts [30][200];
	int	i, j, nInMenu, opt = 0;

#if !DBG
if (choice >= networkData.nActiveGames)
	return;
#endif
memset (mTexts, 0, sizeof (mTexts));
for (i = 0; i < 20; i++)
	m.AddText (reinterpret_cast<char*> (mTexts + i));
sprintf (mTexts [opt], TXT_NGI_GAME, szHighlight, AGI.szGameName); 
opt++;
sprintf (mTexts [opt], TXT_NGI_MISSION, szHighlight, AGI.szMissionTitle); 
opt++;
sprintf (mTexts [opt], TXT_NGI_LEVEL, szHighlight, AGI.nLevel); 
opt++;
sprintf (mTexts [opt], TXT_NGI_SKILL, szHighlight, MENU_DIFFICULTY_TEXT (AGI.difficulty)); 
opt++;
opt++;
#if !DBG
if (!*AXI.szGameName) {
	sprintf (mTexts [opt], "Gamehost is not using D2X-XL or running in pure mode");
	opt++;
	}
else 
#endif
 {
	if (AXI.bShadows || AXI.bUseParticles || AXI.bBrightObjects || (!AXI.bCompetition && AXI.bUseLightning)) {
		INITFLAGS ("Graphics Fx: "); 
		ADDFLAG (AXI.bShadows, "Shadows");
		ADDFLAG (AXI.bUseParticles, "Smoke");
		if (!AXI.bCompetition)
			ADDFLAG (AXI.bUseLightning, "Lightnings");
		ADDFLAG (AXI.bBrightObjects, "Bright Objects");
		}
	else
		strcpy (mTexts [opt], "Graphics Fx: None");
	opt++;
	if (!AXI.bCompetition && (AXI.bLightTrails || AXI.bShockwaves || AXI.bTracers)) {
		INITFLAGS ("Weapon Fx: ");
		ADDFLAG (AXI.bLightTrails, "Light trails");
		ADDFLAG (AXI.bShockwaves, "Shockwaves");
		ADDFLAG (AXI.bTracers, "Tracers");
		ADDFLAG (AXI.bShowWeapons, "Weapons");
		}
	else
		sprintf (mTexts [opt], "Weapon Fx: None");
	opt++;
	if (!AXI.bCompetition && (AXI.bDamageExplosions || AXI.bPlayerShield)) {
		INITFLAGS ("Ship Fx: ");
		ADDFLAG (AXI.bPlayerShield, "Shield");
		ADDFLAG (AXI.bDamageExplosions, "Damage");
		ADDFLAG (AXI.bGatlingSpeedUp, "Gatling speedup");
		}
	else
		sprintf (mTexts [opt], "Ship Fx: None");
	opt++;
	if (AXI.nWeaponIcons || (!AXI.bCompetition && (AXI.bTargetIndicators || AXI.bDamageIndicators))) {
		INITFLAGS ("HUD extensions: ");
		ADDFLAG (AXI.nWeaponIcons != 0, "Icons");
		ADDFLAG (!AXI.bCompetition && AXI.bTargetIndicators, "Tgt indicators");
		ADDFLAG (!AXI.bCompetition && AXI.bDamageIndicators, "Dmg indicators");
		ADDFLAG (!AXI.bCompetition && AXI.bMslLockIndicators, "Trk indicators");
		}
	else
		strcat (mTexts [opt], "HUD extensions: None");
	opt++;
	if (!AXI.bCompetition && AXI.bRadarEnabled) {
		INITFLAGS ("Radar: ");
		ADDFLAG ((AGI.gameFlags & NETGAME_FLAG_SHOW_MAP) != 0, "Players");
		ADDFLAG (AXI.nRadar, "Radar");
		ADDFLAG (AXI.bPowerupsOnRadar, "Powerups");
		ADDFLAG (AXI.bRobotsOnRadar, "Robots");
		}
	else
		strcat (mTexts [opt], "Radar: off");
	opt++;
	if (!AXI.bCompetition && (AXI.bMouseLook || AXI.bFastPitch)) {
		INITFLAGS ("Controls ext.: ");
		ADDFLAG (AXI.bMouseLook, "mouselook");
		ADDFLAG (AXI.bFastPitch, "fast pitch");
		}
	else
		strcat (mTexts [opt], "Controls ext.: None");
	opt++;
	if (!AXI.bCompetition && 
		 (AXI.bDualMissileLaunch || !AXI.bFriendlyFire || AXI.bInhibitSuicide || 
		  AXI.bEnableCheats || AXI.bDarkness || (AXI.nFusionRamp != 2))) {
		INITFLAGS ("Gameplay ext.: ");
		ADDFLAG (AXI.bEnableCheats, "Cheats");
		ADDFLAG (AXI.bDarkness, "Darkness");
		ADDFLAG (AXI.bSmokeGrenades, "Smoke Grens");
		ADDFLAG (AXI.bDualMissileLaunch, "Dual Msls");
		ADDFLAG (AXI.nFusionRamp != 2, "Fusion ramp");
		ADDFLAG (!AXI.bFriendlyFire, "no FF");
		ADDFLAG (AXI.bInhibitSuicide, "no suicide");
		ADDFLAG (AXI.bKillMissiles, "shoot msls");
		ADDFLAG (AXI.bTripleFusion, "tri fusion");
		ADDFLAG (AXI.bEnhancedShakers, "enh shakers");
		ADDFLAG (AXI.nHitboxes, "hit boxes");
		}
	else
		strcat (mTexts [opt], "Gameplay ext.: None");
	opt++;
	}
bAlreadyShowingInfo = 1;
nInMenu = gameStates.menus.nInMenu;
gameStates.menus.nInMenu = 0;
gameStates.menus.bNoBackground = 0;
m.TinyMenu (NULL, TXT_NETGAME_INFO);
gameStates.menus.bNoBackground = 0;
gameStates.app.bGameRunning = 0;
gameStates.menus.nInMenu = nInMenu;
bAlreadyShowingInfo = 0;
 }
Esempio n. 3
0
void NetworkProcessNamesReturn (char *dataP)
 {
	CMenu	m (15);
   char	mText [15][50], temp [50];
	int	i, l, nInMenu, gnum, num = 0, count = 5, nPlayers;
   
if (networkData.nNamesInfoSecurity != *reinterpret_cast<int*> (dataP + 1)) {
#if 1			
  console.printf (CON_DBG, "Bad security on names return!\n");
  console.printf (CON_DBG, "NIS=%d dataP=%d\n", networkData.nNamesInfoSecurity, *reinterpret_cast<int*> (dataP + 1));
#endif
	return;
	}
nPlayers = dataP [count++]; 
if (nPlayers == 255) {
	gameStates.multi.bSurfingNet = 0;
	networkData.nNamesInfoSecurity = -1;
	MsgBox (NULL, NULL, 1, "OK", "That game is refusing\nname requests.\n");
	gameStates.multi.bSurfingNet=1;
	return;
	}
Assert ((nPlayers > 0) && (nPlayers < MAX_NUM_NET_PLAYERS));
for (i = 0; i < 12; i++) 
	m.AddText (mText [i]);	

#if SECURITY_CHECK
for (gnum = -1, i = 0; i < networkData.nActiveGames; i++) {
	if (networkData.nNamesInfoSecurity == activeNetGames [i].nSecurity) {
		gnum = i;
		break;
		}
	}
if (gnum == -1) {
	gameStates.multi.bSurfingNet = 0;
	networkData.nNamesInfoSecurity = -1;
	MsgBox (NULL, NULL, 1, TXT_OK, TXT_GAME_GONE);
	gameStates.multi.bSurfingNet = 1;
	return;
	}
#else
gnum = 0;
#endif
sprintf (mText [num], TXT_GAME_PLRS, activeNetGames [gnum].szGameName); 
num++;
for (i = 0; i < nPlayers; i++) {
	l = dataP [count++];
	memcpy (temp, dataP + count, CALLSIGN_LEN + 1);
	count += CALLSIGN_LEN + 1;
	if (gameOpts->multi.bNoRankings)
		sprintf (mText [num], "%s", temp);
	else
		sprintf (mText [num], "%s%s", pszRankStrings [l], temp);
	num++;
	}
if (dataP [count] == 99) {
	sprintf (mText [num++], " ");
	sprintf (mText [num++], TXT_SHORT_PACKETS2, dataP [count+1] ? TXT_ON : TXT_OFF);
	sprintf (mText [num++], TXT_PPS2, dataP [count+2]);
	}
bAlreadyShowingInfo = 1;
nInMenu = gameStates.menus.nInMenu;
gameStates.menus.nInMenu = 0;
m.TinyMenu (NULL, NULL);
gameStates.menus.nInMenu = nInMenu;
bAlreadyShowingInfo = 0;
}