Closed CaptainDestructo closed 3 years ago
But there already is a Client.fetch_world()
method, just pick the name from that object.
I tried doing that and had issues. Needed to get it working quick and dirty. I’ll see if I can replicate the issues I was having
@ShingenPizza where is this method? I don't see it in the vrcpy folder. There's a get_world()
classmethod in Instance, which returns the world object of an Instance, and a fetch_instance_via_id
method in client which requires both a world_id and instance_id. If I don't have an instance_id to search with, I don't see how I can use this method.
Perhaps I should've clarified... I'm using the async rewrite. It's not present there as far as I can tell. I could make this pull request a little more useful by rewriting the fetch_world()
funciton instead of just returning the name.
No, it's my bad, I should have checked the branch
Can you say what's happening? Tell us what you do, what you expect to happen, and what happens so we can fix the original problem instead of implementing a work-around. Since effectively, your fetch_world_name_via_id
is the same as get_world
So the primary issue, since I'm using the async rewrite branch, is that fetch_world()
is nonexistent. While I could use fetch_instance_via_id()
and from there Instance.get_world()
to obtain the world object, this only works with a valid Instance ID. I haven't fully fleshed out my project yet, so I want to be prepared for the situation in which I many not have an instance ID to use.
Currently working on simply rewriting the fetch_world()
command into Client.py which will require only a world ID.
@Katistic I have now updated Client.py to fetch the LimitedWorld object of the world_id when fetch_world()
is called. I couldn't get it to work with a World object however, as for some reason loop
was being passed through World into BaseObject._assign(obj)
as obj. Threw a TypeError for the loop not being iterable of course.
I'm offline for the night, and will be away from my desk until tomorrow evening (around 21 hours from now) but can answer questions from my phone intermittently as long as I don't have to scroll through code.
I'll test and fix the world error then pull it :)
The for some reason it pulls the loop in as obj
. Could be due to World being a class based on LimitedWorld and not BaseObject idk. I’ll be at my desk in an hour or so
What ended up being the issue? Just curious
When passing loop from World to LimitedWorld, no kwarg was specified so it defaulted to obj (See here)
Awesome thanks. I’ll pull the repo tomorrow night
I was having issues trying to use the get_world() function under Instance, so I threw this function in
client.py
tohandle the world name specificallyreplace the synchronousfetch_world()
function. It's yours if you want it.