hiya,
think ive found a bug in 2.41:
heres some script: (nicked from someone)
import socket, string
# referencia na hlavny objekt - reference to main object
contr = GameLogic.getCurrentController()
obj = contr.getOwner()
ip = "127.0.0.1"
# ak nie je pripojeny - if it's connected
if obj.connected == '':
# nazov pocitaca a cislo portu - computer name and port name
host = ip
port = 4950
# vytvorenie socketu pre protokol UDP - socket for UDP
GameLogic.conn = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
# pripojenie klienta - connection to client
GameLogic.conn.bind((host, port))
# nastavenie socketu do neblokovacieho rezimu - nonblocking mode
GameLogic.conn.setblocking(0)
# oznam, ze je server pripraveny - be aware that server is connected
obj.connected = 'c'
the above is used to initialise the connecetion [ run once]
import socket, OSC
import GameLogic
#print dir(OSC)
contr = GameLogic.getCurrentController()
obj = contr.getOwner()
# ak je pripojeny - if it's connected
if obj.connected == 'c':
# prisli data - data is here
rec = 1
# ak prisli data - if data is here
while rec == 1:
try:
data = GameLogic.conn.recvfrom(1024)[0]
if data:
msg = OSC.decodeOSC(data) # decode data
#print msg[2]
except:
rec = 0
print len(msg)
print msg
and that bit is constantly being run to ge the data coming in over OSC.
All works fine in 2.37,2.40 but in 2.41 and 2.41ultimate i get the :
PYTHON SCRIPT ERROR:
Traceback (most recent call last):
File “server.py”, line 30, in ?
NameError: name ‘msg’ is not defined
error.
Im using python 2.42 downloaded today and my pythonpath is set.
Any ideas on this one or anybody had similar netwrok problems with 2.41?
Will