Problem with server Events
We're having a problem creating a simple server/client model where users log in and they can move around in the same world. We used the duck default model as avatars. I can paste the code in but lets see if i'm missing something obvious
The problem is with the events. Both server and client have the code SEND = viznet.id('send') and I then I do something in the client like viznet.callback(SEND, update) and this calls a function that updates the location of all the ducks. The code doesn't work because I never get something sent using the event id SEND for any of the clients. BUT, if I replace SEND with viz.NETWORK_EVENT, everything works as expected. But this is obviously problematic because it triggers on every event, and not all of the events are updates. I tried printing out the value of UPDATE and its some crazy negative number, however it is the same number on both the server and client. The relevant client code: Code:
ducks = {} Code:
viznet.server.start(port_in=14950, port_out=14951) |
Not sure whats going on in your code. Must be some bug somewhere that I'm not getting.
This example I worked up does what you want to do (I think): Code:
import viz |
Looked at your code a little more...
I'm not seeing any call to viznet.client.send(SEND) or viznet.server.send(SEND) in your code. Thus the viznet.callback(SEND, update) won't get used. In your client code, change to viznet.callback(UPDATE, update) to receive the viznet.client.sendAll(UPDATE) calls the clients make. |
All times are GMT -7. The time now is 02:00 PM. |
Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC