예제 #1
0
DLLFUNC int MOD_INIT(m_help)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_HELP, m_help, 1, 0);
	CommandAdd(modinfo->handle, MSG_HELPOP, m_help, 1, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #2
0
파일: nopost.c 프로젝트: wirelesspt/unreal
DLLFUNC int MOD_INIT(nopost)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, "GET", NULL, nopost, MAXPARA, M_UNREGISTERED);
	CommandAdd(modinfo->handle, "POST", NULL, nopost, MAXPARA, M_UNREGISTERED);
	CommandAdd(modinfo->handle, "PUT", NULL, nopost, MAXPARA, M_UNREGISTERED);
	HookAddEx(modinfo->handle, HOOKTYPE_CONFIGRUN, nopost_config_run);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	init_config();
	return MOD_SUCCESS;
}
예제 #3
0
파일: m_sasl.c 프로젝트: Adam-/unrealircd
/* This is called on module init, before Server Ready */
DLLFUNC int MOD_INIT(m_sasl)(ModuleInfo *modinfo)
{
	MARK_AS_OFFICIAL_MODULE(modinfo);

	CommandAdd(modinfo->handle, MSG_SASL, TOK_SASL, m_sasl, MAXPARA, M_USER|M_SERVER);
	CommandAdd(modinfo->handle, MSG_SVSLOGIN, TOK_SVSLOGIN, m_svslogin, MAXPARA, M_USER|M_SERVER);
	CommandAdd(modinfo->handle, MSG_AUTHENTICATE, TOK_AUTHENTICATE, m_authenticate, MAXPARA, M_UNREGISTERED);

	HookAddEx(modinfo->handle, HOOKTYPE_LOCAL_CONNECT, abort_sasl);
	HookAddEx(modinfo->handle, HOOKTYPE_LOCAL_QUIT, abort_sasl);

	return MOD_SUCCESS;
}
예제 #4
0
DLLFUNC int MOD_INIT(jumpserver)(ModuleInfo *modinfo)
{
	ModuleSetOptions(modinfo->handle, MOD_OPT_PERM);
	CommandAdd(modinfo->handle, MSG_JUMPSERVER, TOK_JUMPSERVER, m_jumpserver, 3, M_USER);
	HookAddEx(modinfo->handle, HOOKTYPE_PRE_LOCAL_CONNECT, jumpserver_preconnect);
	return MOD_SUCCESS;
}
예제 #5
0
DLLFUNC int MOD_INIT(m_gqline)(ModuleInfo *modinfo)
{
    myinfo = modinfo;
    CmdGQLine = CommandAdd(myinfo->handle, MSG_GQLINE, TOK_GQLINE, m_gqline, 3, 0);
    if (!CmdGQLine) {
        config_error("m_gqline: Failed to add command /GQLINE : %s", ModuleGetErrorStr(myinfo->handle));
        return MOD_FAILED;
    }
    CmdQLine = CommandAdd(myinfo->handle, MSG_QLINE, TOK_QLINE, m_qline, 3, 0);
    if (!CmdQLine) {
        CommandDel(CmdGQLine);
        config_error("m_gqline: Failed to add command /QLINE : %s", ModuleGetErrorStr(myinfo->handle));
        return MOD_FAILED;
    }
    return MOD_SUCCESS;
}
예제 #6
0
static Command *AddCommand(Module *module, char *msg, char *token, iFP func)
{
	Command *cmd;

	if (CommandExists(msg))
    	{
		config_error("Command %s already exists", msg);
		return NULL;
    	}
    	if (CommandExists(token))
	{
		config_error("Token %s already exists", token);
		return NULL;
    	}

	cmd = CommandAdd(module, msg, token, func, MAXPARA, 0);

#ifndef STATIC_LINKING
	if (ModuleGetError(module) != MODERR_NOERROR || !cmd)
#else
	if (!cmd)
#endif
	{
#ifndef STATIC_LINKING
		config_error("Error adding command %s: %s", msg,
			ModuleGetErrorStr(module));
#else
		config_error("Error adding command %s", msg);
#endif
		return NULL;
	}

	return cmd;
}
예제 #7
0
DLLFUNC int MOD_INIT(m_starttls)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_STARTTLS, m_starttls, MAXPARA, M_UNREGISTERED|M_ANNOUNCE);

	HookAddVoidEx(modinfo->handle, HOOKTYPE_CAPLIST, m_starttls_caplist);

	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #8
