Graal Forums  

Go Back   Graal Forums > Graal V6 forums > Bug Report
FAQ Members List Calendar Today's Posts

Reply
 
Thread Tools Search this Thread Rate Thread Display Modes
  #1  
Old 01-09-2013, 11:46 PM
ffcmike ffcmike is offline
Banned
Join Date: Jul 2004
Location: London
Posts: 2,029
ffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond reputeffcmike has a reputation beyond repute
Send a message via AIM to ffcmike Send a message via MSN to ffcmike
Weird Trigger Behaviour

This is not necessarily a bug, and I also noticed this as a result of a mistake, but imagine quit(); being invoked in the following scenario:

PHP Code:
function onActionServerside(temp.param){
  if(
temp.param == "quit"){
    
temp.obj this.cache.(@ player.account);
    
//really should have - temp.obj.playerlist.remove(player);
    
for(temp.pl temp.obj.playerlist){
      
temp.pl.triggerclient("gui"this.name"takeWeapon");
    }
  }
}

//#CLIENTSIDE
function onActionClientside(temp.param){
  if(
temp.param == "takeWeapon"){
    
this.takeWeapon();
  }
}

function 
quit(){
  
triggerserver("gui"this.name"quit");
  
this.takeWeapon();
}

function 
takeWeapon(){
  
this.doRandomStuff();
  
this.destroy();

So basically, this script is destroying the weapon on your client, after sending a trigger to the server in order to send a trigger to the clients within a list of players, including yourself.

The problem I've noticed is that due to the weapon already being destroyed on your client, the triggerclient from the server is actually being invoked the next time you have the weapon added to you. In this case, it would cause the weapon to destroy itself upon being added to you a 2nd time.
Reply With Quote
  #2  
Old 01-15-2013, 02:35 PM
mewtoo18 mewtoo18 is offline
Registered User
Join Date: Sep 2003
Location: Southbend IN
Posts: 41
mewtoo18 is on a distinguished road
Quote:
Originally Posted by ffcmike View Post
This is not necessarily a bug, and I also noticed this as a result of a mistake, but imagine quit(); being invoked in the following scenario:

PHP Code:
function onActionServerside(temp.param){
  if(
temp.param == "quit"){
    
temp.obj this.cache.(@ player.account);
    
//really should have - temp.obj.playerlist.remove(player);
    
for(temp.pl temp.obj.playerlist){
      
temp.pl.triggerclient("gui"this.name"takeWeapon");
    }
  }
}

//#CLIENTSIDE
function onActionClientside(temp.param){
  if(
temp.param == "takeWeapon"){
    
this.takeWeapon();
  }
}

function 
quit(){
  
triggerserver("gui"this.name"quit");
  
this.takeWeapon();
}

function 
takeWeapon(){
  
this.doRandomStuff();
  
this.destroy();

So basically, this script is destroying the weapon on your client, after sending a trigger to the server in order to send a trigger to the clients within a list of players, including yourself.

The problem I've noticed is that due to the weapon already being destroyed on your client, the triggerclient from the server is actually being invoked the next time you have the weapon added to you. In this case, it would cause the weapon to destroy itself upon being added to you a 2nd time.
Does it still do that if you remove the weapon rather then destroy it?
Reply With Quote
Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


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


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