[MIRROR] I cast identify at 9th level [MDB IGNORE] (#11283)

* Put a comment explaining the client parent_type line (#64629)

I also took the opportunity to sketch out the description of the client
object itself

* I cast identify at 9th level

Co-authored-by: oranges <email@oranges.net.nz>
This commit is contained in:
SkyratBot
2022-02-05 17:31:59 +00:00
committed by GitHub
co-authored by oranges
parent a527728dbf
commit e12cdc7807
+34 -4
View File
@@ -1,8 +1,38 @@
/**
* Client datum
*
* A datum that is created whenever a user joins a BYOND world, one will exist for every active connected
* player
*
* when they first connect, this client object is created and [/client/New] is called
*
* When they disconnect, this client object is deleted and [/client/Del] is called
*
* All client topic calls go through [/client/Topic] first, so a lot of our specialised
* topic handling starts here
*/
/client
//////////////////////
//BLACK MAGIC THINGS//
//////////////////////
/**
* This line makes clients parent type be a datum
*
* By default in byond if you define a proc on datums, that proc will exist on nearly every single type
* from icons to images to atoms to mobs to objs to turfs to areas, it won't however, appear on client
*
* instead by default they act like their own independent type so while you can do istype(icon, /datum)
* and have it return true, you can't do istype(client, /datum), it will always return false.
*
* This makes writing oo code hard, when you have to consider this extra special case
*
* This line prevents that, and has never appeared to cause any ill effects, while saving us an extra
* pain to think about
*
* This line is widely considered black fucking magic, and the fact it works is a puzzle to everyone
* involved, including the current engine developer, lummox
*
* If you are a future developer and the engine source is now available and you can explain why this
* is the way it is, please do update this comment
*/
parent_type = /datum
////////////////
//ADMIN THINGS//