0
파일: m_rmtkl.c 프로젝트: wirelesspt/unreal
DLLFUNC int MOD_INIT(m_rmtkl)(ModuleInfo *modinfo)
{
	if (!CommandAdd(modinfo->handle, "RMTKL", NULL, m_rmtkl, 3, 0) ||
	    (ModuleGetError(modinfo->handle) != MODERR_NOERROR))
	{
		config_error("Error adding command RMTKL: %s",
			ModuleGetErrorStr(modinfo->handle));
		return MOD_FAILED;
	}

	return MOD_SUCCESS;
}
//-----------------------------------------------------------------------------
// Purpose: Queue a list of envelope points into a sound patch's event list
// Input  : *pSound - The sound patch to be operated on
//			soundCommand - Type of operation the envelope describes
//			*points - List of enevelope points
//			numPoints - Number of points provided
// Output : float - Returns the total duration of the envelope
//-----------------------------------------------------------------------------
float CSoundControllerImp::SoundPlayEnvelope( CSoundPatch *pSound, soundcommands_t soundCommand, envelopePoint_t *points, int numPoints )
{
	float	amplitude	= 0.0f;
	float	duration	= 0.0f;
	float	totalDuration	= 0.0f;

	Assert( points );

	// Clear out all previously acting commands
	CommandClear( pSound );

	// Evaluate and queue all points
	for ( int i = 0; i < numPoints; i++ )
	{
		// See if we're keeping our last amplitude for this new point
		if ( ( points[i].amplitudeMin != -1.0f ) || ( points[i].amplitudeMax != -1.0f ) )
		{
			amplitude = random->RandomFloat( points[i].amplitudeMin, points[i].amplitudeMax );
		}
		else if ( i == 0 )
		{
			// Can't do this on the first entry
			Msg( "Invalid starting amplitude value in envelope!  (Cannot be -1)\n" );
		}

		// See if we're keeping our last duration for this new point
		if ( ( points[i].durationMin != -1.0f ) || ( points[i].durationMax != -1.0f ) )
		{
			duration = random->RandomFloat( points[i].durationMin, points[i].durationMax );	
			//duration = points[i].durationMin;
		}
		else if ( i == 0 )
		{
			// Can't do this on the first entry
			Msg( "Invalid starting duration value in envelope! (Cannot be -1)\n" );
		}

		// Queue the command
		CommandAdd( pSound, totalDuration, soundCommand, duration, amplitude );

		// Tack this command's duration onto the running duration
		totalDuration += duration;
	}

	return totalDuration;
}
예제 #10
0
DLLFUNC int MOD_INIT(m_botmotd)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_BOTMOTD, m_botmotd, MAXPARA, M_USER|M_SERVER);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #11
0
/* This is called on module init, before Server Ready */
DLLFUNC int MOD_INIT(m_svssilence)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_SVSSILENCE, m_svssilence, MAXPARA, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #12
0
DLLFUNC int MOD_INIT(m_svsnick)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_SVSNICK, m_svsnick, MAXPARA, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #13
0
DLLFUNC int MOD_INIT(m_sdesc)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_SDESC, m_sdesc, 1, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #14
0
/* This is called on module init, before Server Ready */
DLLFUNC int MOD_INIT(m_whois)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_WHOIS, m_whois, MAXPARA, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #15
0
DLLFUNC int MOD_INIT(m_setname)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_SETNAME, m_setname, 1, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #16
0
DLLFUNC int MOD_INIT(m_umode2)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_UMODE2, m_umode2, MAXPARA, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #17
0
파일: m_dccallow.c 프로젝트: SwiftIRC/ircd
DLLFUNC int MOD_INIT(m_dccallow)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_DCCALLOW, NULL, m_dccallow, 1, M_USER|M_ANNOUNCE);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #18
0
DLLFUNC int MOD_INIT(m_squit)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_SQUIT, m_squit, 2, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #19
0
DLLFUNC int MOD_INIT(m_list)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_LIST, m_list, MAXPARA, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #20
0
DLLFUNC int MOD_INIT(m_setident)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_SETIDENT, m_setident, MAXPARA, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #21
0
DLLFUNC int MOD_INIT(m_names)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_NAMES, m_names, MAXPARA, M_USER|M_SERVER);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #22
0
DLLFUNC int MOD_INIT(m_user)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_USER, TOK_USER, m_user, 4, M_USER|M_UNREGISTERED);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #23
0
DLLFUNC int MOD_INIT(m_protoctl)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_PROTOCTL, m_protoctl, MAXPARA, M_UNREGISTERED|M_SERVER|M_USER);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #24
0
/* This is called on module init, before Server Ready */
DLLFUNC int MOD_INIT(m_svspart)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_SVSPART, m_svspart, 3, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #25
0
파일: m_part.c 프로젝트: Adam-/unrealircd
DLLFUNC int MOD_INIT(m_part)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_PART, TOK_PART, m_part, 2, M_USER);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #26
0
파일: m_userip.c 프로젝트: Adam-/unrealircd
DLLFUNC int MOD_INIT(m_userip)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_USERIP, NULL, m_userip, 1, M_USER|M_ANNOUNCE);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #27
0
DLLFUNC int MOD_INIT(m_nick)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_NICK, TOK_NICK, m_nick, MAXPARA, M_USER|M_SERVER|M_UNREGISTERED);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #28
0
DLLFUNC int MOD_INIT(m_ison)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_ISON, m_ison, 1, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}
예제 #29
0
파일: m_join.c 프로젝트: blank4/unrealircd
DLLFUNC int MOD_INIT(m_join)(ModuleInfo *modinfo)
{
    CommandAdd(modinfo->handle, MSG_JOIN, TOK_JOIN, m_join, MAXPARA, M_USER);
    MARK_AS_OFFICIAL_MODULE(modinfo);
    return MOD_SUCCESS;
}
예제 #30
0
DLLFUNC int MOD_INIT(m_locops)(ModuleInfo *modinfo)
{
	CommandAdd(modinfo->handle, MSG_LOCOPS, m_locops, 1, 0);
	MARK_AS_OFFICIAL_MODULE(modinfo);
	return MOD_SUCCESS;
}