These are chat archives for highfidelity/hifi

16th
Jan 2018
Seth Alves
@sethalves
Jan 16 2018 17:03
Seems like it could go either way -- import A-Frame into hifi domains, or have an A-Frame-Server assignment-client
jetbond
@jetbond
Jan 16 2018 21:38
I'm trying to delete entities when the server is stopped from a server script. Is that possible? I think what's happening is that the server is being shut down before the script.ending is happening
Clément Brisset
@Atlante45
Jan 16 2018 21:44
@jetbond unfortunately, it's not possible.
When the ESS (Entity Script Server) goes down, that usually means the whole server is stopping. The Entity Server might be shut down already, or at least in the process of shutting down and not accepting any new packets.
What are you trying to accomplish?
jetbond
@jetbond
Jan 16 2018 21:52
I'm trying to pull a location for a zone from a database, place it into high fidelity when the server starts. Which I have working. Then when the server goes down, I want to delete that zone so that it doesn't create it on top of itself when the server starts back up
Alternatively, can I kill a server script and reload it without the server going down?
Clément Brisset
@Atlante45
Jan 16 2018 21:57
Can you tell me a bit more? Surely there's a way to only create the zone once and not have to delete it and re-create it everytime.
Yes, you can do that.
Clearing the the script from the entity will do that for example.
jetbond
@jetbond
Jan 16 2018 21:59
If I'm looking at nodes from the server settings menu, each agent is a server script instance right?
MiladNazeri
@MiladNazeri
Jan 16 2018 22:03
yeah seems like you should be able to do an if (zone) {} to not have to deal with creating it on top of itself
Clément Brisset
@Atlante45
Jan 16 2018 22:04
No, the agents are stand-alone scripts initially made to be able to mimic avatars (ie. NPCs). All the entity server scripts are running in the Entity Script Server (ESS). You should see it in the list of nodes.
jetbond
@jetbond
Jan 16 2018 22:58
Let me try to explain it better.
Entity A is a zone. Entity B is spawning from an entity server script on entity A. Now to get the modelURL of Entity B, I'm getting it from a database call.
If I update the database, what could be the best way to update Entity B?
Clément Brisset
@Atlante45
Jan 16 2018 23:01
When does Entity B spawns? is there any rules to it, or should it just always be there?
MiladNazeri
@MiladNazeri
Jan 16 2018 23:01
how often would the database be updated?
jetbond
@jetbond
Jan 16 2018 23:02
I wanted to spawn it when the server loads
Clément Brisset
@Atlante45
Jan 16 2018 23:03
But spawning it when the server load is no different than having it there all the time, no?
jetbond
@jetbond
Jan 16 2018 23:03
Okay then is there a way to update is immediately after the database change?
Clément Brisset
@Atlante45
Jan 16 2018 23:04
The way I would do it is, forget the zone, just create Entity B and put the server on Entity B. Then periodically check your DB, if you notice the URL changed, change it on the entity.
jetbond
@jetbond
Jan 16 2018 23:05
But the thing is, the zone has information about what to spawn in the userData
Clément Brisset
@Atlante45
Jan 16 2018 23:05
Not really, others might no better than me. But if you periodically check every 5 sec or so, that would update in less than 5 sec.
But you can tweak that based on what you need.
MiladNazeri
@MiladNazeri
Jan 16 2018 23:05
The only way to do something like that is if you had some kind of socket connection, which I'm not sure you can do directly
jetbond
@jetbond
Jan 16 2018 23:06
okay guys well thanks a lot for the help
Clément Brisset
@Atlante45
Jan 16 2018 23:06
:thumbsup:
@jetbond if you want to meet in world to discuss design, let me know.
jetbond
@jetbond
Jan 16 2018 23:12
Thanks, will do. It's always nice talking to others