Beispiel #1
0
void D_PickRandomTeam (int player)
{
	static char teamline[8] = "\\team\\X";

	BYTE *foo = (BYTE *)teamline;
	teamline[6] = (char)D_PickRandomTeam() + '0';
	D_ReadUserInfoStrings (player, &foo, teamplay);
}
Beispiel #2
0
bool FCajunMaster::DoAddBot (BYTE *info, botskill_t skill)
{
    int bnum;

    for (bnum = 0; bnum < MAXPLAYERS; bnum++)
    {
        if (!playeringame[bnum])
        {
            break;
        }
    }

    if (bnum == MAXPLAYERS)
    {
        Printf ("The maximum of %d players/bots has been reached\n", MAXPLAYERS);
        return false;
    }

    D_ReadUserInfoStrings (bnum, &info, false);

    if (!deathmatch && playerstarts[bnum].type == 0)
    {
        Printf ("%s tried to join, but there was no player %d start\n",
                players[bnum].userinfo.GetName(), bnum+1);
        ClearPlayer (bnum, false);	// Make the bot inactive again
        return false;
    }

    multiplayer = true; //Prevents cheating and so on; emulates real netgame (almost).
    players[bnum].Bot = new DBot;
    players[bnum].Bot->player = &players[bnum];
    players[bnum].Bot->skill = skill;
    playeringame[bnum] = true;
    players[bnum].mo = NULL;
    players[bnum].playerstate = PST_ENTER;

    if (teamplay)
        Printf ("%s joined the %s team\n", players[bnum].userinfo.GetName(), Teams[players[bnum].userinfo.GetTeam()].GetName());
    else
        Printf ("%s joined the game\n", players[bnum].userinfo.GetName());

    G_DoReborn (bnum, true);
    if (StatusBar != NULL)
    {
        StatusBar->MultiplayerChanged ();
    }

    return true;
}
Beispiel #3
0
bool FCajunMaster::DoAddBot (uint8_t *info, botskill_t skill)
{
	int bnum;

	for (bnum = 0; bnum < MAXPLAYERS; bnum++)
	{
		if (!playeringame[bnum])
		{
			break;
		}
	}

	if (bnum == MAXPLAYERS)
	{
		Printf ("The maximum of %d players/bots has been reached\n", MAXPLAYERS);
		return false;
	}

	D_ReadUserInfoStrings (bnum, &info, false);

	multiplayer = true; //Prevents cheating and so on; emulates real netgame (almost).
	players[bnum].Bot = Create<DBot>();
	players[bnum].Bot->player = &players[bnum];
	players[bnum].Bot->skill = skill;
	playeringame[bnum] = true;
	players[bnum].mo = NULL;
	players[bnum].playerstate = PST_ENTER;

	if (teamplay)
		Printf ("%s joined the %s team\n", players[bnum].userinfo.GetName(), Teams[players[bnum].userinfo.GetTeam()].GetName());
	else
		Printf ("%s joined the game\n", players[bnum].userinfo.GetName());

	G_DoReborn (bnum, true);
	return true;
}
void FCajunMaster::DoAddBot (int bnum, char *info)
{
	BYTE *infob = (BYTE *)info;
	D_ReadUserInfoStrings (bnum, &infob, false);
	if (!deathmatch && playerstarts[bnum].type == 0)
	{
		Printf ("%s tried to join, but there was no player %d start\n",
			players[bnum].userinfo.netname, bnum+1);
		ClearPlayer (bnum, false);	// Make the bot inactive again
		if (botnum > 0)
		{
			botnum--;
		}
	}
	else
	{
		multiplayer = true; //Prevents cheating and so on; emulates real netgame (almost).
		players[bnum].isbot = true;
		playeringame[bnum] = true;
		players[bnum].mo = NULL;
		players[bnum].playerstate = PST_ENTER;
		botingame[bnum] = true;

		if (teamplay)
			Printf ("%s joined the %s team\n", players[bnum].userinfo.netname,Teams[players[bnum].userinfo.team].GetName ());
		else
			Printf ("%s joined the game\n", players[bnum].userinfo.netname);

		G_DoReborn (bnum, true);
		if (StatusBar != NULL)
		{
			StatusBar->MultiplayerChanged ();
		}
	}
	waitingforspawn[bnum] = false;
}