using FLY.FeedbackRenZiJia.Common; using FLY.FeedbackRenZiJia.IService; using FLY.FeedbackRenZiJia.OBJ_INTERFACE; using FObjBase; using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace FLY.FeedbackRenZiJia.Server.OBJProxy { public class SnapShotBuf_OBJProxy : FObj { #region markno #endregion ISnapShotBufService data; public SnapShotBuf_OBJProxy(int objsys_idx, UInt32 id, ISnapShotBufService data):base(objsys_idx) { ID = id; this.data = data; } public override void CallFunction(IFConn from, uint srcid, uint magic, ushort funcid, byte[] infodata) { switch (funcid) { case SNAPSHOT_OBJ_INTERFACE.CALL_GET_SNAPSHOT: { string json = Misc.Converter.BytesToString(infodata); var p = Newtonsoft.Json.JsonConvert.DeserializeObject(json); data.Get(p, new AsyncCBHandler(delegate (object AsyncState, object retdata) { ConnContext context = (ConnContext)AsyncState; string json2 = Newtonsoft.Json.JsonConvert.SerializeObject(retdata); CurrObjSys.PushCallFunctionEx( context.from, context.srcid, ID, context.magic, SNAPSHOT_OBJ_INTERFACE.CALL_GET_SNAPSHOT, Misc.Converter.StringToBytes(json2)); }), new ConnContext(from, srcid, magic)); } break; case SNAPSHOT_OBJ_INTERFACE.CALL_SET_SNAPSHOT: { string json = Misc.Converter.BytesToString(infodata); var p = Newtonsoft.Json.JsonConvert.DeserializeObject(json); data.Set(p); } break; case SNAPSHOT_OBJ_INTERFACE.CALL_DEL_SNAPSHOT: { string json = Misc.Converter.BytesToString(infodata); var p = Newtonsoft.Json.JsonConvert.DeserializeObject(json); data.Del(p); } break; case SNAPSHOT_OBJ_INTERFACE.CALL_GET_SNAPSHOT_LIST: { data.GetList( new AsyncCBHandler(delegate (object AsyncState, object retdata) { ConnContext context = (ConnContext)AsyncState; string json2 = Newtonsoft.Json.JsonConvert.SerializeObject(retdata); CurrObjSys.PushCallFunctionEx( context.from, context.srcid, ID, context.magic, SNAPSHOT_OBJ_INTERFACE.CALL_GET_SNAPSHOT_LIST, Misc.Converter.StringToBytes(json2)); }), new ConnContext(from, srcid, magic)); } break; } } } }