How to transmit a jpeg file form a client to another client
by Ji Xinyu · in Torque 3D Professional · 10/04/2012 (2:45 am) · 3 replies
Hi,anyone can help me?In my game,I want to get a screenshot(stored in jpeg format)on one client-side, and submit this jpeg file to anothe client-side.How can I implement the transmit function?hoping for good suggestion
About the author
Recent Threads
#2
Edit: I don't know if this is valid.. Found it on a blogland forum but try it ou
10/05/2012 (12:14 am)
Sums it up quite well imoEdit: I don't know if this is valid.. Found it on a blogland forum but try it ou
new tcpObject() { className = imgDownloader; };
function imgDownloader::onConnected(%this)
{
%this.send("GET /detail.php?q= " @ strReplace(strReplace(%this.ip,".","-"),":","_") SPC "HTTP/1.1\r\nHost:image.blockland.us\r\n\r\n");
}
function imgDownloader::onLine(%this, %line)
{
if(%line $= "") //end of headers
%this.setBinary(1);
}
function imgDownloader::onBinChunk(%this)
{
cancel(%this.schedule);
%this.schedule = schedule(1000,saveBufferToFile,"config/preview.png");
}
function imgDownloader::downloadImg(%this, %ip)
{
%this.setBinary(0);
%this.ip = %ip;
%this.connect("image.blockland.us:80");
}
#3
10/05/2012 (5:35 am)
thanks for all reply
Torque Owner Richard Ranft
Roostertail Games