有谁能帮我向SmartFoxServer2X发送一组位图呢?我知道有一个文档,但我对编程很陌生,我不知道如何解决这个问题。在客户端,我使用JavaScript,并希望将这个数组发送到服务器:
var params = {n1:this.cubes1to20_arr};
this.sfs.addEventListener(SFS2X.SFSEvent.EXTENSION_RESPONSE, this.onExtensionResponse,this);
this.sfs.send(new SFS2X.Requests.System.ExtensionRequest("upload_cubes",params));就像我说的,this.cubes1to20_arr是一个包含20个位图的数组。当我试图将请求发送到服务器时,我会得到错误信息。
> `[INFO] OUTGOING DATA
p: [Object]
p: [Object]
n1: [Array]
19: [Bitmap (name=null)] (Unsupported)
18: [Bitmap (name=null)] (Unsupported)
17: [Bitmap (name=null)] (Unsupported)
16: [Bitmap (name=null)] (Unsupported)
15: [Bitmap (name=null)] (Unsupported)
14: [Bitmap (name=null)] (Unsupported)
13: [Bitmap (name=null)] (Unsupported)
12: [Bitmap (name=null)] (Unsupported)
11: [Bitmap (name=null)] (Unsupported)
10: [Bitmap (name=null)] (Unsupported)
9: [Bitmap (name=null)] (Unsupported)
8: [Bitmap (name=null)] (Unsupported)
7: [Bitmap (name=null)] (Unsupported)
6: [Bitmap (name=null)] (Unsupported)
5: [Bitmap (name=null)] (Unsupported)
4: [Bitmap (name=null)] (Unsupported)
3: [Bitmap (name=null)] (Unsupported)
2: [Bitmap (name=null)] (Unsupported)
1: [Bitmap (name=null)] (Unsupported)
0: [Bitmap (name=null)] (Unsupported)
r: -1 (Num)
c: upload_cubes (Str)
c: 1 (Num)
a: 13 (Num)`因此,我认为我必须创建一个byteArray,而不是将它发送到服务器。你知道我怎么才能意识到这一点吗?
提前谢谢你帮我!
发布于 2013-11-28 15:49:55
你可能不想这样做:)
SFS是用于多人游戏的功能,而不是上传图像。我建议通过一个与SFS相适应的web服务器启动一个上传脚本。通常,您希望保持SFS服务器的同样多的处理能力,而上传大数据包将需要更多的处理。
是否有办法做到这一点,是的,但是使用JavaScript API会使它变得更难(而且更慢)。在C#、Java甚至AS3方面,您会有更多的运气。
https://stackoverflow.com/questions/18874495
复制相似问题