View Single Post
  #2  
Old 12-31-2005, 10:07 AM
ApothiX ApothiX is offline
Okiesmokie
Join Date: May 2004
Posts: 1,447
ApothiX is on a distinguished road
Quote:
Originally Posted by Rick
Functions calls should pass an implicit variable called "sender" or "caller". This can either be an automatic thing (like this/params) or could be an argument. For example:

HTML Code:
public function someFunc()
{
  if (sender.name != "someTrustedNPC")
  {
    return;
  }
  
  // do whatever...
}
This way we can validate NPCs that are allowed to call our functions -- or impose stricter limits on some NPCs that don't match our criteria.
I really like this idea, I have tried to mimic this behavior in the past but it was hard to get it to be secure (as I'd have to actually send the name of the NPC along with the call, which is pointless if the 'hacker' can manually send the name anyway)
__________________


[06:24:19] * Parts: Skyld (i=silent@unaffiliated/skyld) ("Perhaps Okiesmokie did not realise that I like the boys. ")
Reply With Quote