void DogfightClass::EndGame (void)
{
	if (regenerationQueue)
	{
		regenerationQueue->Purge();
	}
	SetTimeCompression(0);
	MonoPrint ("Game has ended\n");
	MonoPrint ("GameStatus: dog Waiting\n");
	localGameStatus = gameStatus = dog_Waiting;
	flags |= DF_GAME_OVER;
	FalconLocalSession->SetFlyState(FLYSTATE_IN_UI);
}
void
StarServer::SetGameMode(int m)
{
    if (game_mode == m)
    return;

    if (m == LOAD_MODE) {
        Print("  game_mode = LOAD_MODE\n");
        paused = true;
    }

    else if (m == PLAY_MODE) {
        Print("  game_mode = PLAY_MODE\n");

        if (!world) {
            CreateWorld();
            InstantiateMission();
        }

        // stand alone server should wait for players to connect
        // before unpausing the simulation...
        SetTimeCompression(1);
        Pause(true);
    }

    else if (m == MENU_MODE) {
        Print("  game_mode = MENU_MODE\n");
        paused = true;

        Sim* sim = (Sim*) world;

        if (sim)
        sim->UnloadMission();
    }

    game_mode = m;
}
int FalconSimCampMessage::Process(uchar autodisp)
{
	CampEntity				ent = (CampEntity)vuDatabase->Find(EntityId());
	FalconSessionEntity		*session = (FalconSessionEntity*) vuDatabase->Find(dataBlock.from);
	
	if(autodisp || !ent || !session || !FalconLocalGame)
		return 0;
	
	CampEnterCriticalSection();
	switch (dataBlock.message)
	{
	case simcampReaggregate:
		if (check_bandwidth (150))
		{
			ent->Reaggregate(session);
			//MonoPrint ("Reag   %d\n", ent->Id().num_);
		}
		break;

	case simcampDeaggregate:

// OW: me123 MP Fix
#if 0
		if (check_bandwidth (150))
		{
#else
		if (check_bandwidth (150)|| ent->IsSetFalcFlag(FEC_PLAYER_ENTERING|FEC_HASPLAYERS))//me123
		{//me123 addet the player check
			//me123 send player deags so they can go past pie 2 fast
#endif
			//MonoPrint ("Deag   %d\n", ent->Id().num_);
			ent->Deaggregate(session);
		}
		else
		{
			//MonoPrint ("NoDeag %d\n", ent->Id().num_)
		}
		break;

	case simcampChangeOwner:
		//			MonoPrint ("Sim Camp Change Owner %08x %08x%08x\n", ent, session->Id ());
		ent->RecordCurrentState (session, FALSE);
		ent->SetDeagOwner (session->Id ());
		break;
		
	case simcampRequestDeagData:
		// MonoPrint ("Request Deag Data\n");
		ent->SendDeaggregateData(FalconLocalGame);
		break;

	case simcampReaggregateFromData:
		ent->ReaggregateFromData(dataBlock.size,dataBlock.data);
		break;

	case simcampDeaggregateFromData:
		ent->DeaggregateFromData(dataBlock.size,dataBlock.data);
		break;

	case simcampChangeOwnerFromData:
		break;

	case simcampRequestAllDeagData:
		{
			SetTimeCompression(1);//me123 if a client is callign this he's in the pie
			//let's set the compresion to 1 on the host so we don'e f**k up the realtime
			//becourse the clients stops transmitting timecompresion and we go to 64 again for awhile.
			int count = 0;
			VuListIterator	deag_it(DeaggregateList);
			CampEntity c;
			c = (CampEntity) deag_it.GetFirst();
			while (c)
			{
				if ((!c->IsAggregate()) && (c->IsLocal()))
				{
					c->SendDeaggregateData(FalconLocalGame);
					count ++;
				}
				c = (CampEntity) deag_it.GetNext();
			}
			
			//			MonoPrint ("Request All Deag Data = %d\n", count);
			break;
		}
	}
	CampLeaveCriticalSection();
	
	return 0;
}