This commit is contained in:
2020-07-09 08:50:24 +08:00
parent 13d25f4707
commit c523462b82
1818 changed files with 174940 additions and 582 deletions

View File

@@ -0,0 +1,25 @@
#if !BESTHTTP_DISABLE_SOCKETIO
using System.Collections.Generic;
using BestHTTP.JSON;
namespace BestHTTP.SocketIO.JsonEncoders
{
/// <summary>
/// The default IJsonEncoder implementation. It's uses the Json class from the BestHTTP.JSON namespace to encode and decode.
/// </summary>
public sealed class DefaultJSonEncoder : IJsonEncoder
{
public List<object> Decode(string json)
{
return Json.Decode(json) as List<object>;
}
public string Encode(List<object> obj)
{
return Json.Encode(obj);
}
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: eab45a006264449979dbfb9f504c1774
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,24 @@
#if !BESTHTTP_DISABLE_SOCKETIO
using System.Collections.Generic;
namespace BestHTTP.SocketIO.JsonEncoders
{
/// <summary>
/// Interface to be able to write custom Json encoders/decoders.
/// </summary>
public interface IJsonEncoder
{
/// <summary>
/// The Decode function must create a list of objects from the Json formatted string parameter. If the decoding fails, it should return null.
/// </summary>
List<object> Decode(string json);
/// <summary>
/// The Encode function must create a json formatted string from the parameter. If the encoding fails, it should return null.
/// </summary>
string Encode(List<object> obj);
}
}
#endif

View File

@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: df0af13937a45496698838e13069cc5b
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: