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 10-07-2011, 07:27 PM
0PiX0 0PiX0 is offline
Coder
0PiX0's Avatar
Join Date: Jan 2011
Posts: 130
0PiX0 is a jewel in the rough0PiX0 is a jewel in the rough
clientr multidimensional arrays not syncing

Multidimensional array values in clientr are not synced to the clientside when manipulated directly.

In the following example, after the code has run, the client still reads player.clientr.something as {{1, 1}}
PHP Code:
player.clientr.something = {{11}};
player.clientr.something[0][1] = 2// this line's changes are not synced to clientside 
__________________
Reply With Quote
  #2  
Old 10-07-2011, 10:58 PM
cbk1994 cbk1994 is offline
the fake one
cbk1994's Avatar
Join Date: Mar 2003
Location: San Francisco
Posts: 10,718
cbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond reputecbk1994 has a reputation beyond repute
Send a message via AIM to cbk1994
I've replicated this. Looks like it's not being saved in the player's attributes (not shown in "/open account", even after reconnecting).

Testing code:

PHP Code:
function onCreated() {
  
temp.pl findPlayer("YOUR_ACCOUNT");
  
  
temp.pl.clientr.test = {{"one""two"}};
  
temp.pl.clientr.test[0][1] = "three";
  
  echo(
"server: " temp.pl.clientr.test);
  
  
temp.pl.addWeapon(this.name);
  
temp.pl.triggerClient("gui"this.name"check");
}

function 
onActionServerSide(temp.cmdtemp.data) {
  if (
temp.cmd == "returnCheck") {
    echo(
"client: " temp.data);
  }
}

//#CLIENTSIDE
function onActionClientSide(temp.cmd) {
  if (
temp.cmd == "check") {
    
triggerServer("gui"this.name"returnCheck"player.clientr.test);
  }

Output on Ol' West:
PHP Code:
Weapon/GUI-script wtf added/updated by cbk1994
server
"one,three",
client"one,two"
__________________
Reply With Quote
  #3  
Old 10-08-2011, 01:27 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Yes, not sure if it should be supported. When you have complex data then just assign it one time to the client./clientr. variable so that it's not sent ten times to the client.
Reply With Quote
  #4  
Old 10-08-2011, 02:29 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
Quote:
Originally Posted by Stefan View Post
Yes, not sure if it should be supported. When you have complex data then just assign it one time to the client./clientr. variable so that it's not sent ten times to the client.
Does this mean that data is being sent to the client (or multiple clients when it comes to attr[] values) upon every single assignment?
I'd have imagined it would be happening just the one time at the end of the script process to avoid this.
Reply With Quote
  #5  
Old 10-08-2011, 06:33 PM
Admins Admins is offline
Graal Administration
Join Date: Jan 2000
Location: Admins
Posts: 11,693
Admins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud ofAdmins has much to be proud of
Each time you change it yes, to be in sync with triggers and such stuff.
Reply With Quote
  #6  
Old 10-09-2011, 12:03 AM
0PiX0 0PiX0 is offline
Coder
0PiX0's Avatar
Join Date: Jan 2011
Posts: 130
0PiX0 is a jewel in the rough0PiX0 is a jewel in the rough
I was thinking the same as Thor. That's good to know. It would be very helpful if there was an event for when clientr variables get updated.
__________________

Last edited by 0PiX0; 10-09-2011 at 12:14 AM..
Reply With Quote
  #7  
Old 10-25-2011, 07:18 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
Quote:
Originally Posted by Stefan View Post
Each time you change it yes, to be in sync with triggers and such stuff.
Is this also the case with modifying serverr. variables?
Reply With Quote
  #8  
Old 10-25-2011, 07:51 PM
Skyld Skyld is offline
Script-fu
Skyld's Avatar
Join Date: Jan 2002
Location: United Kingdom
Posts: 3,914
Skyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud ofSkyld has much to be proud of
Send a message via AIM to Skyld
Quote:
Originally Posted by ffcmike View Post
Is this also the case with modifying serverr. variables?
Yes.
__________________
Skyld
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 03:57 AM.


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