void FeatureCompatibilityVersion::_runUpdateCommand(OperationContext* opCtx,
                                                    UpdateBuilder builder) {
    DBDirectClient client(opCtx);
    NamespaceString nss(NamespaceString::kServerConfigurationNamespace);

    BSONObjBuilder updateCmd;
    updateCmd.append("update", nss.coll());
    {
        BSONArrayBuilder updates(updateCmd.subarrayStart("updates"));
        {
            BSONObjBuilder updateSpec(updates.subobjStart());
            {
                BSONObjBuilder queryFilter(updateSpec.subobjStart("q"));
                queryFilter.append("_id", FeatureCompatibilityVersionParser::kParameterName);
            }
            {
                BSONObjBuilder updateMods(updateSpec.subobjStart("u"));
                builder(std::move(updateMods));
            }
            updateSpec.appendBool("upsert", true);
        }
    }
    updateCmd.append(WriteConcernOptions::kWriteConcernField, WriteConcernOptions::Majority);

    // Update the featureCompatibilityVersion document stored in the server configuration
    // collection.
    BSONObj updateResult;
    client.runCommand(nss.db().toString(), updateCmd.obj(), updateResult);
    uassertStatusOK(getStatusFromWriteCommandReply(updateResult));
}
Beispiel #2
0
void bbSystemPoll(){
	MSG msg;
	while( PeekMessage( &msg,0,0,0,PM_REMOVE ) ){

		switch( msg.message ){
		case WM_KEYDOWN:case WM_KEYUP:
		case WM_SYSKEYDOWN:case WM_SYSKEYUP:
			switch( msg.wParam ){
			case VK_SHIFT:
			case VK_CONTROL:
			case VK_MENU:
			case VK_LWIN:case VK_RWIN:
				updateMods();
				break;
			}
			break;
		}
		
		if( isControl( msg.hwnd ) ){
			HWND hwnd=GetParent( msg.hwnd );
			while( hwnd && isControl( hwnd ) ) hwnd=GetParent( hwnd );
			if( hwnd && IsDialogMessage( hwnd,&msg ) ) continue;
		}
		
		TranslateMessage( &msg );
		DispatchMessage( &msg );
	}
}
Beispiel #3
0
	void Input::runTask() {
		SDL_Event ev;
		while( SDL_PollEvent( &ev ) ) {
			SDL_Delay(0);
			switch(ev.type) {
			case SDL_KEYDOWN:
				updateMods(&ev);
				inject( &InputListener::onKeyPressed, makeKey(&ev) );
				break;
			case SDL_KEYUP:
				updateMods(&ev);
				inject( &InputListener::onKeyReleased, makeKey(&ev) );
				break;
			case SDL_MOUSEBUTTONDOWN:
				inject( &InputListener::onMouseButtonPressed, makeBut(&ev) );
				break;
			case SDL_MOUSEBUTTONUP:
				inject( &InputListener::onMouseButtonReleased, makeBut(&ev) );
				break;
			case SDL_MOUSEMOTION:
				inject( &InputListener::onMouseMoved, makeMov(&ev) );
				break;
			case SDL_VIDEORESIZE:
				inject( &InputListener::onVideoResize );
				break;
			case SDL_QUIT:
				inject( &InputListener::onClose );
				break;
			case SDL_ACTIVEEVENT:
				if(ev.active.state & SDL_APPACTIVE) {
					if(  ev.active.gain == 0 )
						inject( &InputListener::onLostFocus );
					else
						inject( &InputListener::onRegainedFocus );
				}
				break;
			default:
				break;
			}
		}
	}
void GameStateConfigBase::update() {
	updateAudio();
	updateInterface();
	updateMods();
}