simple list question

blender 2.49b python 2.6.2
#------------Setup--------------#
from GameLogic import *
from socket import *
from cPickle import *
cont = GameLogic.getCurrentController()
obj = cont.owner

if obj[“OneTime”] == 0:
ServerIP = GameLogic.IP
Serverport = 10000
Clientname = ‘’
ClientPort = 10001
GameLogic.sClient = socket(AF_INET,SOCK_DGRAM)
GameLogic.sClient.bind((Clientname,ClientPort))
GameLogic.host = (ServerIP,Serverport)
GameLogic.sClient.setblocking(0)
obj[“OneTime”] = 1

scene = getCurrentScene()
Server = scene.objects[“OBServer”]
list = [obj.worldPosition,obj[“fire”]]
PosServer = [0,0,0]
#------------RECEIVE/SEND--------------#
Data = dumps(list)
GameLogic.sClient.sendto(Data,GameLogic.host)

try:
Data, SRIP = GameLogic.sClient.recvfrom(1024)
UPData = loads(Data)
PosServer = [UPData[0],UPData[1],UPData[2]]
Server.setPosition(PosServer)
except:
pass
#---------------THE-END----------------#
note:PosYou = obj.worldPosition

there problem is when i do a list in the “data = dumps(list)”
its dont work i dont see the position,or the propety
but when i put in the data like that: “data = dumps(PosYou)”
its works why it happend?

it seems that dumps() only takes 1 variable, but when you pass it a list you are passing it a list of two variables, maybe loop over the list (i havent tested this…i don’t know what format Data is expected to be)


Data = []
for item in list:
   Data.append(dumps(item))