WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

 
 
Thread Tools Rating: Thread Rating: 29 votes, 5.00 average. Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 09-15-2010, 02:14 PM
Gladsomebeast Gladsomebeast is offline
Member
 
Join Date: Mar 2005
Location: Isla Vizta, CA
Posts: 397
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
import vizact
viz.go()

IS_SERVER = True #change me to False for client
SERVER_NAME = 'DEV8.hq.worldviz.com' #for client, set to network name or IP of server 

import viznet
UPDATE = viznet.id('update')
OTHER_EVENT = viznet.id('OTHER_EVENT')

if IS_SERVER:
	viznet.server.start()
	def broadcast():
		viznet.server.send(UPDATE,message='Hello')
	def othersend():
		viznet.server.send(OTHER_EVENT,otherMessage='other event')
	vizact.ontimer(1, broadcast)
	vizact.ontimer(3, othersend)
else:
	viznet.client.connect(SERVER_NAME)
	def onMyEvent(e):
		print 'Received event from server with message:',e.message
	viz.callback(UPDATE, onMyEvent)
	def otherEvent(e):
		print 'Received event from server with message:',e.otherMessage
	viz.callback(OTHER_EVENT, otherEvent)
__________________
Paul Elliott
WorldViz LLC
Reply With Quote
 


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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Client Server Networking Problem pattie Vizard 12 07-04-2013 09:11 AM
Linking problems with Live Character Frank Verberne Vizard 5 06-04-2008 11:42 AM
Floating license server problems jrodman Vizard 2 10-30-2006 10:39 AM
Intersense Server & 3d Max Hodge1620 Vizard 4 10-26-2005 01:39 PM
problem with female animations vmonkey Vizard 1 10-07-2005 10:36 AM


All times are GMT -7. The time now is 01:15 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC