Ejemplo n.º 1
0
bool PersistentTimer::Store(Database *db) {
	if(Expired(db, false))	//dont need to store expired timers.
		return(true);
	
	char errbuf[MYSQL_ERRMSG_SIZE];
    char *query = 0;
	uint32 qlen = 0;
	
	qlen = MakeAnyLenString(&query, "REPLACE INTO timers "
		" (char_id,type,start,duration,enable) "
		" VALUES(%lu,%u,%lu,%lu,%d)",
		(unsigned long)_char_id, _type, (unsigned long)start_time, (unsigned long)timer_time, enabled?1:0);
	
	
#ifdef DEBUG_PTIMERS
	printf("Storing timer: char %lu of type %u: '%s'\n", (unsigned long)_char_id, _type, query);
#endif
	
	if (!db->RunQuery(query, qlen, errbuf)) {
		safe_delete_array(query);
#if EQDEBUG > 5
		LogFile->write(EQEMuLog::Error, "Error in PersistentTimer::Store, error: %s", errbuf);
#endif
		return(false);
	}
	safe_delete_array(query);
	
	return(true);
}
Ejemplo n.º 2
0
/*******************************************************
*   The Common pool is a group of all plugins/addons/functions
*******************************************************/
CommonPool::CommonPool(){
	expired = Expired();

	if (expired)	printf("expired !\n");

	// To be save set them to nil 
	importmenu = NULL;
	tt = NULL;				// ToolTips
	progress = NULL;
	player = NULL;
	PrefWin = NULL;
	
	m_playing = false;
	play_pointer = 0;
	changed = false;
	save_mode = 0;
	last_pointer = 0;
	sample_view_dirty = true;	// update the sample-view
	update_draw_cache = true;	// update the draw cache
	update_peak = false;
	update_index = true;
	play_cookie.buffer = NULL;

	tool_mode = SELECT_TOOL;

	for (int i=0; i<8; i++)
		BufferHook[i] = NULL;
}
Ejemplo n.º 3
0
void InputAPI::PruneDeadInputContexts()
{
    auto iter = registeredInputContexts.Begin();

    while(iter != registeredInputContexts.End())
    {
        if (iter->Expired())
            iter = registeredInputContexts.Erase(iter);
        else
            ++iter;
    }
}
Ejemplo n.º 4
0
    void AbstractBednet::Update( float dt )
    {
        if( Expired() ) return;

        if( !BaseIntervention::UpdateIndividualsInterventionStatus() ) return;

        UpdateUsage( dt );
        UpdateBlockingAndKilling( dt );

        if( IsUsingBednet() )
        {
            UseBednet();
        }

        if( CheckExpiration( dt ) )
        {
            SetExpired( true );
        }
    }