/// <summary> /// 服务端反序列化 /// </summary> /// <param name="jsonDeSerializer"></param> /// <param name="value"></param> internal static void DeSerialize(AutoCSer.JsonDeSerializer jsonDeSerializer, ref Node value) { if (*jsonDeSerializer.Current++ == '[') { int serverNodeId = 0; jsonDeSerializer.CallSerialize(ref serverNodeId); if (jsonDeSerializer.State == Json.DeSerializeState.Success) { (value = createNodes.Array[serverNodeId]()).deSerialize(jsonDeSerializer); } return; } jsonDeSerializer.DeSerializeState = Json.DeSerializeState.Custom; }
private unsafe static void deSerialize(AutoCSer.JsonDeSerializer jsonDeSerializer, ref ReturnValue value) { if (*jsonDeSerializer.Current++ == '[') { if (*jsonDeSerializer.Current == ']') { ++jsonDeSerializer.Current; return; } int clientNodeId = 0; jsonDeSerializer.CallSerialize(ref clientNodeId); if (jsonDeSerializer.State == Json.DeSerializeState.Success) { value = createReturnValues.Array[clientNodeId](); value.deSerialize(jsonDeSerializer); } return; } jsonDeSerializer.DeSerializeState = Json.DeSerializeState.Custom; }
private unsafe void deSerialize(AutoCSer.JsonDeSerializer jsonDeSerializer) { if (*jsonDeSerializer.Current++ == '[') { jsonDeSerializer.CallSerialize(ref ClientNodeId); if (jsonDeSerializer.State == Json.DeSerializeState.Success) { if (*jsonDeSerializer.Current++ == ',') { Node.DeSerialize(jsonDeSerializer, ref Node); if (jsonDeSerializer.State != Json.DeSerializeState.Success || *jsonDeSerializer.Current++ == ']') { return; } } } else { return; } } jsonDeSerializer.DeSerializeState = Json.DeSerializeState.Custom; }