XNA DEBUG TERMINAL

Post on 18-Mar-2016

47 views 3 download

description

XNA DEBUG TERMINAL. Created By: Kevin Cherry. What is XNA Debug Terminal?. A library that creates a display to run on top of your game allowing you to retrieve/set values and invoke methods. How Does it Work?. - PowerPoint PPT Presentation

Transcript of XNA DEBUG TERMINAL

Created By:Kevin Cherry

A library that creates a display to run on top A library that creates a display to run on top of your game allowing you to retrieve/set of your game allowing you to retrieve/set values and invoke methods.values and invoke methods.

To understand how this is possible, we need to To understand how this is possible, we need to examine some basic and .Net specific conceptsexamine some basic and .Net specific concepts

Interpreted languages evaluate source code Interpreted languages evaluate source code at runtimeat runtime Code is not compiled but rather parsed and Code is not compiled but rather parsed and

evaluated as needed.evaluated as needed. Examples: JavaScript, PHP, Python, RubyExamples: JavaScript, PHP, Python, Ruby

Compiled languages compile to assembly or Compiled languages compile to assembly or special/proprietary intermediate language special/proprietary intermediate language losing type information in the process, losing type information in the process, making arbitrary code execution at runtime making arbitrary code execution at runtime impossible.impossible. Examples: C#, C++, Java, VBExamples: C#, C++, Java, VB

Why it is possible to interpret strings containing Why it is possible to interpret strings containing code at runtime with a .Net languagecode at runtime with a .Net language .Net converts code into Microsoft Intermediate .Net converts code into Microsoft Intermediate

Language and a metadata file. The metadata Language and a metadata file. The metadata file contains all the information obtained from file contains all the information obtained from parsing the source types and MSIL contains parsing the source types and MSIL contains the instructions for execution. Querying this the instructions for execution. Querying this metadata we can obtain links to type metadata we can obtain links to type members.members.

To query this metadata file, we use reflections. To query this metadata file, we use reflections. This part of the .Net framework provides This part of the .Net framework provides information on the specified object’s type information on the specified object’s type which can be used to retrieve fields/properties which can be used to retrieve fields/properties or invoke methods.or invoke methods.

It converts your expression into subexpressions, It converts your expression into subexpressions, then parses and evaluates them using reflections.then parses and evaluates them using reflections.

Pressing custom set key shows/hides Pressing custom set key shows/hides displaydisplay

Invoke method for restoring health of Invoke method for restoring health of playerplayer

CastingCasting EnumsEnums IdentifiersIdentifiers LiteralsLiterals MethodsMethods NewNew Object chainsObject chains TypesTypes

Anonymous Types/FunctionsAnonymous Types/Functions Array indexing or initializationArray indexing or initialization ArithmeticArithmetic Collection initializationCollection initialization Conditional logicConditional logic GenericsGenerics Keywords:Keywords:

as, base, default (e.g. default(int)), fixed, is, out, as, base, default (e.g. default(int)), fixed, is, out, ref, sizeof, stackalloc, this, throw, typeof, ref, sizeof, stackalloc, this, throw, typeof, unchecked, unsafeunchecked, unsafe

Lambda FunctionsLambda Functions LINQLINQ Logic Operators (&, |, ^, &&, ||)Logic Operators (&, |, ^, &&, ||) Property indexersProperty indexers

Bugs in expression parsingBugs in expression parsing Common/Frequently used C# expressionsCommon/Frequently used C# expressions Bugs elsewhereBugs elsewhere Common/Frequently used C# keywordsCommon/Frequently used C# keywords New Terminal commandsNew Terminal commands Terminal UI improvementsTerminal UI improvements Speed optimizationsSpeed optimizations Other improvementsOther improvements

Email me at: kcherr1@tigers.lsu.edu Email me at: kcherr1@tigers.lsu.edu with subject “with subject “XNA Debug Terminal Source Code" XNA Debug Terminal Source Code" to obtain to obtain

the source codethe source code Look over code and decide on a single task to Look over code and decide on a single task to

undertakeundertake Email me details of the task (what it is and about Email me details of the task (what it is and about

how long it will take you)how long it will take you) Email back the original source code with all of your Email back the original source code with all of your

changes when donechanges when done All contributors will get name in Authors file and All contributors will get name in Authors file and

Getting Involved, News, and Download webpagesGetting Involved, News, and Download webpages

Document all types, fields, properties, and methods Document all types, fields, properties, and methods you add using the "///" xml documentationyou add using the "///" xml documentation

Add test cases to the test project that cover your Add test cases to the test project that cover your newly added functionality and ensure that each one newly added functionality and ensure that each one passes. All previous test cases must pass as wellpasses. All previous test cases must pass as well

Try to follow the coding convention used by the Try to follow the coding convention used by the existing codeexisting code

Only change existing code when it concerns your Only change existing code when it concerns your single tasksingle task

http://www.protohacks.net/xna_debug_terminalhttp://www.protohacks.net/xna_debug_terminal