logo
Main

Forums

Downloads

Unreal-Netiquette

Donate for Oldunreal:
Donate

borderline

Links to our wiki:
Wiki

Walkthrough

Links

Tutorials

Unreal Reference

Usermaps

borderline

Contact us:
Submit News
Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic [Snippet] Exec interface. (Read 524 times)
han
Global Moderator
Unreal Rendering Guru
Developer Team
*****
Offline


Oldunreal member

Posts: 564
Location: Germany
Joined: Dec 10th, 2014
Gender: Male
[Snippet] Exec interface.
Nov 6th, 2015 at 3:04pm
Print Post  
When you have some special class (like a renderdevice, engine, etc.) you receive commands over the Exec interface. And basically it works like this. You create another pointer (Str) to the original command passed in. ParseCommand will change the position Str points to, so you loose parts of your Cmd, but if needed you can always use Cmd again. The second argument is where the output goes. For example if you type a command in the ingame console and log to Ar, it will show up there. Or you get it as return value when using the ConsoleCommand() function in UnrealScript.

Code
Select All
// FExec interface.
UBOOL URevisionContent::Exec( const TCHAR* Cmd, FOutputDevice& Ar )
{
	guard(URevisionContent::Exec);
	const TCHAR* Str = Cmd;
	if ( ParseCommand(&Str,TEXT("Content")) )
	{
		if ( ParseCommand(&Str,TEXT("List")) )
		{
			Ar.Logf( TEXT("Contents:") );
			{for ( INT i=0; i<Contents.Num(); i++ )
				Ar.Logf( TEXT("  %s"), *Contents(i) );}
			return 1;
		}
	}
	return 0;
	unguard;
}
 

  

HX on Mod DB. Revision on Steam.
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint
Bookmarks: del.icio.us Digg Facebook Google Google+ Linked in reddit StumbleUpon Twitter Yahoo