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?