C# Class Terrarium.Game.OrganismBaseBinder

Base class for all serialization binders. Contains methods for validating a number of common assemblies. The Binder is being added so that we can validate data being deserialized. We want to make sure someone doesn't insert bogus types into the stream or types that might be able to be loaded on the destination client and used for the purposes of a hack.
Inheritance: System.Runtime.Serialization.SerializationBinder
Mostra file Open project: eugeniomiro/Terrarium

Protected Methods

Method Description
CompareParts ( string asm1, string asm2 ) : bool

The purpose of this function is to make sure that the assemblies are effectively the same, everything except version number. This is how we check what assemblies serialization is trying to deserialize. Sample: mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089

IsMscorlib ( string asm ) : bool

Determines if an assembly full name matches that of MSCorLib.dll

IsOrganismBase ( string asm ) : bool

Determines if an assembly full name matches that of OrganismBase.dll

IsSystem ( string asm ) : bool

Determines if an assembly full name matches that of System.dll

IsSystemDrawing ( string asm ) : bool

Determines if an assembly full name matches that of System.Drawing.dll

IsTerrarium ( string asm ) : bool

Determines if an assembly full name matches that of TerrariumEngine.dll

Method Details

CompareParts() protected static method

The purpose of this function is to make sure that the assemblies are effectively the same, everything except version number. This is how we check what assemblies serialization is trying to deserialize. Sample: mscorlib, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
protected static CompareParts ( string asm1, string asm2 ) : bool
asm1 string Full Assembly name of the first assembly.
asm2 string Full assembly name of the second assembly.
return bool

IsMscorlib() protected static method

Determines if an assembly full name matches that of MSCorLib.dll
protected static IsMscorlib ( string asm ) : bool
asm string assembly full name to match.
return bool

IsOrganismBase() protected static method

Determines if an assembly full name matches that of OrganismBase.dll
protected static IsOrganismBase ( string asm ) : bool
asm string assembly full name to match.
return bool

IsSystem() protected static method

Determines if an assembly full name matches that of System.dll
protected static IsSystem ( string asm ) : bool
asm string assembly full name to match.
return bool

IsSystemDrawing() protected static method

Determines if an assembly full name matches that of System.Drawing.dll
protected static IsSystemDrawing ( string asm ) : bool
asm string assembly full name to match.
return bool

IsTerrarium() protected static method

Determines if an assembly full name matches that of TerrariumEngine.dll
protected static IsTerrarium ( string asm ) : bool
asm string assembly full name to match.
return bool