Forum C# Serverside code restrictions

Serverside code restrictions

Postby fudo » August 12th, 2010, 10:54 am

Where can I see a complete list of the serverside code restrictions?
fudo
 
Posts: 14
Joined: August 9th, 2010, 3:14 am

Re: Serverside code restrictions

Postby Oliver » August 13th, 2010, 12:39 pm

Hey Fudo,

It's not really that easy to just pull out -- you should be able to use most of the stuff in System.*, System.Collections.*, System.Security.Cryptography.*, System.Collections.Generic.* and the good parts of the of the System.Text.* / System.Drawing.* classes

If you find a class that is not allowed, that you think should be allowed, send us a message and we'll allow it, if it poses no security threat.

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

Re: Serverside code restrictions

Postby fudo » August 13th, 2010, 1:09 pm

I just thought that this is not so good when you suddenly found that something not allowed.
fudo
 
Posts: 14
Joined: August 9th, 2010, 3:14 am

Re: Serverside code restrictions

Postby Benjaminsen » August 13th, 2010, 1:22 pm

fudo wrote:I just thought that this is not so good when you suddenly found that something not allowed.


Everything is disallowed from the start. We use a whitelist not a blacklist. Thus stuff won't just suddenly disappear from the list of allowed libraries.
Benjaminsen
.IO
 
Posts: 1444
Joined: January 12th, 2010, 11:54 am
Location: Denmark

Re: Serverside code restrictions

Postby garysimmons » May 22nd, 2011, 11:48 pm

I think the point that fudo was making is that it is quite hard to plan your code when you don't know until you try it what is and isn't allowed. Knowing what is and isn't allowed has a massive impact on the code design process. It is going to be very maddening to say the least to design your code one way and then find out that because the server side doesn't support those functions, you have wasted your design time and have to go back to the drawing board.

I too am kinda dreading this part of the process without any documentation as to what is and isn't allowed. Whilst I am a seasoned C++ developer I am just getting up to speed with c# and I find myself reading books on the subject but then not knowing whether any of the stuff I am reading will be allowed on the server side.

Is there not some way that you can post up a list of either black listed or white listed components. I'm not talking about a detailed list which would take way to much time for you guys to put together but perhaps a list of things that are frequently asked.

For example, until I read these forums tonight I had no idea c# XML parser wasn't allowed or that LINQ was not on the white list. A list of major features that are not supported would be a great help. For example, if I had not just happened across the XML post on here I could have easily missed it and ventured off designing my game with XML parser in mind.

Please don't misunderstand me guys, its a great product you offer here and I understand the reason for the limitation. It would just really REALLY help out the new guys around here (myself for example) if we had a list of this stuff up front.

cheers
garysimmons
 
Posts: 99
Joined: May 15th, 2011, 12:02 pm

Re: Serverside code restrictions

Postby Oliver » May 24th, 2011, 5:14 pm

Hey Gary,

Thanks for some great feedback. You bring up some very good points.

I'll talk it over with the team, and see if we can think up something clever.

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

Re: Serverside code restrictions

Postby swell » May 25th, 2011, 9:17 am

Any update on this? I am having the same problems Gary is describing. Thanks.
swell
 
Posts: 8
Joined: May 25th, 2011, 9:17 am

Re: Serverside code restrictions

Postby garysimmons » May 26th, 2011, 12:13 pm

Hi Guys,

I have another question. I think I read on here somewhere that static variables / functions / classes etc are not allowed on the server side code. Does this apply to the static keyword across the board or can we still use static to (for example) create operator overloads in our server side math classes.

Thanks
garysimmons
 
Posts: 99
Joined: May 15th, 2011, 12:02 pm

Re: Serverside code restrictions

Postby Oliver » May 27th, 2011, 10:11 am

Hey Gary,

We've never tried tests with operator overloads. Static methods are allowed, only static properties/fields are disallowed, so i *think* operator overloads will work...

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

Re: Serverside code restrictions

Postby garysimmons » May 27th, 2011, 10:20 am

Hi Oliver,

Oh that's good to know. I thought anything static was off the menu so thanks for putting me straight on that.

Have a good day
garysimmons
 
Posts: 99
Joined: May 15th, 2011, 12:02 pm


Return to C#