putIntArray problem

Post here your questions about the Unity / .Net / Mono / Windows 8 / Windows Phone 8 API for SFS2X

Moderators: Lapo, Bax

Post Reply
User avatar
Carl Lydon
Posts: 298
Joined: 12 Nov 2007, 16:15
Location: NYC

putIntArray problem

Post by Carl Lydon »

In all the examples for putting an array into an SFSObject it has something like:

Code: Select all

sendObj.putIntArray("posint", Arrays.asList(100000,200000,300000));
As seen above...But what if I have a normal C# Array or List that has 100 items or so, that I want to put into sendObj?
I've been looking all around and can't see an example of sending a pre-exisintg int[] using putIntArray.

I have been able to send a SFSArray using:

Code: Select all

obj.PutSFSArray
But the documentation indicates that SFS is slower than an int[];
I've gotten this to work in As3 but not in C# (Unity)

So, if I have variable

pSychRecording

That is either an Array or preferably a list, how do I convert this line so it will work?

Code: Select all

SFSObject obj = new SFSObject();
obj.PutIntArray("m", pSychRecording);
Thanks!
User avatar
Bax
Site Admin
Posts: 4626
Joined: 29 Mar 2005, 09:50
Location: Italy
Contact:

Re: putIntArray problem

Post by Bax »

Carl, first of all you posted your question as a reply to a different topic under the C++ API section. Please pay attention to what you post and where.

About your request, I don't understand what you are not able to achieve.
The signature of the PutIntArray method is:

Code: Select all

ISFSObject.PutIntArray(String, Int32[])
so you can pass an int[] to the method directly.
Paolo Bax
The SmartFoxServer Team
Post Reply