mirror of
https://gitee.com/jisol/jisol-game/
synced 2025-09-27 10:46:17 +00:00
提交帧同步案例
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
#if !BESTHTTP_DISABLE_SIGNALR && BESTHTTP_SIGNALR_WITH_JSONDOTNET
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
using Newtonsoft.Json;
|
||||
|
||||
namespace BestHTTP.SignalR.JsonEncoders
|
||||
{
|
||||
public sealed class JSonDotnetEncoder : IJsonEncoder
|
||||
{
|
||||
public string Encode(object obj)
|
||||
{
|
||||
return JsonConvert.SerializeObject(obj);
|
||||
}
|
||||
|
||||
public IDictionary<string, object> DecodeMessage(string json)
|
||||
{
|
||||
return JsonConvert.DeserializeObject<Dictionary<string, object>>(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 653a0f163689052438748b7beda14886
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
@@ -0,0 +1,28 @@
|
||||
#if !BESTHTTP_DISABLE_SIGNALR
|
||||
|
||||
using System.Collections.Generic;
|
||||
|
||||
using LitJson;
|
||||
|
||||
namespace BestHTTP.SignalR.JsonEncoders
|
||||
{
|
||||
public sealed class LitJsonEncoder : IJsonEncoder
|
||||
{
|
||||
public string Encode(object obj)
|
||||
{
|
||||
JsonWriter writer = new JsonWriter();
|
||||
JsonMapper.ToJson(obj, writer);
|
||||
|
||||
return writer.ToString();
|
||||
}
|
||||
|
||||
public IDictionary<string, object> DecodeMessage(string json)
|
||||
{
|
||||
JsonReader reader = new JsonReader(json);
|
||||
|
||||
return JsonMapper.ToObject<Dictionary<string, object>>(reader);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
@@ -0,0 +1,10 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 2870a746a601b8b439c495ff39474385
|
||||
MonoImporter:
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
Reference in New Issue
Block a user