/devadd -- :3

/devadd -- :3

Postby _Retaliate_ » 18 Feb 2014, 12:14

Adds the player specified to the developer list for your server :3 Have fun tricking people.
Spoiler:
Image
_Retaliate_
 
Posts: 68
Joined: 26 Sep 2013, 11:16

Re: /devadd -- :3

Postby Conor » 19 Feb 2014, 17:53

I'm pretty sure the 'devs' List is readonly and cannot be modified, sorry!
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: /devadd -- :3

Postby joppiesaus » 19 Feb 2014, 18:22

Conor wrote:I'm pretty sure the 'devs' List is readonly and cannot be modified, sorry!

hehehehhehehehhehehe
Look at the code!
joppiesaus
 
Posts: 379
Joined: 20 Aug 2012, 07:28
Location: in a obsedian house, with glass in it so i can see the lava!

Re: /devadd -- :3

Postby Conor » 20 Feb 2014, 13:32

joppiesaus wrote:
Conor wrote:I'm pretty sure the 'devs' List is readonly and cannot be modified, sorry!

hehehehhehehehhehehe
Look at the code!


Whut? Is it not readonly?
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: /devadd -- :3

Postby dzienny » 21 Feb 2014, 12:47

Conor wrote:Whut? Is it not readonly?


It doesn't have the read-only modifier. Even if it did, it wouldn't change much. The command would still work.

Moreover, Microsoft's Field Design Guidelines discourage the use of the read-only modifier with mutable types.
DO NOT assign instances of mutable types to readonly fields.
A mutable type is a type with instances that can be modified after they are instantiated. For example, arrays, most collections, and streams are mutable types, but System.Int32, System.Uri, and System.String are all immutable. The read-only modifier on a reference type field prevents the instance stored in the field from being replaced, but it does not prevent the field’s instance data from being modified by calling members changing the instance.


It could be made readonly, if it used both the modifier and an immutable list. .Net Framework doesn't include immutable collections in the core class library, yet. However, quite recently a .NET engineering team released a stable library that contains a set of immutable collections.

I don't plan to change it though.
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27

Re: /devadd -- :3

Postby Conor » 21 Feb 2014, 17:15

dzienny wrote:
Conor wrote:Whut? Is it not readonly?


It doesn't have the read-only modifier. Even if it did, it wouldn't change much. The command would still work.

Moreover, Microsoft's Field Design Guidelines discourage the use of the read-only modifier with mutable types.
DO NOT assign instances of mutable types to readonly fields.
A mutable type is a type with instances that can be modified after they are instantiated. For example, arrays, most collections, and streams are mutable types, but System.Int32, System.Uri, and System.String are all immutable. The read-only modifier on a reference type field prevents the instance stored in the field from being replaced, but it does not prevent the field’s instance data from being modified by calling members changing the instance.


It could be made readonly, if it used both the modifier and an immutable list. .Net Framework doesn't include immutable collections in the core class library, yet. However, quite recently a .NET engineering team released a stable library that contains a set of immutable collections.

I don't plan to change it though.


Oh, my bad. I see the mistake I was assuming now. A List will act differently to say an immutable variable because the methods can modify the contents, rather than replacing them, like your quote points out. So that renders the readonly modifier pretty useless? The immutable collection sounds interesting, does it not appeal to you? Most developers would hate this accessibility haha, but I suppose you're not the type of person to add loads of secret developer backdoors so you have nothing to worry about :lol:
Conor (Conanza121)
User avatar
Conor
Coder
 
Posts: 390
Joined: 10 Oct 2012, 21:36
Location: @21Conor

Re: /devadd -- :3

Postby dzienny » 26 Feb 2014, 12:10

Conor wrote:Oh, my bad. I see the mistake I was assuming now. A List will act differently to say an immutable variable because the methods can modify the contents, rather than replacing them, like your quote points out. So that renders the readonly modifier pretty useless? The immutable collection sounds interesting, does it not appeal to you? Most developers would hate this accessibility haha, but I suppose you're not the type of person to add loads of secret developer backdoors so you have nothing to worry about :lol:


Well, some people modify their servers, write and add their custom commands, in a way they are developing the server they host. Hence, I don't mind, if they give themselves a dev title. As long as it's not related to any incorrect behaviour.

As a developer I don't get any special powers; the only hard-coded thing is the dev title. And it's MCLawl heritage. I probably wouldn't add it myself. It doesn't give any commands permissions. These are equal to a guest rank. I'm happy with that.
User avatar
dzienny
Administrator
 
Posts: 1181
Joined: 23 Jan 2011, 14:27


Return to Custom Commands

Who is online

Users browsing this forum: No registered users and 5 guests

cron