I don't need to test my programs. I have an error-correcting modem.

Difference between revisions of "UE1:NBSPReporter (Class)"

From Unreal Wiki, The Unreal Engine Documentation Site
Jump to: navigation, search
m (Variables)
 
(No difference)

Latest revision as of 18:18, 5 April 2009

Purpose[edit]

Variables[edit]

Functions[edit]

function n() Input: string a, string b Output: None

  • Concatenate the contents of a and b then store the result in a.
  • Call the nlog() function of nsbp and send it the contents of a.

Discussion[edit]

Complete source code[edit]

//=============================================================================
// NBSPReporter ==> NoBullShitPlus v1.09
//=============================================================================
 
class NBSPReporter extends Info;
 
var NBSP nbsp;
var PlayerPawn p;
 
function n( String a, String b )
{
	a = a @ b;
	nbsp.nlog(a);
}
 
//Report ServerMessage
function ReportServerMessage(playerpawn b, private string f, private string g)
{
	local string a;
	a = Right(f, (Len(f)-(InStr(f,",")+1)));
        nbsp.nlog("#### ---------------------------------------------- ");
	nbsp.nlog("#### NBSP - CLIENT HACK DETECTED -"@Left(f, InStr(f,",")));
	nbsp.nlog("#### ---------------------------------------------- ");
	nbsp.nlog("#### - Player Name: "$b.PlayerReplicationInfo.PlayerName);
	nbsp.nlog("#### - Player IP: "$nbsp.IPOnly(b.GetPlayerNetworkAddress()));
 
	if (len(f) == 0)
        	nbsp.nlog("#### - Details: Data caused a problem.");
	else		
        nbsp.nlog("#### - Details: "$Left(a, Instr(a,","))$".");
 
	if (len(g) != 0)
        	nbsp.nlog("#### - Method: "$g);
 
        nbsp.nlog("#### - Panic degree: "$Mid(Mid(a, (Instr(a,","))+1), (Instr(Mid(a, (Instr(a,","))+1),","))+1)$".");
	nbsp.nlog("#### - Date/Time: "$Level.Month$"-"$Level.Day$"-"$Level.Year$" / "$Level.Hour$":"$Level.Minute$":"$Level.Second);	
	nbsp.nlog("#### ----------------------------------------------");
}
 
//Report ClientMessage
function ReportClientMessage(playerpawn b, private string f, private string g)
{
	local string a;
	a = Right(f, (Len(f)-(InStr(f,",")+1)));
        b.ClientMessage( "========================================================" );
	b.ClientMessage( "NBSP - Possible Client Hack Detected/"$Left(f, InStr(f,",")));
        b.ClientMessage( "========================================================" );
	b.ClientMessage( "Your client has been found with a possible hack.");
	b.ClientMessage( "**");
 
	if (len(f) == 0)
	{
		b.ClientMessage( "Details: Package data caused a problem..." );
		b.ClientMessage( "          NBSP had trouble recieving data from the client." );
		b.ClientMessage( "          Panic degree is Medium!" );
	}
	else
	{
		b.ClientMessage( "Details:"@Left(a, Instr(a,","))$"...");
		b.ClientMessage( "           "@Left(Mid(a, (Instr(a,","))+1), InStr(Mid(a, (Instr(a,","))+1),","))$".");
		b.ClientMessage( "            Panic degree is"@Mid(Mid(a, (Instr(a,","))+1), (Instr(Mid(a, (Instr(a,","))+1),","))+1)$"!");
	}
 
	if (len(g) != 0)
	{
		b.ClientMessage( " ");
		b.ClientMessage( "Cause:"@g);
	}
 
	b.ClientMessage( "**");
	b.ClientMessage( "Any Problems? Email <"$nbsp.settings.AdminEmail$">");
 
	if (len(nbsp.settings.ServerURL) != 0)
		b.ClientMessage( "Or Visit:"@nbsp.settings.ServerURL);
 
        b.ClientMessage( "========================================================" );
}
 
function GetErrorMessage(private int a, out String b)
{
	switch (a)
	{
		case 0:	//No error
		b = "";
		break;
		case 1:
		b = "CORE,Illegal system paths detected,You have modified your default system paths,Low";
		break;
		case 2:
		b = "CLASS,Illegal classes encounted,Client has possibly intercepted a class,High";
		break;
		case 3:
		b = "TIMEOUT,Client failed to initialise,Your client has timed out after "$nbsp.settings.MaxTimeout@"seconds,Low";
		break;
		case 4:
		b = "OBJECT,Active illegal package encountered,Client is running an unspecified package,High";
		break;
		case 5:
		b = "PACKAGE,Invalid default package encountered,You have an illegal default package,High";
		break;
		case 6:
		b = "CRC,Invalid checksum recieved,You have modified a package,Very High";
		break;		
		case 7:
		b = "NBSP,Illegal tampered data encountered,Client has tampered with NBSP,Very High";
		break;
		case 8:
		b = "CONSOLE,Console data not recieved,Client has tampered with NBSP/Console,Low";
		break;
		case 9:
		b = "CANVAS,Illegal canvas limit exceeded,You are trying to use an illegal canvas/radar,High";
		break;
		case 10:
		b = "SKINS,Illegal skin hack detected,Your client was involved with an illegal skin,Medium";
		break;
		case 11:
		b = "PACKAGE,Illegal package encountered,Your client has an illegal package,High";
		break;
		case 12:
		b = "MOD,Illegal mod encountered,Your client has an illegal mod,High";
		break;
		case 13:
		b = "VERSION,Unsupported client version encountered,Please update your current version of Unreal Tournament,Low";
		break;
		case 14:
		b = "EXTERNAL,External hack detected,Your client may be using an external hack,Very High";
		break;
		case 15:
		b = "CRC,Checksum generation failed,You have failed to generate a checksum,Low";
		break;
		case 16:
		b = "LIGHT,Illegal light combination,Your client was involved with illegal light intergers,High";
		break;
		default:
		b = "UNKNOWN,Unknown fault detected,NBSP has detected a fault on your client,Low";
		break;
	}
}
 
//Report Joins/Parts of the server
function ReportEvent(private string a, private string b)
{
	nbsp.nlog("[NBSP]- "$a@b);
}
 
//Report Log Parsing
function zzParse (private string n, private string a)
{
	nbsp.nlog("[NBSP]- Parsing "$a$" for "$n$"...");
}
 
function serverlog (private string n, private string a)
{
	nbsp.nlog("[NBSP]["$n$"]- "$a);
}
 
defaultproperties
{
	bHidden=true
}

Footer[edit]