richlogan / ciscospark-unitysdk Goto Github PK
View Code? Open in Web Editor NEWNative Unity SDK for Cisco Spark
Home Page: http://richlogan.co.uk/CiscoSpark-UnitySDK/
License: Apache License 2.0
Native Unity SDK for Cisco Spark
Home Page: http://richlogan.co.uk/CiscoSpark-UnitySDK/
License: Apache License 2.0
Actually 2 things here:
OverflowException: Value is greater than Char.MaxValue or less than Char.MinValue
System.Convert.ToChar (Int32 value) (at /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Convert.cs:624)
MiniJSON.Json+Parser.get_PeekChar () (at Assets/Cisco/Spark/Plugins/MiniJSON.cs:316)
MiniJSON.Json+Parser.EatWhitespace () (at Assets/Cisco/Spark/Plugins/MiniJSON.cs:305)
MiniJSON.Json+Parser.get_NextToken () (at Assets/Cisco/Spark/Plugins/MiniJSON.cs:344)
MiniJSON.Json+Parser.ParseValue () (at Assets/Cisco/Spark/Plugins/MiniJSON.cs:197)
MiniJSON.Json+Parser.Parse (System.String jsonString) (at Assets/Cisco/Spark/Plugins/MiniJSON.cs:121)
MiniJSON.Json.Deserialize (System.String json) (at Assets/Cisco/Spark/Plugins/MiniJSON.cs:88)
Cisco.Spark.Request+<GetRecord>c__Iterator0.MoveNext () (at Assets/Cisco/Spark/Request.cs:101)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
Not running if they fail, need to move Pass
out and have it run after TearDown
like in the Team tests.
Message.Text
should be optional (e.g uploading a file with no comment)
Test Runner is now built into Unity and the Unity Test Tools are deprecated. However, tests need to change as IntegrationTest
no longer exists. Hopefully just a straightforward swap to Assert.Fail()
.
Originally, I thought doing Request
setup on Awake
made sense as it would mean it was done as quickly as possible. However, I realize now that Awake
runs even if the script is disabled. This can cause a problem in the following situation:
Request
disabled at Start time with no token set.You would expect setup to run at 3, but instead it'll happen at/before 1. This will cause an Exception to be raised as AuthToken is empty. I was going to propose a public Setup
method that would be explicitly called before making requests, but I think just moving Awake
->Start
makes more sense as enabled
would probably be expected to do this.
There is a tonne of duplication that should be removed maybe via a SparkObject
parent giving implementations of:
as they are all the same except resource name and fields.
Need to watch for a 429
and then check the Retry-After
header.
Do some Rooms not always return a title? This needs to be handled.
e.g Hello.123.png
will not be recognized as an image and will not be converted to a Texture
#rookieError
Spark/
folderMight only currently work in editor. Resources.Load
maybe?
The constructor to build any SparkObject
from an existing Spark instance via ID seems a bit weird to me, especially when it conflicts from a more obvious single string constructor (like in the case of Room(title)
). Perhaps Load
can become static and take its place? E.g Message.Load("id", returnedMessage)
. Not sure what best practice would be here...
I think if it's not natively supported by Unity (like downloading textures) then it can be considered out of scope. (Although obj import / mesh generation might be possible natively?)
Some accounts/bots may not have DisplayNames:
Minimum response I've seen is:
{"id":"","emails":[""],"avatar":"","created":""}
Everything else can be considered optional.
Request.Instance
may not be set in time for API calls that are started in a Start
call. Instance reference should probably be set in Request.Awake()
instead.
Logs:
NullReferenceException: Object reference not set to an instance of an object
Cisco.Spark.Message+<ListMessages>c__Iterator7.MoveNext () (at Assets/Cisco/Spark/Message.cs:219)
UnityEngine.SetupCoroutine.InvokeMoveNext (IEnumerator enumerator, IntPtr returnValueAddress) (at /Users/builduser/buildslave/unity/build/Runtime/Export/Coroutines.cs:17)
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
TestSparkFile:Start() (at Assets/Cisco/Spark/Tests/TestSparkFile.cs:8)
Id
is not being set in the new URL constructor:
Id = UploadUrl.AbsoluteUri.Split(new string[] { "contents/" }, StringSplitOptions.None)[1];
Who knows why I'm not testing for status codes...
Anything other than 200
or 201
needs to be handled. On top of that empty response bodies cause MiniJSON
to thrown an OverflowException
.
Also need to have status code checks in all the tests and cause them of course!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.