コード例 #1
0
Asteroid* UnitFactory::createAsteroid( const char *filename,
                                       int faction,
                                       Flightgroup *fg,
                                       int fg_snumber,
                                       float difficulty,
                                       ObjSerial netcreate )
{
    _Universe->netLock( true );
    Asteroid *ast = new Asteroid( filename, faction, fg, fg_snumber, difficulty );
    _Universe->netLock( false );
    if (netcreate)
        //Only allow creating through system files?  Doesn't make sense to be able to dynamically generate these.
        ast->SetSerial( netcreate );
/*
 *               if ( !_Universe->netLocked()) {
 *                       NetBuffer netbuf;
 *                       addAsteroidBuffer( netbuf, ast);
 *                       endBuffer(netbuf);
 *                       // NETFIXME: addBuffer for all subunits?
 *                       VSServer->broadcast( netbuf, 0, _Universe->activeStarSystem()->GetZone(), CMD_ENTERCLIENT, true);
 *               }
 *               VSServer->invalidateSnapshot();
 */
    return ast;
}
コード例 #2
0
Asteroid* UnitFactory::createAsteroid( const char * filename,
                                       int faction,
                                       Flightgroup* fg,
                                       int fg_snumber,
                                       float difficulty, ObjSerial netcreate )
{
    Asteroid * ast = new GameAsteroid( filename,
                         faction,
                         fg,
                         fg_snumber,
                         difficulty );
	if( netcreate) {
		KillDuplicateUnits( netcreate);
		ast->SetSerial( netcreate);
	}
	return ast;
}