Forum Multiplayer Debug.Assert not allowed

Discussion and help relating to the PlayerIO Multiplayer API.

Debug.Assert not allowed

Postby TomatoGG » August 3rd, 2010, 11:33 pm

Hi, I found out that Debug operations are not allowed in a game server. This is fine since I will only deploy the Release version of the game server where the Debug operations will be compiled out. But is it possible to allow these operations when running under the Development Server? It would seriously help me avoid a lot of debugging time and I hate to put Console.WriteLine 's all over the place and then have to use ugly #if DEBUG constructs to compile them out of the Release version. The following is my current workaround this issue. It works but I still prefer if the message appears in the Debug window while I'm running the game thru debugging.

Code: Select all
internal class MyDebug {
   [Conditional("DEBUG")]
   public static void Assert(bool flag, string text) {
      if (!flag) Console.WriteLine(new Exception(text));
   }
}
TomatoGG
 
Posts: 17
Joined: July 3rd, 2010, 11:15 am

Re: Debug.Assert not allowed

Postby Oliver » August 4th, 2010, 10:36 am

Hey,

We haven't been using the Debug class (the one in System.Diagnostics, right?) for anything, which is why it's been left out of the whitelist.

I'll get a guy to look into adding it to the whitelist if there are no dangers associated with doing so.

Thanks for noticing and telling :)

All the best,
Oliver
User avatar
Oliver
.IO
 
Posts: 1159
Joined: January 12th, 2010, 8:29 am

Re: Debug.Assert not allowed

Postby TomatoGG » August 4th, 2010, 8:23 pm

:shock: What? u guys never used Debug?! Shocking!! :lol:
I would agree if you don't allow it when running live since there is no reason to run the debug version live UNLESS you can perform remote debugging ;) but I think is an important debugging assistance on the development server. Hope it can be passed soon. So far I did not see any other essential classes were forbidden but if there is, I should find it soon enough :D
TomatoGG
 
Posts: 17
Joined: July 3rd, 2010, 11:15 am


Return to Multiplayer