gZany Pretty funny of an idea! I think the rickroll one is not going to get any catches, but it turns out that not putting remix protection in libraries is a better idea. People will see it much more easily. What I do is hide it in my code(usually obfuscated), so it's much harder to find.
For example, on my Talented CDO People project, I hid a keyValue called "shrekbeats" (named so to make it harder to guess) which would have eval()
called to it (that warning from eval
suddenly got justified...) if the project was not the original. For example, I hacked Miztis's version of it to say I was very big, along with other goofy things... have fun!
Also, this is not exactly a "Security System," just remix protection. You could very well go to //edit, or /edit.html...
And as a suggestion, make a third, optional parameter to your Net function, which would be a function. If precised, it would run when the remix is detected, to add more customization! Here's the code for that (replace the old Net function with this, credit me if you use it):
function Net(id, source, optionalFunc) {
if(optionalFunc){
optionalFunc();
}else{
if (window.getURLPath()[3]=="view") {
throw 'you dont have permission to remix this project';
}
console.log("This project is secured with aluminum network v1.1\nNote: If you're the developer of this game make sure to update the library to latest version: Manage Libraries>Update Aluminum");
if (source=="crash") {
if (window.getURLPath()[2]!=id) {
throw 'you dont have permission to remix this project';
}
} else if ((source=="prompt")) {
if (window.getURLPath()[2]!=id) {
while (true) {
prompt("You don't have permission to remix this project");
}
}
} else if ((source=="rickroll")) {
if (window.getURLPath()[2]!=id) {
prompt("FULL CODE.ORG TUTORIAL ON HOW TO HACK PROJECTS","https://www.youtube.com/watch?v=HIcSWuKMwOw");
throw"You don't have permission to remix this project";
}
} else {
console.log("Aluminum Network Says: In order for this to work please insert the required perameters so that it does not crash your game.");
}
}
}