mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 02:36:14 +00:00
提交Unity 联机Pro
This commit is contained in:
@@ -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
|
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 692eedd1d08951b4fac2cd4447430cf7
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -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
|
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 68459b55b5787e04186d568f4ec8bbc3
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user