Allow mods to add components
[8:57 AM] notwaf: Is it possible to add components with mods?
[10:06 AM] Big Bad Waffle: in a waaaay
[10:06 AM] Big Bad Waffle: you can define a component in a mod file and attach that to an object
[10:08 AM] Big Bad Waffle: this kind of thing
var cpn = {
type: 'spoonShouter',
update: function() {
this.obj.social.sendMessage('SPOON!');
}
};
cpn.obj = obj;
obj.components.push(pcn);
obj.spoonShouter = cpn;
(edited)
[3:58 PM] notwaf: Wouldn’t that get blocked though
[3:59 PM] notwaf: Like, when a client tries to call the method
[3:59 PM] notwaf: Since it’s not whitelisted in the router file or whatever
[4:00 PM] notwaf: Also, can we get a way to add components like you do it with skins/spells/old classes, etc
[4:00 PM] notwaf: With an event
[10:01 PM] Big Bad Waffle: the client wouldn't be able to call it but I wasn't aware of the fact that that's what you wanted :p
[10:01 PM] Big Bad Waffle: a lot of components never get called by the client
[10:01 PM] Big Bad Waffle: like aggro
March 21, 2018
[6:14 AM] notwaf: so what about the second way
[6:15 AM] notwaf: have a broadcasted event that allows mods to add new components and change access through the router
[6:15 AM] Big Bad Waffle: I'd have to add that, and I haven't yet
[6:15 AM] Big Bad Waffle: is all
[6:15 AM] notwaf: ok :)
[6:15 AM] Big Bad Waffle: mods controling the router is scaaaaary
[6:15 AM] Big Bad Waffle: but unfortunately the only real way
[6:15 AM] notwaf: well, the server maintainer picks all the mods
[6:16 AM] notwaf: so it shouldnt be a problem if they take the time to check mods for malicious stuff
[6:16 AM] Big Bad Waffle: yup, but not everyone would read through the code
[6:16 AM] notwaf: ^
[6:16 AM] Big Bad Waffle: yup, true
Summary: An event should be broadcasted that allows mods to add components and modify the router filters (see #619 (closed) for router filter stuff). Once this is done we can start moving components that aren't part of the core out into mods.
Edited by hazel