M
M
muller922015-03-02 23:47:41
.NET
muller92, 2015-03-02 23:47:41

How to test the game?

There are problems with the game, the game consists of two parts client side (actionscrpt3) and server side (C# asynchronous socket) sometimes gives an error System.NullReferenceException: Object reference not set to an instance of an object. how to test and understand why an object reference becomes null. what to test and how to be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
V
Vitaly Pukhov, 2015-03-03
@Neuroware

If I understand correctly, the problem crashes on the client side (since it’s elementary to see it on the server side), if so, then you can do it like this, in each client function, in the very first line, add code something like

var file:File = File.documentsDirectory;
file = file.resolvePath("air_tests/saved_by_AIR.txt");
// create a stream object to read/write, and open in in APPEND mode
var stream:FileStream = new FileStream();
stream.open(file, FileMode.APPEND);
// add a new line to the text file
stream.writeUTFBytes( (new Date()).toString() +"FUNCTION NAME HERE"+ "\n" );

thus, when the application crashes due to an error, the name of the function in which the problem will be in a text file. Then you can hang such labels inside this function, and when you understand where the problem is, you just need to hang the handler of that event (if null can be, then you need to process it correctly)

N
Nikolay, 2015-03-02
@Dinfyru

Start debugging) Start outputting the requested name of the object or the object itself gradually to the console and see where it is lost. If not lost, then try to compare the types of variables

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question