Graal Forums

Graal Forums (https://forums.graalonline.com/forums/index.php)
-   Future Improvements (https://forums.graalonline.com/forums/forumdisplay.php?f=10)
-   -   disable serverside destroy()... (https://forums.graalonline.com/forums/showthread.php?t=87579)

DustyPorViva 08-24-2009 02:15 AM

disable serverside destroy()...
 
Destroy() on the serverside should not work for DBNPCs(excluding putnpc2's), WNPC's, and I guess level NPC's. It's a bit silly to have to put our own prevention methods so people can't put a script in a level and destroy whole weapons. Really, when do you NEED to destroy a WNPC? I mean, I guess client-RC might use that sort of thing, but I'm sure exceptions could be made for that. Either way, I'd like to see some sort of methods worked out that don't involve having scripters make protection for each and every one of their scripts.

cbk1994 08-24-2009 03:02 AM

I agree (client-RC does not use the destroy command anyway).

fowlplay4 08-24-2009 03:46 AM

I tried to destroy a WNPC from another DBNPC/WNPC using:

PHP Code:

// substituting "npc" with the real name.
findnpc("npc").destroy();
findweapon("npc").destroy(); 

And wasn't able to o:

In theory couldn't you just.. (For now i guess)

PHP Code:

public function destroy() {
  return 
false;



DustyPorViva 08-24-2009 03:55 AM

Quote:

Originally Posted by fowlplay4 (Post 1518056)
I tried to destroy a WNPC from another DBNPC/WNPC using:

PHP Code:

// substituting "npc" with the real name.
findnpc("npc").destroy();
findweapon("npc").destroy(); 

And wasn't able to o:

In theory couldn't you just.. (For now i guess)

PHP Code:

public function destroy() {
  return 
false;



On testbed they actually distribute some script that will do a callstack and such and echo on RC if an NPC tries to destroy it(as well as what NPC it was).

Either way, I don't really see a need for such a lose security. As for whether it's possible or not I'm not sure, but it was a huge thing on Testbed so I figured it was.

TESTRETIS 08-24-2009 03:57 AM

Didn't know it was actually possible to do that to DBNPCs. For WNPCs, though I think I might disagree.

DustyPorViva 08-24-2009 05:12 AM

Quote:

Originally Posted by TESTRETIS (Post 1518062)
Didn't know it was actually possible to do that to DBNPCs. For WNPCs, though I think I might disagree.

You want to be able to destroy WNPC's with scripts? Why?

cbk1994 08-24-2009 06:01 AM

Not really wanting to spread code, but you would use

PHP Code:

findWeaponNPC("test").destroy(); 

Quote:

Originally Posted by TESTRETIS (Post 1518062)
Didn't know it was actually possible to do that to DBNPCs.

Absolutely, I accidently destroyed about a dozen DBNPCs on Testbed when attempting to clear out some guy's putnpc2's. There is a server option to disable it, though.

TESTRETIS 08-24-2009 07:22 AM

Quote:

Originally Posted by DustyPorViva (Post 1518069)
You want to be able to destroy WNPC's with scripts? Why?

If I'm not mistaken, you can use this in substitution of removeweapon();
Or so thor claims.

I know, not the most effective or best way, but..

cbk1994 08-24-2009 07:39 AM

Quote:

Originally Posted by TESTRETIS (Post 1518090)
If I'm not mistaken, you can use this in substitution of removeweapon();
Or so thor claims.

I know, not the most effective or best way, but..

You can remove weapons from a player clientside by calling destroy(). Serverside it deletes the weapon.

Riot 08-24-2009 11:51 PM

Quote:

Originally Posted by DustyPorViva (Post 1518022)
Destroy() on the serverside should not work for DBNPCs(excluding putnpc2's), WNPC's, and I guess level NPC's. It's a bit silly to have to put our own prevention methods so people can't put a script in a level and destroy whole weapons. Really, when do you NEED to destroy a WNPC? I mean, I guess client-RC might use that sort of thing, but I'm sure exceptions could be made for that. Either way, I'd like to see some sort of methods worked out that don't involve having scripters make protection for each and every one of their scripts.

I'm pretty sure DBNPCs are protected by default, assuming no one has adjusted server options... At least going off of http://graal.net/index.php/Server_op...PCs_Protection they should be. I'm unable to use destroy() on DBNPCs on Delteria Dev.

I guess I should learn to read though since that was already posted.

At any rate, weapons should be protected as well.


All times are GMT +2. The time now is 05:18 AM.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.