/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpInternalServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p2 outputParameter = new _p2(); Value.append(inputParameter.p0, sender.GetCallback <_p2, ulong>(_c0, ref outputParameter)); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { (_s1 /**/.Pop() ?? new _s1()).Set(sender, Value, AutoCSer.Net.TcpServer.ServerTaskType.Queue, ref inputParameter); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 2: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p5 inputParameter = new _p5(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p6 outputParameter = new _p6(); Value.read(inputParameter.p0, inputParameter.p1, sender.GetCallback <_p6, AutoCSer.DiskBlock.ClientBuffer>(_c2, ref outputParameter)); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; default: return; } }
/// <summary> /// 命令处理 /// </summary> /// <param name="index">命令序号</param> /// <param name="sender">TCP 内部服务套接字数据发送</param> /// <param name="data">命令数据</param> public override void DoCommand(int index, AutoCSer.Net.TcpInternalServer.ServerSocketSender sender, ref SubArray <byte> data) { AutoCSer.Net.TcpServer.ReturnType returnType; switch (index - 128) { case 0: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p1 inputParameter = new _p1(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p2 outputParameter = new _p2(); Value.append(inputParameter.p0, sender.GetCallback <_p2, ulong>(_c0, ref outputParameter)); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 1: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p3 inputParameter = new _p3(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p4 _outputParameter_ = new _p4(); bool Return; Return = Value.verify(sender, inputParameter.p2, inputParameter.p3, inputParameter.p0, ref inputParameter.p1); if (Return) { sender.SetVerifyMethod(); } _outputParameter_.p0 = inputParameter.p1; _outputParameter_.Return = Return; sender.Push(_c1, ref _outputParameter_); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; case 2: returnType = AutoCSer.Net.TcpServer.ReturnType.Unknown; try { _p5 inputParameter = new _p5(); if (sender.DeSerialize(ref data, ref inputParameter)) { _p6 outputParameter = new _p6(); Value.read(inputParameter.p0, inputParameter.p1, sender.GetCallback <_p6, AutoCSer.DiskBlock.ClientBuffer>(_c2, ref outputParameter)); return; } returnType = AutoCSer.Net.TcpServer.ReturnType.ServerDeSerializeError; } catch (Exception error) { returnType = AutoCSer.Net.TcpServer.ReturnType.ServerException; sender.AddLog(error); } sender.Push(returnType); return; default: return; } }