These are chat archives for highfidelity/hifi

12th
Apr 2017
Corey Evans
@whyroc
Apr 12 2017 20:57
I'm working on a personal project, to connect the Tablet App to a REST API service (via worpdress) so I can manage my assets (avatars, attachments, entities) linked from s3. Resulting is the ability to easily rez stuff in from the tablet app on HMD. anyone interested in this kind of thing?
Melissa Brown
@themelissabrown
Apr 12 2017 21:18
@whyroc following up via email and introducing you to another team member
Don Hopkins
@SimHacker
Apr 12 2017 22:21
Hi, @hyperlogic! The bug you fixed sounds exactly like the problem I encountered. I'm running Interface build 6291 on the Mac. When will the fix show up in a build I can download, or should I make my own build?
Now that I know the problem I'll take out my experiment at working around it. Should I be connecting and disconnecting the web handler on OnScreenChanged, when it goes to and from the URL of my page?
Clément Brisset
@Atlante45
Apr 12 2017 22:27
@SimHacker That PR was merged 8 days ago, so I doubt it's part of the current RC that will release soon*.
You can download the current dev build though, it will have that fix.
Don Hopkins
@SimHacker
Apr 12 2017 22:29
Thanks, I'll grab that!
The voting box is composed of three files, an interface script and two entity scripts. I've put them on my public server and written absolute urls into the interface script for testing. Where should I put them into the source tree and how should the interface script refer to the entity scripts, for integrating it into the build? Can I just use relative URLs if they're all in the same directory?
The interface script is making a box and a text entity and setting their script property, so I suspect it needs a non-relative url since it has no way of knowing the url base of the script that created it.
Rob Kayson
@MrRoboman
Apr 12 2017 22:38
Would anyone happen to know why an entity might look absolutely perfect and amazingly immaculate to the person equipping it and like total garbage to everyone else?
Don Hopkins
@SimHacker
Apr 12 2017 22:38
Perhaps they have bad taste in entities? ;)
Rob Kayson
@MrRoboman
Apr 12 2017 22:40
hah. could be.
More specifically. I have a stick and a ball that are connected by an offset action. The tethering looks fine to the user holding it because they are always updating the action point. But other avatars are not updating the action point. but if I try to update the action point in an update called by all clients the animation performance suffers
I was told Andrew Meadows was the man to see about physics. Is there an Andrew Meadows in the house??
Clément Brisset
@Atlante45
Apr 12 2017 22:45
@SimHacker You can use Script.resolvePath("./my/relative/path.js") to find scripts next to you.
But entities cannot easily point to local script, so we should see about hosting that on S3 or the marketplace.
There is. @AndrewMeadows you around?
@sethalves would know about that too.
Don Hopkins
@SimHacker
Apr 12 2017 22:59
What should I do for the purposes for QA / code review / merging the job? Should I integrate it into the provided git branch, or is it fine to leave it up on my public server for now?
Melissa Brown
@themelissabrown
Apr 12 2017 23:18
@SimHacker I think I answered that on a different channel: integrate into the branch provided and submit a PR. That's the fastest way to get it code reviewed and QA'd
_
Clément Brisset
@Atlante45
Apr 12 2017 23:18
If the scripts themselves need to be reviewed, then yes, push them to your branch.
You can probably find a spot in unpublishedScripts
Don Hopkins
@SimHacker
Apr 12 2017 23:21
Okay!
Melissa Brown
@themelissabrown
Apr 12 2017 23:25
from @SimHacker
There's a problem with how it handles the person who created the boxes logging out, or reloading the script, because it has ephemeral state (a dict mapping voting box ids to a dict with info about that box, including the ids of the entities and a list of users who have voted). That's a result of the design that the client script is in charge of tallying the votes: "The client script will listen for these messages, and as it receives them, it will tally up the votes."
It doesn't specify that the array should be saved anywhere, so when the user reloads the script or logs out, that information is lost, and the voting boxes stop working.
Don Hopkins
@SimHacker
Apr 12 2017 23:27
I explored some approaches to solving that problem in the FancyVotingBox, but I didn't come up with a perfect solution. I think it needs to run the vote-tallying script on a server script that is always alive and never goes away.
Clément Brisset
@Atlante45
Apr 12 2017 23:27
I'm not sure what the question is?
Are you just trying to find a ~better~ way to save that data?
Don Hopkins
@SimHacker
Apr 12 2017 23:28
It's an architectural question, about where best to store the state, and which script should tally the votes.
The spec says the votes should be tallied in the client script of the person who created them. And it doesn't specify that that state should be saved anywhere. So the effects is that voting breaks when the user logs out or reloads the script.
Clément Brisset
@Atlante45
Apr 12 2017 23:29
Yes, I think that's an acceptable behavior.
Don Hopkins
@SimHacker
Apr 12 2017 23:29
I can think of several approaches to making it work correctly even after the interface script that creates voting boxes is reloaded, and the user who created them logs out. But not sure what's the best way.
Melissa Brown
@themelissabrown
Apr 12 2017 23:29
We probably don't want that for the talent show, but I think it's specified that way by design for a user to create their own polls
I agree with Clement that it's acceptable to leave as the spec describes currently
Don Hopkins
@SimHacker
Apr 12 2017 23:30
I didn't want to disregard the design in the job spec, but I think the interface script should only be responsible for creating the objects, and then a server script attached to each object can tally the votes, and save them in the userdata of the object.
Clément Brisset
@Atlante45
Apr 12 2017 23:30
If we want to make that data persistent on the client side. One easy way to do it would be to save that data to the application settings.
Don Hopkins
@SimHacker
Apr 12 2017 23:31
Of course some criminal could come along and edit the vote count in the user data and we might end up in the same mess the USA is now in. ;(
One problem is that the vote boxes won't work unless the user who created them is logged in.
Somebody's got to be listening on that VotingBox channel at all times.
Melissa Brown
@themelissabrown
Apr 12 2017 23:32
again, I think that's by design
I don't think this is meant to be a domain-wide voting box but something a user can spawn and collect data from at will
Don Hopkins
@SimHacker
Apr 12 2017 23:33
Ok, that's cool! The design said "This should allow one person to securely collect votes from other nearby avatars." so I was worried that storing the votes in the userdata might not be "secure", and is easy to hack.
Melissa Brown
@themelissabrown
Apr 12 2017 23:33
yeah, to be fair, "secure" is a tough one
we can also ask Philip if he has input here
Clément Brisset
@Atlante45
Apr 12 2017 23:34
I think the design should be something like that.
When the script starts, spawn the boxes, start listening.
Tally the votes.
When the script shuts down, cleanup the boxes.
Don Hopkins
@SimHacker
Apr 12 2017 23:34
So I think the voting boxes should also remember the id of the user who created them, so they can include that in the message they send about voting, so voting boxes created by different people don't stomp on each other!
Ok, I made it clean up the boxes when the script shuts down. But that doesn't seem to get called when the user logs out, though.
How "secure" is storing stuff in userdata -- can't anyone come along and edit that?
Clément Brisset
@Atlante45
Apr 12 2017 23:35
Hmmm, you're calling it in Script.scriptEnding.connect(...)?
@SimHacker I didn't mean storing it in the user data.
I meant storing it in the actual application settings, stored locally on your drive.
userData is not secured at all.
Don Hopkins
@SimHacker
Apr 12 2017 23:36
Aha didn't know about that. I was calling deleteAllVotingBoxes() in onTabletButtonDestroyed, but I can also listen for scriptEnding and clean up then too!
Clément Brisset
@Atlante45
Apr 12 2017 23:37
Ok, one issue might be, if you switch domain, that might get called on the wrong domain and that won't actually delete the boxes.
Don Hopkins
@SimHacker
Apr 12 2017 23:38
Yes the security aspect is tricky. I need to store the id of the person who created the object somewhere, most obviously userdata, but that could be edited by somebody to hijack the vote. Of course they could also just directly edit the text field to say 1000 votes, so there is that! ;)
Do all object already automatically remember the id of the user who created them? That would be convenient.
Clément Brisset
@Atlante45
Apr 12 2017 23:38
One thing I've done in the past to manage those kinds of entities, is to set a lifetime. Something like 3s. and keep updating it every 2s or so.
That way if you quit/leave/crash, you won't be updating the entity's lifetime anymore and it will die.
@SimHacker Can we meet in world and talk about that virtual face to virtual face?
I feel like it will be more easy to discuss all of this.
Don Hopkins
@SimHacker
Apr 12 2017 23:40
Sure! Let me refresh my coffee first!
Clément Brisset
@Atlante45
Apr 12 2017 23:41
:thumbsup:
Clément Brisset
@Atlante45
Apr 12 2017 23:51
@SimHacker I'm here hifi://welcome/-81.6376,0.167952,-281.408/0,0.261516,0,0.965199
Don Hopkins
@SimHacker
Apr 12 2017 23:52
Ok I'm in dev-welcome! Ok I'll paste thaturl and see u!
I have installed developer build 6323, and I get a "protocol version mismatch" -- should I downgrade to the released version?
Going back to build 6291...
Clément Brisset
@Atlante45
Apr 12 2017 23:55
Yeah sorry, my windows machine is incapacitated and the latest dev build doesn't run on mac for some reason.
Can you hear me?