diff --git a/.vs/HaoYueTunnel/DesignTimeBuild/.dtbcache.v2 b/.vs/HaoYueTunnel/DesignTimeBuild/.dtbcache.v2 index 860c722..9508649 100644 Binary files a/.vs/HaoYueTunnel/DesignTimeBuild/.dtbcache.v2 and b/.vs/HaoYueTunnel/DesignTimeBuild/.dtbcache.v2 differ diff --git a/.vs/HaoYueTunnel/FileContentIndex/5c8ee9ee-fd75-4199-a53b-c27b94bd01f2.vsidx b/.vs/HaoYueTunnel/FileContentIndex/5c8ee9ee-fd75-4199-a53b-c27b94bd01f2.vsidx deleted file mode 100644 index 208e417..0000000 Binary files a/.vs/HaoYueTunnel/FileContentIndex/5c8ee9ee-fd75-4199-a53b-c27b94bd01f2.vsidx and /dev/null differ diff --git a/.vs/HaoYueTunnel/FileContentIndex/65ec47c7-37cf-4450-91f8-b07058d860d3.vsidx b/.vs/HaoYueTunnel/FileContentIndex/65ec47c7-37cf-4450-91f8-b07058d860d3.vsidx new file mode 100644 index 0000000..e72a09c Binary files /dev/null and b/.vs/HaoYueTunnel/FileContentIndex/65ec47c7-37cf-4450-91f8-b07058d860d3.vsidx differ diff --git a/.vs/HaoYueTunnel/FileContentIndex/882ae609-ee52-4e8e-aa4a-d7915e03b145.vsidx b/.vs/HaoYueTunnel/FileContentIndex/882ae609-ee52-4e8e-aa4a-d7915e03b145.vsidx new file mode 100644 index 0000000..78f2c41 Binary files /dev/null and b/.vs/HaoYueTunnel/FileContentIndex/882ae609-ee52-4e8e-aa4a-d7915e03b145.vsidx differ diff --git a/.vs/HaoYueTunnel/FileContentIndex/ac14b4d3-f546-4e14-add3-4ee1ecf4770e.vsidx b/.vs/HaoYueTunnel/FileContentIndex/ac14b4d3-f546-4e14-add3-4ee1ecf4770e.vsidx deleted file mode 100644 index 5191468..0000000 Binary files a/.vs/HaoYueTunnel/FileContentIndex/ac14b4d3-f546-4e14-add3-4ee1ecf4770e.vsidx and /dev/null differ diff --git a/.vs/HaoYueTunnel/FileContentIndex/b3657071-2613-449a-9f07-3cdb50c11e6f.vsidx b/.vs/HaoYueTunnel/FileContentIndex/b3657071-2613-449a-9f07-3cdb50c11e6f.vsidx new file mode 100644 index 0000000..3a6aa69 Binary files /dev/null and b/.vs/HaoYueTunnel/FileContentIndex/b3657071-2613-449a-9f07-3cdb50c11e6f.vsidx differ diff --git a/.vs/HaoYueTunnel/FileContentIndex/bf9742b8-d643-4adc-9e68-f7ae8a1cc45a.vsidx b/.vs/HaoYueTunnel/FileContentIndex/bf9742b8-d643-4adc-9e68-f7ae8a1cc45a.vsidx deleted file mode 100644 index d54a552..0000000 Binary files a/.vs/HaoYueTunnel/FileContentIndex/bf9742b8-d643-4adc-9e68-f7ae8a1cc45a.vsidx and /dev/null differ diff --git a/.vs/HaoYueTunnel/FileContentIndex/c9262c5b-afb4-4c4e-8123-c6f93e013062.vsidx b/.vs/HaoYueTunnel/FileContentIndex/c9262c5b-afb4-4c4e-8123-c6f93e013062.vsidx deleted file mode 100644 index 0de621b..0000000 Binary files a/.vs/HaoYueTunnel/FileContentIndex/c9262c5b-afb4-4c4e-8123-c6f93e013062.vsidx and /dev/null differ diff --git a/.vs/HaoYueTunnel/FileContentIndex/fcec81be-7b5b-483a-bab4-d7a798496caa.vsidx b/.vs/HaoYueTunnel/FileContentIndex/fcec81be-7b5b-483a-bab4-d7a798496caa.vsidx new file mode 100644 index 0000000..8646054 Binary files /dev/null and b/.vs/HaoYueTunnel/FileContentIndex/fcec81be-7b5b-483a-bab4-d7a798496caa.vsidx differ diff --git a/.vs/HaoYueTunnel/v17/.futdcache.v2 b/.vs/HaoYueTunnel/v17/.futdcache.v2 index 2653e04..dea81b6 100644 Binary files a/.vs/HaoYueTunnel/v17/.futdcache.v2 and b/.vs/HaoYueTunnel/v17/.futdcache.v2 differ diff --git a/.vs/HaoYueTunnel/v17/.suo b/.vs/HaoYueTunnel/v17/.suo index 7bc6128..dacf6e9 100644 Binary files a/.vs/HaoYueTunnel/v17/.suo and b/.vs/HaoYueTunnel/v17/.suo differ diff --git a/.vs/ProjectEvaluation/haoyuetunnel.metadata.v5.2 b/.vs/ProjectEvaluation/haoyuetunnel.metadata.v5.2 index 7ed727c..cd840fa 100644 Binary files a/.vs/ProjectEvaluation/haoyuetunnel.metadata.v5.2 and b/.vs/ProjectEvaluation/haoyuetunnel.metadata.v5.2 differ diff --git a/.vs/ProjectEvaluation/haoyuetunnel.projects.v5.2 b/.vs/ProjectEvaluation/haoyuetunnel.projects.v5.2 index a44d8df..47f64ea 100644 Binary files a/.vs/ProjectEvaluation/haoyuetunnel.projects.v5.2 and b/.vs/ProjectEvaluation/haoyuetunnel.projects.v5.2 differ diff --git a/Client-Cli/Program.cs b/Client-Cli/Program.cs index 7152f25..fbb1e2d 100644 --- a/Client-Cli/Program.cs +++ b/Client-Cli/Program.cs @@ -66,6 +66,15 @@ while (true) } App.p2pChat.SendChatMsg(Convert.ToInt64(CmdArr[1]), CmdArr[2]); break; + case "tufile": + case "tuf": + if (CmdArr.Length < 3) + { + Console.WriteLine("缺省参数"); + return; + } + App.p2pFile.sender_FilePushConfirmToTarget(Convert.ToInt64(CmdArr[1]), CmdArr[2]); + break; case "ulist": { UserInfo[] ulist = App.userMgr.GetUserInfo(); diff --git a/ClientCore/App.cs b/ClientCore/App.cs index 7a960c1..b4c3c28 100644 --- a/ClientCore/App.cs +++ b/ClientCore/App.cs @@ -1,5 +1,6 @@ using System; using System.Collections.Generic; +using System.IO.Compression; using System.Linq; using System.Text; using System.Threading.Tasks; @@ -18,6 +19,7 @@ namespace ClientCore public static ClientManager clientMgr; public static P2PTcp p2ptcp; public static P2PChat p2pChat; + public static P2PFile p2pFile; public static NetworkHelper networkMain; public static NetworkHelper networkTcp2S; public static AppLogin login; @@ -34,6 +36,7 @@ namespace ClientCore clientMgr.SetIpData(IP, port, tcptunnelport); p2ptcp = new P2PTcp(); p2pChat = new P2PChat(); + p2pFile = new P2PFile(); networkMain = new NetworkHelper(Enum.ServerType.MainServer); networkMain.Init(IP, port); //networkTcp2S = new NetworkHelper(Enum.ServerType.TcpTunnelServer); diff --git a/ClientCore/Event/EEvent.cs b/ClientCore/Event/EEvent.cs index 9da1510..f12e3aa 100644 --- a/ClientCore/Event/EEvent.cs +++ b/ClientCore/Event/EEvent.cs @@ -21,5 +21,7 @@ namespace ClientCore.Event //连接管理 OnSocketConnect, OnSocketDisconnect, + + //文件传输 } } diff --git a/ClientCore/Manager/ClientManager.cs b/ClientCore/Manager/ClientManager.cs index 90c3198..4cf0d02 100644 --- a/ClientCore/Manager/ClientManager.cs +++ b/ClientCore/Manager/ClientManager.cs @@ -3,8 +3,10 @@ using ClientCore.Common; using ClientCore.Enum; using ClientCore.Event; using ClientCore.Network; +using HaoYueNet.ClientNetwork; using System.Net.Sockets; using System.Timers; +using static System.Runtime.CompilerServices.RuntimeHelpers; namespace ClientCore.Manager { @@ -16,7 +18,7 @@ namespace ClientCore.Manager int tcptunnelport; int LastlocalPort = 0; - Dictionary DictUID2TcpTaret = new Dictionary(); + Dictionary DictUID2TcpTaret = new Dictionary(); public ClientManager() { @@ -130,7 +132,7 @@ namespace ClientCore.Manager #region P2PTarget 管理 - void AddTargetSocket(NetworkHelper targetSocket) + void AddTargetSocket(NetworkP2PHelper targetSocket) { DictUID2TcpTaret[targetSocket.mUID] = targetSocket; } @@ -143,7 +145,7 @@ namespace ClientCore.Manager } } - NetworkHelper GetTargetSocket(long UID) + NetworkP2PHelper GetTargetSocket(long UID) { if (DictUID2TcpTaret.ContainsKey(UID)) { @@ -151,19 +153,19 @@ namespace ClientCore.Manager } return null; } - + /// /// 发送给指定UID消息 /// /// /// /// - public void SendToTargetSocket(long UID,int CMDID,byte[] data) + public void SendToTargetSocket(long UID, int CMDID, int ERRCODE, byte[] data) { - NetworkHelper target = GetTargetSocket(UID); + NetworkP2PHelper target = GetTargetSocket(UID); if (target == null) return; - target.SendToServer((int)CMDID, data); + target.SendToSocket((int)CMDID, ERRCODE, data); } #endregion @@ -184,7 +186,7 @@ namespace ClientCore.Manager int userBindPort = LastlocalPort; Protobuf_TcpTunnel_DoTunnel_RESP msg = (Protobuf_TcpTunnel_DoTunnel_RESP)obj; Console.WriteLine("LocalEndPoint Port:" + userBindPort); - NetworkHelper targetSocket = new NetworkHelper(Enum.ServerType.TcpP2PTarget, msg.TargetUID); + NetworkP2PHelper targetSocket = new NetworkP2PHelper(Enum.ServerType.TcpP2PTarget, msg.TargetUID); targetSocket.Init(msg.OtherIP, msg.OtherPort, true, userBindPort); //尝试5次连接 for (int j = 0; j < 5; j++) diff --git a/ClientCore/Manager/P2PChat.cs b/ClientCore/Manager/P2PChat.cs index c701e04..f79b8f6 100644 --- a/ClientCore/Manager/P2PChat.cs +++ b/ClientCore/Manager/P2PChat.cs @@ -17,7 +17,7 @@ namespace ClientCore.Manager { ChatMsg = ChatMsg, }; - App.clientMgr.SendToTargetSocket(UID, (int)CommandID.CmdTcpP2PChat, ProtoBufHelper.Serizlize(msg)); + App.clientMgr.SendToTargetSocket(UID, (int)CommandID.CmdTcpP2PChat,(int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(msg)); } public void RecvChatMsg(long uid, byte[] reqData) { diff --git a/ClientCore/Manager/P2PFile.cs b/ClientCore/Manager/P2PFile.cs new file mode 100644 index 0000000..6d69833 --- /dev/null +++ b/ClientCore/Manager/P2PFile.cs @@ -0,0 +1,408 @@ +using AxibugProtobuf; +using ClientCore.Common; +using ClientCore.Event; +using ClientCore.Network; +using Google.Protobuf; +using System; +using System.IO; +using System.Net; +using System.Text; +using System.Threading.Tasks; + +namespace ClientCore.Manager +{ + public class P2PFile + { + public int cPackSize = 5 * 1024; + public int WaitSendPackCount = 100; + //是否自动同意接收 + public bool bAutoRecv = true; + public P2PFile() + { + //发送者协议注册 + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTcpP2PFilepushConfirmResp, RecvTcpP2PFilepushConfirmResp); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTcpP2PFilepushResp, RecvTcpP2PFilepushResp); + //接收者协议注册 + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTcpP2PFilepushConfirm, RecvTcpP2PFilepushConfirm); + NetMsg.Instance.RegNetMsgEvent((int)CommandID.CmdTcpP2PFilepush, RecvTcpP2PFilepush); + } + + + #region 发送者网络消息 + public void SendFilePushConfirm(long UID, FilePushTask taskinfo) + { + Protobuf_TcpP2P_FilePushConfirm msg = new Protobuf_TcpP2P_FilePushConfirm() + { + TaskID = taskinfo.TaskID, + PackSize = taskinfo.PackSize, + ContentType = taskinfo.ContentType, + FileHash = taskinfo.FileHash, + FileLenght = taskinfo.FileLenght, + FileName = taskinfo.FileName, + PackCount = taskinfo.PackCount, + }; + App.clientMgr.SendToTargetSocket(UID, (int)CommandID.CmdTcpP2PFilepushConfirm, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(msg)); + } + public void SendFilePush(long UID,int TaskID, long Index, byte[] data, int dataLength) + { + Protobuf_TcpP2P_FilePush msg = new Protobuf_TcpP2P_FilePush() + { + TaskID = TaskID, + PackIndex = Index, + PackLenght= dataLength, + FileData = ByteString.CopyFrom(data) + }; + App.clientMgr.SendToTargetSocket(UID, (int)CommandID.CmdTcpP2PFilepush, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(msg)); + } + void RecvTcpP2PFilepushConfirmResp(long uid, byte[] reqData) + { + Protobuf_TcpP2P_FilePushConfirm_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + // 开始发送 + if (msg.Agree == 1) + { + sender_AgreeRecvFile(msg.TaskID); + } + else + { + //TODO 被拒绝 + } + } + void RecvTcpP2PFilepushResp(long uid, byte[] reqData) + { + //收到回执信息 + Protobuf_TcpP2P_FilePush_RESP msg = ProtoBufHelper.DeSerizlize(reqData); + sender_StartPushFileThread(msg.TaskID, msg.FinishIndex); + } + #endregion + + #region 发送者逻辑 + Dictionary DictTaskID2Task_SendReady = new Dictionary(); + Dictionary DictTaskID2Task_SendDo = new Dictionary(); + + /// + /// 发送者发送文件请求 + /// + /// + /// + public void sender_FilePushConfirmToTarget(long UID, string path) + { + FileInfo finfo = new FileInfo(path); + //向上取整 + long packCount = (long)Math.Ceiling(finfo.Length / (float)cPackSize); + FilePushTask ftask = new FilePushTask() + { + TaskID = 1,//TODO + fromUID = App.userMgr.MainPlayer.UID, + targetUID = UID, + Path = path, + FileName = finfo.Name, + PackSize = cPackSize, + PackCount = packCount, + FileLenght = finfo.Length, + FileHash = "",//TODO + ContentType = "",//TODO + + CurrIndex = -1, + ConfirmIndex= -1, + }; + SendFilePushConfirm(UID, ftask); + + DictTaskID2Task_SendReady[ftask.TaskID] = ftask; + } + public void sender_AgreeRecvFile(int TaskID) + { + if (DictTaskID2Task_SendReady.ContainsKey(TaskID)) + { + FilePushTask task = DictTaskID2Task_SendReady[TaskID]; + DictTaskID2Task_SendDo[TaskID] = task; + DictTaskID2Task_SendReady.Remove(TaskID); + sender_StartPushFile(TaskID); + } + } + + //开始发送文件传输 + void sender_StartPushFile(int TaskID) + { + if (!DictTaskID2Task_SendDo.ContainsKey(TaskID)) + { + return; + } + + FilePushTask task = DictTaskID2Task_SendDo[TaskID]; + Thread thread = new Thread(sender_StartPushFileThread); + thread.IsBackground = true; + thread.Start(TaskID); + } + + void sender_StartPushFileThread(int TaskID,long Index) + { + if (!DictTaskID2Task_SendDo.ContainsKey(TaskID)) + return; + DictTaskID2Task_SendDo[TaskID].ConfirmIndex = Index; + } + + /// + /// 开始发送线程用 + /// + /// + void sender_StartPushFileThread(object obj) + { + int TaskID = (int)obj; + if (!DictTaskID2Task_SendDo.ContainsKey(TaskID)) + return; + + FilePushTask task = DictTaskID2Task_SendDo[TaskID]; + + //构造读取文件流对象 + using (FileStream fsRead = new FileStream(task.Path, FileMode.Open)) //打开文件,不能创建新的 + { + //开辟临时缓存内存 + byte[] byteArrayRead = new byte[cPackSize]; // 1字节*1024 = 1k 1k*1024 = 1M内存 + + App.log.Debug($"[文件发送者]开始发送文件!!"); + //通过死缓存去读文本中的内容 + while (true) + { + //若发送下标,大于确认下标一定数量,则等待 + while (task.CurrIndex - task.ConfirmIndex > WaitSendPackCount) + { + Thread.Sleep(10); + } + + //readCount 这个是保存真正读取到的字节数 + int readCount = fsRead.Read(byteArrayRead, 0, byteArrayRead.Length); + + //TODO 大小 + //if (readCount == cPackSize) + //{ + //} + //else + //{ + //} + + task.CurrIndex++; + SendFilePush(task.targetUID, TaskID, task.CurrIndex, byteArrayRead, readCount); + //App.log.Debug($"发送文件片段,下标->{task.CurrIndex}"); + + //既然是死循环 那么什么时候我们停止读取文本内容 我们知道文本最后一行的大小肯定是小于缓存内存大小的 + if (readCount < byteArrayRead.Length) + { + App.log.Debug($"[文件发送者]文件发送完毕!! task.CurrIndex->{task.CurrIndex}"); + DictTaskID2Task_SendDo.Remove(TaskID); + fsRead.Close(); + break; //结束循环 + } + } + } + } + #endregion + + #region 接收者网络消息 + /// + /// + /// + /// + /// + /// [1]同意 [0]拒绝 + public void SendFilePushConfirm_Resp(long UID, int TaskID, int bAgree) + { + Protobuf_TcpP2P_FilePushConfirm_RESP msg = new Protobuf_TcpP2P_FilePushConfirm_RESP() + { + TaskID = TaskID, + Agree = bAgree + }; + App.clientMgr.SendToTargetSocket(UID, (int)CommandID.CmdTcpP2PFilepushConfirmResp, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(msg)); + } + /// + /// + /// + /// + /// + /// + public void SendFilePush_Resp(long UID, int TaskID, long Index) + { + Protobuf_TcpP2P_FilePush_RESP msg = new Protobuf_TcpP2P_FilePush_RESP() + { + TaskID = TaskID, + FinishIndex = Index + }; + App.clientMgr.SendToTargetSocket(UID, (int)CommandID.CmdTcpP2PFilepushResp, (int)ErrorCode.ErrorOk, ProtoBufHelper.Serizlize(msg)); + } + void RecvTcpP2PFilepushConfirm(long uid, byte[] reqData) + { + Protobuf_TcpP2P_FilePushConfirm msg = ProtoBufHelper.DeSerizlize(reqData); + receiver_AddRecvFileReady(new FilePushTask() + { + TaskID = msg.TaskID, + PackSize = cPackSize, + ContentType = msg.ContentType, + FileHash = msg.FileHash, + FileLenght = msg.FileLenght, + FileName = msg.FileName, + PackCount = msg.PackCount, + + Path = "",//待插入 + fromUID = uid, + targetUID = App.userMgr.MainPlayer.UID, + CurrIndex = -1, + ConfirmIndex= -1,//虽然用不上 + }); + //TODO 事件 EventSystem.Instance.PostEvent(EEvent.OnP2PChatMsg, uid, msg.ChatMsg); + } + void RecvTcpP2PFilepush(long uid, byte[] reqData) + { + Protobuf_TcpP2P_FilePush msg = ProtoBufHelper.DeSerizlize(reqData); + if (!DictTaskID2Task_RecvDataQueue.ContainsKey(msg.TaskID)) + return; + + if (msg == null) + { + } + + DictTaskID2Task_RecvDataQueue[msg.TaskID].Enqueue(msg); + } + + #endregion + + #region 接受者逻辑 + Dictionary DictTaskID2Task_RecvReady = new Dictionary(); + Dictionary DictTaskID2Task_RecvDo = new Dictionary(); + Dictionary> DictTaskID2Task_RecvDataQueue = new Dictionary>(); + /// + /// 接收数据准备 + /// + /// + void receiver_AddRecvFileReady(FilePushTask task) + { + DictTaskID2Task_RecvReady[task.TaskID] = task; + + //自动接收文件 + if (bAutoRecv) + { + receiver_AgreeRecvFile(task.TaskID); + } + } + + /// + /// 同意文件传输 + /// + /// + public void receiver_AgreeRecvFile(int TaskID) + { + if (DictTaskID2Task_RecvReady.ContainsKey(TaskID)) + { + FilePushTask task = DictTaskID2Task_RecvReady[TaskID]; + DictTaskID2Task_RecvDo[TaskID] = task; + DictTaskID2Task_RecvReady.Remove(TaskID); + receiver_StartRecvFile(TaskID); + App.log.Debug("[文件接收者]:发送同意接收"); + SendFilePushConfirm_Resp(task.fromUID, task.TaskID, 1); + } + } + + /// + /// 开始接收文件传输 + /// + /// + void receiver_StartRecvFile(int TaskID) + { + if (!DictTaskID2Task_RecvDo.ContainsKey(TaskID)) + { + return; + } + + FilePushTask task = DictTaskID2Task_RecvDo[TaskID]; + DictTaskID2Task_RecvDataQueue[TaskID] = new Queue(); + + Thread thread = new Thread(receiver_StartRecvFileThread); + thread.IsBackground = true; + thread.Start(TaskID); + App.log.Debug("[文件接收者]:准备接收线程"); + } + + /// + /// 接收任务线程 + /// + /// + void receiver_StartRecvFileThread(object obj) + { + int TaskID = (int)obj; + FilePushTask task = null; + if (!DictTaskID2Task_RecvDo.ContainsKey(TaskID)) + return; + + task = DictTaskID2Task_RecvDo[TaskID]; + + string fullpath = System.Environment.CurrentDirectory + "//" + task.FileName; + FileInfo myFile = new FileInfo(fullpath); + FileStream fs = myFile.Create(); + //int WriteLenght = 0; + //TODO 打开文件写入 + while (true) + { + Queue dataqueue = DictTaskID2Task_RecvDataQueue[TaskID]; + bool bflag = false; + while (dataqueue.Count > 0) + { + Protobuf_TcpP2P_FilePush msg = dataqueue.Dequeue(); + if (msg == null) + continue; + + bflag = true; + byte[] bytedata = msg.FileData.ToArray(); + if (msg.PackIndex - task.CurrIndex != 1) + { + App.log.Error($"[文件接收者]接收下标错误,msg.PackIndex->{msg.PackIndex} task.CurrIndex=>{task.CurrIndex}"); + } + //写入文件 + fs.Write(bytedata, 0, msg.PackLenght); + //WriteLenght += msg.PackLenght; + task.CurrIndex = msg.PackIndex; + //todo 写入片段 + //更新进度 + + //App.log.Debug($"[文件接收者]收到文件片段,下标->{task.CurrIndex}"); + } + + if (bflag) + { + //回执收到信息 + SendFilePush_Resp(task.fromUID, TaskID, task.CurrIndex); + } + + if (task.CurrIndex + 1 >= task.PackCount) + { + //文件接收完毕 + App.log.Debug($"[文件接收者]文件接收完毕!! task.CurrIndex->{task.CurrIndex} task.PackCount->{task.PackCount}"); + //删除进行中字典 + DictTaskID2Task_RecvDo.Remove(TaskID); + //删除进行中数据队列 + DictTaskID2Task_RecvDataQueue.Remove(TaskID); + break; + } + + Thread.Sleep(10); + } + //TODO 结束写入 + fs.Close(); + } + #endregion + } + + public class FilePushTask + { + public int TaskID;//传输任务ID + public long fromUID;//发送者UID + public long targetUID; + public string Path; + public long FileLenght;//文件长度 + public string ContentType;//ContentType + public string FileName;//文件名 + public int PackSize;//每个包大小 + public long PackCount;//包数量 + public string FileHash;//文件hash + + public long CurrIndex; + public long ConfirmIndex; + } +} diff --git a/ClientCore/Network/NetworkHelper.cs b/ClientCore/Network/NetworkHelper.cs index 299a51d..eccd59d 100644 --- a/ClientCore/Network/NetworkHelper.cs +++ b/ClientCore/Network/NetworkHelper.cs @@ -62,7 +62,7 @@ namespace ClientCore.Network /// 业务数据 public void GetDataCallBack(int CMDID, int ERRCODE, byte[] data) { - NetworkDeBugLog("收到消息 CMDID =>" + CMDID + " ERRCODE =>" + ERRCODE + " 数据长度=>" + data.Length); + //NetworkDeBugLog("收到消息 CMDID =>" + CMDID + " ERRCODE =>" + ERRCODE + " 数据长度=>" + data.Length); try { //抛出网络数据 diff --git a/ClientCore/Network/NetworkP2PHelper.cs b/ClientCore/Network/NetworkP2PHelper.cs new file mode 100644 index 0000000..db1bd3f --- /dev/null +++ b/ClientCore/Network/NetworkP2PHelper.cs @@ -0,0 +1,94 @@ +using AxibugProtobuf; +using ClientCore.Enum; +using ClientCore.Event; +using HaoYueNet.ClientNetwork; +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; + +namespace ClientCore.Network +{ + /// + /// 继承网络库,以支持网络功能 + /// + public class NetworkP2PHelper : NetworkHelperP2PCore + { + ServerType mServerType; + public long mUID { get; private set; } = -1; + public NetworkP2PHelper(ServerType serverType,long UID = -1) + { + //指定接收服务器数据事件 + OnDataCallBack += GetDataCallBack; + //断开连接 + OnClose += OnConnectClose; + //网络库调试信息输出事件,用于打印连接断开,收发事件 + OnLogOut += NetworkDeBugLog; + OnConnected += NetworkConnected; + mServerType = serverType; + mUID = UID; + } + + + public void NetworkConnected(bool IsConnect) + { + if (IsConnect) + { + EventSystem.Instance.PostEvent(EEvent.OnSocketConnect, mServerType, true); + NetworkDeBugLog("服务器连接成功"); + } + else + { + EventSystem.Instance.PostEvent(EEvent.OnSocketConnect, mServerType, false); + NetworkDeBugLog("服务器连接失败"); + //to do 重连逻辑 + } + } + + public void NetworkDeBugLog(string str) + { + //用于Unity内的输出 + //Debug.Log("NetCoreDebug >> "+str); + + Console.WriteLine("NetCoreDebug >> " + str); + } + + /// + /// 接受包回调 + /// + /// 协议ID + /// 错误编号 + /// 业务数据 + public void GetDataCallBack(int CMDID, int ERRCODE, byte[] data) + { + //NetworkDeBugLog("收到消息 CMDID =>" + CMDID + " ERRCODE =>" + ERRCODE + " 数据长度=>" + data.Length); + try + { + //抛出网络数据 + if (mServerType == ServerType.TcpP2PTarget) + { + NetMsg.Instance.PostNetMsgEvent(CMDID, mUID,data); + } + else + { + NetMsg.Instance.PostNetMsgEvent(CMDID, data); + } + } + catch (Exception ex) + { + NetworkDeBugLog("逻辑处理错误:" + ex.ToString()); + } + + } + + /// + /// 关闭连接 + /// + public void OnConnectClose() + { + NetworkDeBugLog("OnConnectClose"); + EventSystem.Instance.PostEvent(EEvent.OnSocketDisconnect, mServerType, mUID); + } + } +} diff --git a/ClientCore/obj/Debug/net7.0/ClientCore.assets.cache b/ClientCore/obj/Debug/net7.0/ClientCore.assets.cache index dc19662..2a597f0 100644 Binary files a/ClientCore/obj/Debug/net7.0/ClientCore.assets.cache and b/ClientCore/obj/Debug/net7.0/ClientCore.assets.cache differ diff --git a/ClientCore/obj/Debug/net7.0/ClientCore.csproj.FileListAbsolute.txt b/ClientCore/obj/Debug/net7.0/ClientCore.csproj.FileListAbsolute.txt index 6b9e748..e69de29 100644 --- a/ClientCore/obj/Debug/net7.0/ClientCore.csproj.FileListAbsolute.txt +++ b/ClientCore/obj/Debug/net7.0/ClientCore.csproj.FileListAbsolute.txt @@ -1,17 +0,0 @@ -F:\Sin365\HaoYueTunnel\ClientCore\bin\Debug\net7.0\ClientCore.deps.json -F:\Sin365\HaoYueTunnel\ClientCore\bin\Debug\net7.0\ClientCore.dll -F:\Sin365\HaoYueTunnel\ClientCore\bin\Debug\net7.0\ClientCore.pdb -F:\Sin365\HaoYueTunnel\ClientCore\bin\Debug\net7.0\Google.Protobuf.dll -F:\Sin365\HaoYueTunnel\ClientCore\bin\Debug\net7.0\HaoYueNet.ClientNetwork.dll -F:\Sin365\HaoYueTunnel\ClientCore\bin\Debug\net7.0\Protobuf.dll -F:\Sin365\HaoYueTunnel\ClientCore\bin\Debug\net7.0\Protobuf.pdb -F:\Sin365\HaoYueTunnel\ClientCore\obj\Debug\net7.0\ClientCore.csproj.AssemblyReference.cache -F:\Sin365\HaoYueTunnel\ClientCore\obj\Debug\net7.0\ClientCore.GeneratedMSBuildEditorConfig.editorconfig -F:\Sin365\HaoYueTunnel\ClientCore\obj\Debug\net7.0\ClientCore.AssemblyInfoInputs.cache -F:\Sin365\HaoYueTunnel\ClientCore\obj\Debug\net7.0\ClientCore.AssemblyInfo.cs -F:\Sin365\HaoYueTunnel\ClientCore\obj\Debug\net7.0\ClientCore.csproj.CoreCompileInputs.cache -F:\Sin365\HaoYueTunnel\ClientCore\obj\Debug\net7.0\ClientCore.csproj.CopyComplete -F:\Sin365\HaoYueTunnel\ClientCore\obj\Debug\net7.0\ClientCore.dll -F:\Sin365\HaoYueTunnel\ClientCore\obj\Debug\net7.0\refint\ClientCore.dll -F:\Sin365\HaoYueTunnel\ClientCore\obj\Debug\net7.0\ClientCore.pdb -F:\Sin365\HaoYueTunnel\ClientCore\obj\Debug\net7.0\ref\ClientCore.dll diff --git a/NetLib/HaoYueNet.ClientNetwork.dll b/NetLib/HaoYueNet.ClientNetwork.dll index e212c60..a8d7072 100644 Binary files a/NetLib/HaoYueNet.ClientNetwork.dll and b/NetLib/HaoYueNet.ClientNetwork.dll differ diff --git a/Protobuf/ProtobufAuth.cs b/Protobuf/ProtobufAuth.cs index 3fdc87c..b0cda6d 100644 --- a/Protobuf/ProtobufAuth.cs +++ b/Protobuf/ProtobufAuth.cs @@ -34,18 +34,21 @@ namespace AxibugProtobuf { "EgsKA1VJRBgFIAEoAxIQCghOaWNrTmFtZRgGIAEoCSIjChBQcm90b2J1Zl9D", "aGF0TXNnEg8KB0NoYXRNc2cYASABKAkiSAoVUHJvdG9idWZfQ2hhdE1zZ19S", "RVNQEhAKCE5pY2tOYW1lGAEgASgJEg8KB0NoYXRNc2cYAiABKAkSDAoERGF0", - "ZRgDIAEoAyrkAQoJQ29tbWFuZElEEg4KCkNNRF9ERUZBVUwQABIOCglDTURf", + "ZRgDIAEoAyrqAgoJQ29tbWFuZElEEg4KCkNNRF9ERUZBVUwQABIOCglDTURf", "TE9HSU4Q0A8SEAoLQ01EX0NIQVRNU0cQoB8SGAoTQ01EX1VTRVJfT05MSU5F", "TElTVBCIJxISCg1DTURfVVNFUl9KT0lOEKcnEhMKDkNNRF9VU0VSX0xFQVZF", "EKgnEhoKFUNNRF9VU0VSX1NUQVRFX1VQREFURRCpJxIYChNDTURfVENQVFVO", "TkVMX0hFTExPEIknEhUKEENNRF9UQ1BUVU5ORUxfRE8QiicSFQoQQ01EX1RD", - "UF9QMlBfQ0hBVBCRTio+CglFcnJvckNvZGUSEAoMRVJST1JfREVGQVVMEAAS", - "DAoIRVJST1JfT0sQARIRCg1FUlJPUl9OT1RGSU5EEGQqPgoJTG9naW5UeXBl", - "Eg8KC0Jhc2VEZWZhdWx0EAASDgoKSGFvWXVlQXV0aBABEgcKA0JGMxADEgcK", - "A0JGNBAEKksKCkRldmljZVR5cGUSFgoSRGV2aWNlVHlwZV9EZWZhdWx0EAAS", - "BgoCUEMQARILCgdBbmRyb2lkEAISBwoDSU9TEAMSBwoDUFNWEAQqTgoRTG9n", - "aW5SZXN1bHRTdGF0dXMSIQodTG9naW5SZXN1bHRTdGF0dXNfQmFzZURlZmF1", - "bHQQABIGCgJPSxABEg4KCkFjY291bnRFcnIQAkICSAFiBnByb3RvMw==")); + "UF9QMlBfQ0hBVBCRThIhChxDTURfVENQX1AyUF9GSUxFUFVTSF9DT05GSVJN", + "EPlVEiYKIUNNRF9UQ1BfUDJQX0ZJTEVQVVNIX0NPTkZJUk1fUkVTUBD6VRIZ", + "ChRDTURfVENQX1AyUF9GSUxFUFVTSBD7VRIeChlDTURfVENQX1AyUF9GSUxF", + "UFVTSF9SRVNQEPxVKj4KCUVycm9yQ29kZRIQCgxFUlJPUl9ERUZBVUwQABIM", + "CghFUlJPUl9PSxABEhEKDUVSUk9SX05PVEZJTkQQZCo+CglMb2dpblR5cGUS", + "DwoLQmFzZURlZmF1bHQQABIOCgpIYW9ZdWVBdXRoEAESBwoDQkYzEAMSBwoD", + "QkY0EAQqSwoKRGV2aWNlVHlwZRIWChJEZXZpY2VUeXBlX0RlZmF1bHQQABIG", + "CgJQQxABEgsKB0FuZHJvaWQQAhIHCgNJT1MQAxIHCgNQU1YQBCpOChFMb2dp", + "blJlc3VsdFN0YXR1cxIhCh1Mb2dpblJlc3VsdFN0YXR1c19CYXNlRGVmYXVs", + "dBAAEgYKAk9LEAESDgoKQWNjb3VudEVychACQgJIAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -100,6 +103,22 @@ namespace AxibugProtobuf { ///TCPP2P聊天 Protobuf_TcpP2P_Chat /// [pbr::OriginalName("CMD_TCP_P2P_CHAT")] CmdTcpP2PChat = 10001, + /// + ///TCPP2P 文件传输上下行分开 + /// + [pbr::OriginalName("CMD_TCP_P2P_FILEPUSH_CONFIRM")] CmdTcpP2PFilepushConfirm = 11001, + /// + ///TCPP2文件传输 下行 对应 Protobuf_TcpP2P_FilePushConfirm_RESP + /// + [pbr::OriginalName("CMD_TCP_P2P_FILEPUSH_CONFIRM_RESP")] CmdTcpP2PFilepushConfirmResp = 11002, + /// + ///TCPP2文件传输 过程 上行 对应 Protobuf_TcpP2P_FilePush + /// + [pbr::OriginalName("CMD_TCP_P2P_FILEPUSH")] CmdTcpP2PFilepush = 11003, + /// + ///TCPP2文件传输 过程 下行 对应 Protobuf_TcpP2P_FilePush_RESP + /// + [pbr::OriginalName("CMD_TCP_P2P_FILEPUSH_RESP")] CmdTcpP2PFilepushResp = 11004, } public enum ErrorCode { diff --git a/Protobuf/ProtobufTcpTunnel.cs b/Protobuf/ProtobufTcpTunnel.cs index bb80caa..5591831 100644 --- a/Protobuf/ProtobufTcpTunnel.cs +++ b/Protobuf/ProtobufTcpTunnel.cs @@ -31,8 +31,17 @@ namespace AxibugProtobuf { "RBgCIAEoAyJ3CiBQcm90b2J1Zl9UY3BUdW5uZWxfRG9UdW5uZWxfUkVTUBIR", "Cgl0YXJnZXRVSUQYASABKAMSDAoEbXlJUBgCIAEoCRIOCgZteVBvcnQYAyAB", "KAUSDwoHb3RoZXJJUBgEIAEoCRIRCglvdGhlclBvcnQYBSABKAUiJwoUUHJv", - "dG9idWZfVGNwUDJQX0NoYXQSDwoHQ2hhdE1zZxgBIAEoCUICSAFiBnByb3Rv", - "Mw==")); + "dG9idWZfVGNwUDJQX0NoYXQSDwoHQ2hhdE1zZxgBIAEoCSKjAQofUHJvdG9i", + "dWZfVGNwUDJQX0ZpbGVQdXNoQ29uZmlybRISCgpGaWxlTGVuZ2h0GAEgASgD", + "EhMKC0NvbnRlbnRUeXBlGAIgASgJEhAKCEZpbGVOYW1lGAMgASgJEg4KBlRh", + "c2tJRBgEIAEoBRIQCghQYWNrU2l6ZRgFIAEoBRIRCglQYWNrQ291bnQYBiAB", + "KAMSEAoIRmlsZUhhc2gYByABKAkiRQokUHJvdG9idWZfVGNwUDJQX0ZpbGVQ", + "dXNoQ29uZmlybV9SRVNQEg4KBlRhc2tJRBgBIAEoBRINCgVBZ3JlZRgCIAEo", + "BSJkChhQcm90b2J1Zl9UY3BQMlBfRmlsZVB1c2gSDgoGVGFza0lEGAEgASgF", + "EhEKCVBhY2tJbmRleBgCIAEoAxIRCglGaWxlX0RhdGEYAyABKAwSEgoKUGFj", + "a0xlbmdodBgEIAEoBSJECh1Qcm90b2J1Zl9UY3BQMlBfRmlsZVB1c2hfUkVT", + "UBIOCgZUYXNrSUQYASABKAUSEwoLRmluaXNoSW5kZXgYAiABKANCAkgBYgZw", + "cm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -40,7 +49,11 @@ namespace AxibugProtobuf { new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpTunnel_HellToSev_RESP), global::AxibugProtobuf.Protobuf_TcpTunnel_HellToSev_RESP.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpTunnel_DoTunnel), global::AxibugProtobuf.Protobuf_TcpTunnel_DoTunnel.Parser, new[]{ "UID", "TargetUID" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpTunnel_DoTunnel_RESP), global::AxibugProtobuf.Protobuf_TcpTunnel_DoTunnel_RESP.Parser, new[]{ "TargetUID", "MyIP", "MyPort", "OtherIP", "OtherPort" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_Chat), global::AxibugProtobuf.Protobuf_TcpP2P_Chat.Parser, new[]{ "ChatMsg" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_Chat), global::AxibugProtobuf.Protobuf_TcpP2P_Chat.Parser, new[]{ "ChatMsg" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_FilePushConfirm), global::AxibugProtobuf.Protobuf_TcpP2P_FilePushConfirm.Parser, new[]{ "FileLenght", "ContentType", "FileName", "TaskID", "PackSize", "PackCount", "FileHash" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_FilePushConfirm_RESP), global::AxibugProtobuf.Protobuf_TcpP2P_FilePushConfirm_RESP.Parser, new[]{ "TaskID", "Agree" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_FilePush), global::AxibugProtobuf.Protobuf_TcpP2P_FilePush.Parser, new[]{ "TaskID", "PackIndex", "FileData", "PackLenght" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_FilePush_RESP), global::AxibugProtobuf.Protobuf_TcpP2P_FilePush_RESP.Parser, new[]{ "TaskID", "FinishIndex" }, null, null, null, null) })); } #endregion @@ -1093,6 +1106,1141 @@ namespace AxibugProtobuf { } + /// + ///TCPP2P文件传输 确认 + /// + public sealed partial class Protobuf_TcpP2P_FilePushConfirm : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_TcpP2P_FilePushConfirm()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufTcpTunnelReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm(Protobuf_TcpP2P_FilePushConfirm other) : this() { + fileLenght_ = other.fileLenght_; + contentType_ = other.contentType_; + fileName_ = other.fileName_; + taskID_ = other.taskID_; + packSize_ = other.packSize_; + packCount_ = other.packCount_; + fileHash_ = other.fileHash_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm Clone() { + return new Protobuf_TcpP2P_FilePushConfirm(this); + } + + /// Field number for the "FileLenght" field. + public const int FileLenghtFieldNumber = 1; + private long fileLenght_; + /// + ///文件长度 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long FileLenght { + get { return fileLenght_; } + set { + fileLenght_ = value; + } + } + + /// Field number for the "ContentType" field. + public const int ContentTypeFieldNumber = 2; + private string contentType_ = ""; + /// + ///ContentType + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ContentType { + get { return contentType_; } + set { + contentType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "FileName" field. + public const int FileNameFieldNumber = 3; + private string fileName_ = ""; + /// + ///文件名 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string FileName { + get { return fileName_; } + set { + fileName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "TaskID" field. + public const int TaskIDFieldNumber = 4; + private int taskID_; + /// + ///传输任务ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int TaskID { + get { return taskID_; } + set { + taskID_ = value; + } + } + + /// Field number for the "PackSize" field. + public const int PackSizeFieldNumber = 5; + private int packSize_; + /// + ///每个包大小 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PackSize { + get { return packSize_; } + set { + packSize_ = value; + } + } + + /// Field number for the "PackCount" field. + public const int PackCountFieldNumber = 6; + private long packCount_; + /// + ///包数量 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long PackCount { + get { return packCount_; } + set { + packCount_ = value; + } + } + + /// Field number for the "FileHash" field. + public const int FileHashFieldNumber = 7; + private string fileHash_ = ""; + /// + ///文件hash + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string FileHash { + get { return fileHash_; } + set { + fileHash_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_TcpP2P_FilePushConfirm); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_TcpP2P_FilePushConfirm other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FileLenght != other.FileLenght) return false; + if (ContentType != other.ContentType) return false; + if (FileName != other.FileName) return false; + if (TaskID != other.TaskID) return false; + if (PackSize != other.PackSize) return false; + if (PackCount != other.PackCount) return false; + if (FileHash != other.FileHash) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (FileLenght != 0L) hash ^= FileLenght.GetHashCode(); + if (ContentType.Length != 0) hash ^= ContentType.GetHashCode(); + if (FileName.Length != 0) hash ^= FileName.GetHashCode(); + if (TaskID != 0) hash ^= TaskID.GetHashCode(); + if (PackSize != 0) hash ^= PackSize.GetHashCode(); + if (PackCount != 0L) hash ^= PackCount.GetHashCode(); + if (FileHash.Length != 0) hash ^= FileHash.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (FileLenght != 0L) { + output.WriteRawTag(8); + output.WriteInt64(FileLenght); + } + if (ContentType.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ContentType); + } + if (FileName.Length != 0) { + output.WriteRawTag(26); + output.WriteString(FileName); + } + if (TaskID != 0) { + output.WriteRawTag(32); + output.WriteInt32(TaskID); + } + if (PackSize != 0) { + output.WriteRawTag(40); + output.WriteInt32(PackSize); + } + if (PackCount != 0L) { + output.WriteRawTag(48); + output.WriteInt64(PackCount); + } + if (FileHash.Length != 0) { + output.WriteRawTag(58); + output.WriteString(FileHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (FileLenght != 0L) { + output.WriteRawTag(8); + output.WriteInt64(FileLenght); + } + if (ContentType.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ContentType); + } + if (FileName.Length != 0) { + output.WriteRawTag(26); + output.WriteString(FileName); + } + if (TaskID != 0) { + output.WriteRawTag(32); + output.WriteInt32(TaskID); + } + if (PackSize != 0) { + output.WriteRawTag(40); + output.WriteInt32(PackSize); + } + if (PackCount != 0L) { + output.WriteRawTag(48); + output.WriteInt64(PackCount); + } + if (FileHash.Length != 0) { + output.WriteRawTag(58); + output.WriteString(FileHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (FileLenght != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(FileLenght); + } + if (ContentType.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ContentType); + } + if (FileName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FileName); + } + if (TaskID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TaskID); + } + if (PackSize != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PackSize); + } + if (PackCount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(PackCount); + } + if (FileHash.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FileHash); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_TcpP2P_FilePushConfirm other) { + if (other == null) { + return; + } + if (other.FileLenght != 0L) { + FileLenght = other.FileLenght; + } + if (other.ContentType.Length != 0) { + ContentType = other.ContentType; + } + if (other.FileName.Length != 0) { + FileName = other.FileName; + } + if (other.TaskID != 0) { + TaskID = other.TaskID; + } + if (other.PackSize != 0) { + PackSize = other.PackSize; + } + if (other.PackCount != 0L) { + PackCount = other.PackCount; + } + if (other.FileHash.Length != 0) { + FileHash = other.FileHash; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FileLenght = input.ReadInt64(); + break; + } + case 18: { + ContentType = input.ReadString(); + break; + } + case 26: { + FileName = input.ReadString(); + break; + } + case 32: { + TaskID = input.ReadInt32(); + break; + } + case 40: { + PackSize = input.ReadInt32(); + break; + } + case 48: { + PackCount = input.ReadInt64(); + break; + } + case 58: { + FileHash = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + FileLenght = input.ReadInt64(); + break; + } + case 18: { + ContentType = input.ReadString(); + break; + } + case 26: { + FileName = input.ReadString(); + break; + } + case 32: { + TaskID = input.ReadInt32(); + break; + } + case 40: { + PackSize = input.ReadInt32(); + break; + } + case 48: { + PackCount = input.ReadInt64(); + break; + } + case 58: { + FileHash = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Protobuf_TcpP2P_FilePushConfirm_RESP : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_TcpP2P_FilePushConfirm_RESP()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufTcpTunnelReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm_RESP() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm_RESP(Protobuf_TcpP2P_FilePushConfirm_RESP other) : this() { + taskID_ = other.taskID_; + agree_ = other.agree_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm_RESP Clone() { + return new Protobuf_TcpP2P_FilePushConfirm_RESP(this); + } + + /// Field number for the "TaskID" field. + public const int TaskIDFieldNumber = 1; + private int taskID_; + /// + ///传输任务ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int TaskID { + get { return taskID_; } + set { + taskID_ = value; + } + } + + /// Field number for the "Agree" field. + public const int AgreeFieldNumber = 2; + private int agree_; + /// + ///[0]拒绝 [1]同意 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Agree { + get { return agree_; } + set { + agree_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_TcpP2P_FilePushConfirm_RESP); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_TcpP2P_FilePushConfirm_RESP other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TaskID != other.TaskID) return false; + if (Agree != other.Agree) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TaskID != 0) hash ^= TaskID.GetHashCode(); + if (Agree != 0) hash ^= Agree.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (Agree != 0) { + output.WriteRawTag(16); + output.WriteInt32(Agree); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (Agree != 0) { + output.WriteRawTag(16); + output.WriteInt32(Agree); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TaskID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TaskID); + } + if (Agree != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Agree); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_TcpP2P_FilePushConfirm_RESP other) { + if (other == null) { + return; + } + if (other.TaskID != 0) { + TaskID = other.TaskID; + } + if (other.Agree != 0) { + Agree = other.Agree; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + Agree = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + Agree = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + ///TCPP2P文件传输 过程 + /// + public sealed partial class Protobuf_TcpP2P_FilePush : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_TcpP2P_FilePush()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufTcpTunnelReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush(Protobuf_TcpP2P_FilePush other) : this() { + taskID_ = other.taskID_; + packIndex_ = other.packIndex_; + fileData_ = other.fileData_; + packLenght_ = other.packLenght_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush Clone() { + return new Protobuf_TcpP2P_FilePush(this); + } + + /// Field number for the "TaskID" field. + public const int TaskIDFieldNumber = 1; + private int taskID_; + /// + ///传输任务ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int TaskID { + get { return taskID_; } + set { + taskID_ = value; + } + } + + /// Field number for the "PackIndex" field. + public const int PackIndexFieldNumber = 2; + private long packIndex_; + /// + ///文件片 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long PackIndex { + get { return packIndex_; } + set { + packIndex_ = value; + } + } + + /// Field number for the "File_Data" field. + public const int FileDataFieldNumber = 3; + private pb::ByteString fileData_ = pb::ByteString.Empty; + /// + ///文件数量 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString FileData { + get { return fileData_; } + set { + fileData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "PackLenght" field. + public const int PackLenghtFieldNumber = 4; + private int packLenght_; + /// + ///数据长度 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PackLenght { + get { return packLenght_; } + set { + packLenght_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_TcpP2P_FilePush); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_TcpP2P_FilePush other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TaskID != other.TaskID) return false; + if (PackIndex != other.PackIndex) return false; + if (FileData != other.FileData) return false; + if (PackLenght != other.PackLenght) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TaskID != 0) hash ^= TaskID.GetHashCode(); + if (PackIndex != 0L) hash ^= PackIndex.GetHashCode(); + if (FileData.Length != 0) hash ^= FileData.GetHashCode(); + if (PackLenght != 0) hash ^= PackLenght.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (PackIndex != 0L) { + output.WriteRawTag(16); + output.WriteInt64(PackIndex); + } + if (FileData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(FileData); + } + if (PackLenght != 0) { + output.WriteRawTag(32); + output.WriteInt32(PackLenght); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (PackIndex != 0L) { + output.WriteRawTag(16); + output.WriteInt64(PackIndex); + } + if (FileData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(FileData); + } + if (PackLenght != 0) { + output.WriteRawTag(32); + output.WriteInt32(PackLenght); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TaskID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TaskID); + } + if (PackIndex != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(PackIndex); + } + if (FileData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(FileData); + } + if (PackLenght != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PackLenght); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_TcpP2P_FilePush other) { + if (other == null) { + return; + } + if (other.TaskID != 0) { + TaskID = other.TaskID; + } + if (other.PackIndex != 0L) { + PackIndex = other.PackIndex; + } + if (other.FileData.Length != 0) { + FileData = other.FileData; + } + if (other.PackLenght != 0) { + PackLenght = other.PackLenght; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + PackIndex = input.ReadInt64(); + break; + } + case 26: { + FileData = input.ReadBytes(); + break; + } + case 32: { + PackLenght = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + PackIndex = input.ReadInt64(); + break; + } + case 26: { + FileData = input.ReadBytes(); + break; + } + case 32: { + PackLenght = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Protobuf_TcpP2P_FilePush_RESP : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_TcpP2P_FilePush_RESP()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufTcpTunnelReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush_RESP() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush_RESP(Protobuf_TcpP2P_FilePush_RESP other) : this() { + taskID_ = other.taskID_; + finishIndex_ = other.finishIndex_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush_RESP Clone() { + return new Protobuf_TcpP2P_FilePush_RESP(this); + } + + /// Field number for the "TaskID" field. + public const int TaskIDFieldNumber = 1; + private int taskID_; + /// + ///传输任务ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int TaskID { + get { return taskID_; } + set { + taskID_ = value; + } + } + + /// Field number for the "FinishIndex" field. + public const int FinishIndexFieldNumber = 2; + private long finishIndex_; + /// + ///完成包数量 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long FinishIndex { + get { return finishIndex_; } + set { + finishIndex_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_TcpP2P_FilePush_RESP); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_TcpP2P_FilePush_RESP other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TaskID != other.TaskID) return false; + if (FinishIndex != other.FinishIndex) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TaskID != 0) hash ^= TaskID.GetHashCode(); + if (FinishIndex != 0L) hash ^= FinishIndex.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (FinishIndex != 0L) { + output.WriteRawTag(16); + output.WriteInt64(FinishIndex); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (FinishIndex != 0L) { + output.WriteRawTag(16); + output.WriteInt64(FinishIndex); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TaskID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TaskID); + } + if (FinishIndex != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(FinishIndex); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_TcpP2P_FilePush_RESP other) { + if (other == null) { + return; + } + if (other.TaskID != 0) { + TaskID = other.TaskID; + } + if (other.FinishIndex != 0L) { + FinishIndex = other.FinishIndex; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + FinishIndex = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + FinishIndex = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + #endregion } diff --git a/Protobuf/obj/Debug/net7.0/Protobuf.assets.cache b/Protobuf/obj/Debug/net7.0/Protobuf.assets.cache index 4dae81b..25bed02 100644 Binary files a/Protobuf/obj/Debug/net7.0/Protobuf.assets.cache and b/Protobuf/obj/Debug/net7.0/Protobuf.assets.cache differ diff --git a/Protobuf/obj/Debug/net7.0/Protobuf.csproj.FileListAbsolute.txt b/Protobuf/obj/Debug/net7.0/Protobuf.csproj.FileListAbsolute.txt index b50d364..e69de29 100644 --- a/Protobuf/obj/Debug/net7.0/Protobuf.csproj.FileListAbsolute.txt +++ b/Protobuf/obj/Debug/net7.0/Protobuf.csproj.FileListAbsolute.txt @@ -1,14 +0,0 @@ -F:\Sin365\HaoYueTunnel\Protobuf\bin\Debug\net7.0\Protobuf.deps.json -F:\Sin365\HaoYueTunnel\Protobuf\bin\Debug\net7.0\Protobuf.dll -F:\Sin365\HaoYueTunnel\Protobuf\bin\Debug\net7.0\Protobuf.pdb -F:\Sin365\HaoYueTunnel\Protobuf\bin\Debug\net7.0\Google.Protobuf.dll -F:\Sin365\HaoYueTunnel\Protobuf\obj\Debug\net7.0\Protobuf.csproj.AssemblyReference.cache -F:\Sin365\HaoYueTunnel\Protobuf\obj\Debug\net7.0\Protobuf.GeneratedMSBuildEditorConfig.editorconfig -F:\Sin365\HaoYueTunnel\Protobuf\obj\Debug\net7.0\Protobuf.AssemblyInfoInputs.cache -F:\Sin365\HaoYueTunnel\Protobuf\obj\Debug\net7.0\Protobuf.AssemblyInfo.cs -F:\Sin365\HaoYueTunnel\Protobuf\obj\Debug\net7.0\Protobuf.csproj.CoreCompileInputs.cache -F:\Sin365\HaoYueTunnel\Protobuf\obj\Debug\net7.0\Protobuf.csproj.CopyComplete -F:\Sin365\HaoYueTunnel\Protobuf\obj\Debug\net7.0\Protobuf.dll -F:\Sin365\HaoYueTunnel\Protobuf\obj\Debug\net7.0\refint\Protobuf.dll -F:\Sin365\HaoYueTunnel\Protobuf\obj\Debug\net7.0\Protobuf.pdb -F:\Sin365\HaoYueTunnel\Protobuf\obj\Debug\net7.0\ref\Protobuf.dll diff --git a/ProtobufCore/out/ProtobufAuth.cs b/ProtobufCore/out/ProtobufAuth.cs index 3fdc87c..b0cda6d 100644 --- a/ProtobufCore/out/ProtobufAuth.cs +++ b/ProtobufCore/out/ProtobufAuth.cs @@ -34,18 +34,21 @@ namespace AxibugProtobuf { "EgsKA1VJRBgFIAEoAxIQCghOaWNrTmFtZRgGIAEoCSIjChBQcm90b2J1Zl9D", "aGF0TXNnEg8KB0NoYXRNc2cYASABKAkiSAoVUHJvdG9idWZfQ2hhdE1zZ19S", "RVNQEhAKCE5pY2tOYW1lGAEgASgJEg8KB0NoYXRNc2cYAiABKAkSDAoERGF0", - "ZRgDIAEoAyrkAQoJQ29tbWFuZElEEg4KCkNNRF9ERUZBVUwQABIOCglDTURf", + "ZRgDIAEoAyrqAgoJQ29tbWFuZElEEg4KCkNNRF9ERUZBVUwQABIOCglDTURf", "TE9HSU4Q0A8SEAoLQ01EX0NIQVRNU0cQoB8SGAoTQ01EX1VTRVJfT05MSU5F", "TElTVBCIJxISCg1DTURfVVNFUl9KT0lOEKcnEhMKDkNNRF9VU0VSX0xFQVZF", "EKgnEhoKFUNNRF9VU0VSX1NUQVRFX1VQREFURRCpJxIYChNDTURfVENQVFVO", "TkVMX0hFTExPEIknEhUKEENNRF9UQ1BUVU5ORUxfRE8QiicSFQoQQ01EX1RD", - "UF9QMlBfQ0hBVBCRTio+CglFcnJvckNvZGUSEAoMRVJST1JfREVGQVVMEAAS", - "DAoIRVJST1JfT0sQARIRCg1FUlJPUl9OT1RGSU5EEGQqPgoJTG9naW5UeXBl", - "Eg8KC0Jhc2VEZWZhdWx0EAASDgoKSGFvWXVlQXV0aBABEgcKA0JGMxADEgcK", - "A0JGNBAEKksKCkRldmljZVR5cGUSFgoSRGV2aWNlVHlwZV9EZWZhdWx0EAAS", - "BgoCUEMQARILCgdBbmRyb2lkEAISBwoDSU9TEAMSBwoDUFNWEAQqTgoRTG9n", - "aW5SZXN1bHRTdGF0dXMSIQodTG9naW5SZXN1bHRTdGF0dXNfQmFzZURlZmF1", - "bHQQABIGCgJPSxABEg4KCkFjY291bnRFcnIQAkICSAFiBnByb3RvMw==")); + "UF9QMlBfQ0hBVBCRThIhChxDTURfVENQX1AyUF9GSUxFUFVTSF9DT05GSVJN", + "EPlVEiYKIUNNRF9UQ1BfUDJQX0ZJTEVQVVNIX0NPTkZJUk1fUkVTUBD6VRIZ", + "ChRDTURfVENQX1AyUF9GSUxFUFVTSBD7VRIeChlDTURfVENQX1AyUF9GSUxF", + "UFVTSF9SRVNQEPxVKj4KCUVycm9yQ29kZRIQCgxFUlJPUl9ERUZBVUwQABIM", + "CghFUlJPUl9PSxABEhEKDUVSUk9SX05PVEZJTkQQZCo+CglMb2dpblR5cGUS", + "DwoLQmFzZURlZmF1bHQQABIOCgpIYW9ZdWVBdXRoEAESBwoDQkYzEAMSBwoD", + "QkY0EAQqSwoKRGV2aWNlVHlwZRIWChJEZXZpY2VUeXBlX0RlZmF1bHQQABIG", + "CgJQQxABEgsKB0FuZHJvaWQQAhIHCgNJT1MQAxIHCgNQU1YQBCpOChFMb2dp", + "blJlc3VsdFN0YXR1cxIhCh1Mb2dpblJlc3VsdFN0YXR1c19CYXNlRGVmYXVs", + "dBAAEgYKAk9LEAESDgoKQWNjb3VudEVychACQgJIAWIGcHJvdG8z")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(new[] {typeof(global::AxibugProtobuf.CommandID), typeof(global::AxibugProtobuf.ErrorCode), typeof(global::AxibugProtobuf.LoginType), typeof(global::AxibugProtobuf.DeviceType), typeof(global::AxibugProtobuf.LoginResultStatus), }, null, new pbr::GeneratedClrTypeInfo[] { @@ -100,6 +103,22 @@ namespace AxibugProtobuf { ///TCPP2P聊天 Protobuf_TcpP2P_Chat /// [pbr::OriginalName("CMD_TCP_P2P_CHAT")] CmdTcpP2PChat = 10001, + /// + ///TCPP2P 文件传输上下行分开 + /// + [pbr::OriginalName("CMD_TCP_P2P_FILEPUSH_CONFIRM")] CmdTcpP2PFilepushConfirm = 11001, + /// + ///TCPP2文件传输 下行 对应 Protobuf_TcpP2P_FilePushConfirm_RESP + /// + [pbr::OriginalName("CMD_TCP_P2P_FILEPUSH_CONFIRM_RESP")] CmdTcpP2PFilepushConfirmResp = 11002, + /// + ///TCPP2文件传输 过程 上行 对应 Protobuf_TcpP2P_FilePush + /// + [pbr::OriginalName("CMD_TCP_P2P_FILEPUSH")] CmdTcpP2PFilepush = 11003, + /// + ///TCPP2文件传输 过程 下行 对应 Protobuf_TcpP2P_FilePush_RESP + /// + [pbr::OriginalName("CMD_TCP_P2P_FILEPUSH_RESP")] CmdTcpP2PFilepushResp = 11004, } public enum ErrorCode { diff --git a/ProtobufCore/out/ProtobufTcpTunnel.cs b/ProtobufCore/out/ProtobufTcpTunnel.cs index bb80caa..5591831 100644 --- a/ProtobufCore/out/ProtobufTcpTunnel.cs +++ b/ProtobufCore/out/ProtobufTcpTunnel.cs @@ -31,8 +31,17 @@ namespace AxibugProtobuf { "RBgCIAEoAyJ3CiBQcm90b2J1Zl9UY3BUdW5uZWxfRG9UdW5uZWxfUkVTUBIR", "Cgl0YXJnZXRVSUQYASABKAMSDAoEbXlJUBgCIAEoCRIOCgZteVBvcnQYAyAB", "KAUSDwoHb3RoZXJJUBgEIAEoCRIRCglvdGhlclBvcnQYBSABKAUiJwoUUHJv", - "dG9idWZfVGNwUDJQX0NoYXQSDwoHQ2hhdE1zZxgBIAEoCUICSAFiBnByb3Rv", - "Mw==")); + "dG9idWZfVGNwUDJQX0NoYXQSDwoHQ2hhdE1zZxgBIAEoCSKjAQofUHJvdG9i", + "dWZfVGNwUDJQX0ZpbGVQdXNoQ29uZmlybRISCgpGaWxlTGVuZ2h0GAEgASgD", + "EhMKC0NvbnRlbnRUeXBlGAIgASgJEhAKCEZpbGVOYW1lGAMgASgJEg4KBlRh", + "c2tJRBgEIAEoBRIQCghQYWNrU2l6ZRgFIAEoBRIRCglQYWNrQ291bnQYBiAB", + "KAMSEAoIRmlsZUhhc2gYByABKAkiRQokUHJvdG9idWZfVGNwUDJQX0ZpbGVQ", + "dXNoQ29uZmlybV9SRVNQEg4KBlRhc2tJRBgBIAEoBRINCgVBZ3JlZRgCIAEo", + "BSJkChhQcm90b2J1Zl9UY3BQMlBfRmlsZVB1c2gSDgoGVGFza0lEGAEgASgF", + "EhEKCVBhY2tJbmRleBgCIAEoAxIRCglGaWxlX0RhdGEYAyABKAwSEgoKUGFj", + "a0xlbmdodBgEIAEoBSJECh1Qcm90b2J1Zl9UY3BQMlBfRmlsZVB1c2hfUkVT", + "UBIOCgZUYXNrSUQYASABKAUSEwoLRmluaXNoSW5kZXgYAiABKANCAkgBYgZw", + "cm90bzM=")); descriptor = pbr::FileDescriptor.FromGeneratedCode(descriptorData, new pbr::FileDescriptor[] { }, new pbr::GeneratedClrTypeInfo(null, null, new pbr::GeneratedClrTypeInfo[] { @@ -40,7 +49,11 @@ namespace AxibugProtobuf { new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpTunnel_HellToSev_RESP), global::AxibugProtobuf.Protobuf_TcpTunnel_HellToSev_RESP.Parser, null, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpTunnel_DoTunnel), global::AxibugProtobuf.Protobuf_TcpTunnel_DoTunnel.Parser, new[]{ "UID", "TargetUID" }, null, null, null, null), new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpTunnel_DoTunnel_RESP), global::AxibugProtobuf.Protobuf_TcpTunnel_DoTunnel_RESP.Parser, new[]{ "TargetUID", "MyIP", "MyPort", "OtherIP", "OtherPort" }, null, null, null, null), - new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_Chat), global::AxibugProtobuf.Protobuf_TcpP2P_Chat.Parser, new[]{ "ChatMsg" }, null, null, null, null) + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_Chat), global::AxibugProtobuf.Protobuf_TcpP2P_Chat.Parser, new[]{ "ChatMsg" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_FilePushConfirm), global::AxibugProtobuf.Protobuf_TcpP2P_FilePushConfirm.Parser, new[]{ "FileLenght", "ContentType", "FileName", "TaskID", "PackSize", "PackCount", "FileHash" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_FilePushConfirm_RESP), global::AxibugProtobuf.Protobuf_TcpP2P_FilePushConfirm_RESP.Parser, new[]{ "TaskID", "Agree" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_FilePush), global::AxibugProtobuf.Protobuf_TcpP2P_FilePush.Parser, new[]{ "TaskID", "PackIndex", "FileData", "PackLenght" }, null, null, null, null), + new pbr::GeneratedClrTypeInfo(typeof(global::AxibugProtobuf.Protobuf_TcpP2P_FilePush_RESP), global::AxibugProtobuf.Protobuf_TcpP2P_FilePush_RESP.Parser, new[]{ "TaskID", "FinishIndex" }, null, null, null, null) })); } #endregion @@ -1093,6 +1106,1141 @@ namespace AxibugProtobuf { } + /// + ///TCPP2P文件传输 确认 + /// + public sealed partial class Protobuf_TcpP2P_FilePushConfirm : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_TcpP2P_FilePushConfirm()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufTcpTunnelReflection.Descriptor.MessageTypes[5]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm(Protobuf_TcpP2P_FilePushConfirm other) : this() { + fileLenght_ = other.fileLenght_; + contentType_ = other.contentType_; + fileName_ = other.fileName_; + taskID_ = other.taskID_; + packSize_ = other.packSize_; + packCount_ = other.packCount_; + fileHash_ = other.fileHash_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm Clone() { + return new Protobuf_TcpP2P_FilePushConfirm(this); + } + + /// Field number for the "FileLenght" field. + public const int FileLenghtFieldNumber = 1; + private long fileLenght_; + /// + ///文件长度 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long FileLenght { + get { return fileLenght_; } + set { + fileLenght_ = value; + } + } + + /// Field number for the "ContentType" field. + public const int ContentTypeFieldNumber = 2; + private string contentType_ = ""; + /// + ///ContentType + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string ContentType { + get { return contentType_; } + set { + contentType_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "FileName" field. + public const int FileNameFieldNumber = 3; + private string fileName_ = ""; + /// + ///文件名 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string FileName { + get { return fileName_; } + set { + fileName_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "TaskID" field. + public const int TaskIDFieldNumber = 4; + private int taskID_; + /// + ///传输任务ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int TaskID { + get { return taskID_; } + set { + taskID_ = value; + } + } + + /// Field number for the "PackSize" field. + public const int PackSizeFieldNumber = 5; + private int packSize_; + /// + ///每个包大小 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PackSize { + get { return packSize_; } + set { + packSize_ = value; + } + } + + /// Field number for the "PackCount" field. + public const int PackCountFieldNumber = 6; + private long packCount_; + /// + ///包数量 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long PackCount { + get { return packCount_; } + set { + packCount_ = value; + } + } + + /// Field number for the "FileHash" field. + public const int FileHashFieldNumber = 7; + private string fileHash_ = ""; + /// + ///文件hash + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public string FileHash { + get { return fileHash_; } + set { + fileHash_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_TcpP2P_FilePushConfirm); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_TcpP2P_FilePushConfirm other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (FileLenght != other.FileLenght) return false; + if (ContentType != other.ContentType) return false; + if (FileName != other.FileName) return false; + if (TaskID != other.TaskID) return false; + if (PackSize != other.PackSize) return false; + if (PackCount != other.PackCount) return false; + if (FileHash != other.FileHash) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (FileLenght != 0L) hash ^= FileLenght.GetHashCode(); + if (ContentType.Length != 0) hash ^= ContentType.GetHashCode(); + if (FileName.Length != 0) hash ^= FileName.GetHashCode(); + if (TaskID != 0) hash ^= TaskID.GetHashCode(); + if (PackSize != 0) hash ^= PackSize.GetHashCode(); + if (PackCount != 0L) hash ^= PackCount.GetHashCode(); + if (FileHash.Length != 0) hash ^= FileHash.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (FileLenght != 0L) { + output.WriteRawTag(8); + output.WriteInt64(FileLenght); + } + if (ContentType.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ContentType); + } + if (FileName.Length != 0) { + output.WriteRawTag(26); + output.WriteString(FileName); + } + if (TaskID != 0) { + output.WriteRawTag(32); + output.WriteInt32(TaskID); + } + if (PackSize != 0) { + output.WriteRawTag(40); + output.WriteInt32(PackSize); + } + if (PackCount != 0L) { + output.WriteRawTag(48); + output.WriteInt64(PackCount); + } + if (FileHash.Length != 0) { + output.WriteRawTag(58); + output.WriteString(FileHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (FileLenght != 0L) { + output.WriteRawTag(8); + output.WriteInt64(FileLenght); + } + if (ContentType.Length != 0) { + output.WriteRawTag(18); + output.WriteString(ContentType); + } + if (FileName.Length != 0) { + output.WriteRawTag(26); + output.WriteString(FileName); + } + if (TaskID != 0) { + output.WriteRawTag(32); + output.WriteInt32(TaskID); + } + if (PackSize != 0) { + output.WriteRawTag(40); + output.WriteInt32(PackSize); + } + if (PackCount != 0L) { + output.WriteRawTag(48); + output.WriteInt64(PackCount); + } + if (FileHash.Length != 0) { + output.WriteRawTag(58); + output.WriteString(FileHash); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (FileLenght != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(FileLenght); + } + if (ContentType.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(ContentType); + } + if (FileName.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FileName); + } + if (TaskID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TaskID); + } + if (PackSize != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PackSize); + } + if (PackCount != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(PackCount); + } + if (FileHash.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeStringSize(FileHash); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_TcpP2P_FilePushConfirm other) { + if (other == null) { + return; + } + if (other.FileLenght != 0L) { + FileLenght = other.FileLenght; + } + if (other.ContentType.Length != 0) { + ContentType = other.ContentType; + } + if (other.FileName.Length != 0) { + FileName = other.FileName; + } + if (other.TaskID != 0) { + TaskID = other.TaskID; + } + if (other.PackSize != 0) { + PackSize = other.PackSize; + } + if (other.PackCount != 0L) { + PackCount = other.PackCount; + } + if (other.FileHash.Length != 0) { + FileHash = other.FileHash; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + FileLenght = input.ReadInt64(); + break; + } + case 18: { + ContentType = input.ReadString(); + break; + } + case 26: { + FileName = input.ReadString(); + break; + } + case 32: { + TaskID = input.ReadInt32(); + break; + } + case 40: { + PackSize = input.ReadInt32(); + break; + } + case 48: { + PackCount = input.ReadInt64(); + break; + } + case 58: { + FileHash = input.ReadString(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + FileLenght = input.ReadInt64(); + break; + } + case 18: { + ContentType = input.ReadString(); + break; + } + case 26: { + FileName = input.ReadString(); + break; + } + case 32: { + TaskID = input.ReadInt32(); + break; + } + case 40: { + PackSize = input.ReadInt32(); + break; + } + case 48: { + PackCount = input.ReadInt64(); + break; + } + case 58: { + FileHash = input.ReadString(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Protobuf_TcpP2P_FilePushConfirm_RESP : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_TcpP2P_FilePushConfirm_RESP()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufTcpTunnelReflection.Descriptor.MessageTypes[6]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm_RESP() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm_RESP(Protobuf_TcpP2P_FilePushConfirm_RESP other) : this() { + taskID_ = other.taskID_; + agree_ = other.agree_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePushConfirm_RESP Clone() { + return new Protobuf_TcpP2P_FilePushConfirm_RESP(this); + } + + /// Field number for the "TaskID" field. + public const int TaskIDFieldNumber = 1; + private int taskID_; + /// + ///传输任务ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int TaskID { + get { return taskID_; } + set { + taskID_ = value; + } + } + + /// Field number for the "Agree" field. + public const int AgreeFieldNumber = 2; + private int agree_; + /// + ///[0]拒绝 [1]同意 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int Agree { + get { return agree_; } + set { + agree_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_TcpP2P_FilePushConfirm_RESP); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_TcpP2P_FilePushConfirm_RESP other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TaskID != other.TaskID) return false; + if (Agree != other.Agree) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TaskID != 0) hash ^= TaskID.GetHashCode(); + if (Agree != 0) hash ^= Agree.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (Agree != 0) { + output.WriteRawTag(16); + output.WriteInt32(Agree); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (Agree != 0) { + output.WriteRawTag(16); + output.WriteInt32(Agree); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TaskID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TaskID); + } + if (Agree != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(Agree); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_TcpP2P_FilePushConfirm_RESP other) { + if (other == null) { + return; + } + if (other.TaskID != 0) { + TaskID = other.TaskID; + } + if (other.Agree != 0) { + Agree = other.Agree; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + Agree = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + Agree = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + /// + ///TCPP2P文件传输 过程 + /// + public sealed partial class Protobuf_TcpP2P_FilePush : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_TcpP2P_FilePush()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufTcpTunnelReflection.Descriptor.MessageTypes[7]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush(Protobuf_TcpP2P_FilePush other) : this() { + taskID_ = other.taskID_; + packIndex_ = other.packIndex_; + fileData_ = other.fileData_; + packLenght_ = other.packLenght_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush Clone() { + return new Protobuf_TcpP2P_FilePush(this); + } + + /// Field number for the "TaskID" field. + public const int TaskIDFieldNumber = 1; + private int taskID_; + /// + ///传输任务ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int TaskID { + get { return taskID_; } + set { + taskID_ = value; + } + } + + /// Field number for the "PackIndex" field. + public const int PackIndexFieldNumber = 2; + private long packIndex_; + /// + ///文件片 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long PackIndex { + get { return packIndex_; } + set { + packIndex_ = value; + } + } + + /// Field number for the "File_Data" field. + public const int FileDataFieldNumber = 3; + private pb::ByteString fileData_ = pb::ByteString.Empty; + /// + ///文件数量 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public pb::ByteString FileData { + get { return fileData_; } + set { + fileData_ = pb::ProtoPreconditions.CheckNotNull(value, "value"); + } + } + + /// Field number for the "PackLenght" field. + public const int PackLenghtFieldNumber = 4; + private int packLenght_; + /// + ///数据长度 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int PackLenght { + get { return packLenght_; } + set { + packLenght_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_TcpP2P_FilePush); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_TcpP2P_FilePush other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TaskID != other.TaskID) return false; + if (PackIndex != other.PackIndex) return false; + if (FileData != other.FileData) return false; + if (PackLenght != other.PackLenght) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TaskID != 0) hash ^= TaskID.GetHashCode(); + if (PackIndex != 0L) hash ^= PackIndex.GetHashCode(); + if (FileData.Length != 0) hash ^= FileData.GetHashCode(); + if (PackLenght != 0) hash ^= PackLenght.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (PackIndex != 0L) { + output.WriteRawTag(16); + output.WriteInt64(PackIndex); + } + if (FileData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(FileData); + } + if (PackLenght != 0) { + output.WriteRawTag(32); + output.WriteInt32(PackLenght); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (PackIndex != 0L) { + output.WriteRawTag(16); + output.WriteInt64(PackIndex); + } + if (FileData.Length != 0) { + output.WriteRawTag(26); + output.WriteBytes(FileData); + } + if (PackLenght != 0) { + output.WriteRawTag(32); + output.WriteInt32(PackLenght); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TaskID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TaskID); + } + if (PackIndex != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(PackIndex); + } + if (FileData.Length != 0) { + size += 1 + pb::CodedOutputStream.ComputeBytesSize(FileData); + } + if (PackLenght != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(PackLenght); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_TcpP2P_FilePush other) { + if (other == null) { + return; + } + if (other.TaskID != 0) { + TaskID = other.TaskID; + } + if (other.PackIndex != 0L) { + PackIndex = other.PackIndex; + } + if (other.FileData.Length != 0) { + FileData = other.FileData; + } + if (other.PackLenght != 0) { + PackLenght = other.PackLenght; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + PackIndex = input.ReadInt64(); + break; + } + case 26: { + FileData = input.ReadBytes(); + break; + } + case 32: { + PackLenght = input.ReadInt32(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + PackIndex = input.ReadInt64(); + break; + } + case 26: { + FileData = input.ReadBytes(); + break; + } + case 32: { + PackLenght = input.ReadInt32(); + break; + } + } + } + } + #endif + + } + + public sealed partial class Protobuf_TcpP2P_FilePush_RESP : pb::IMessage + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + , pb::IBufferMessage + #endif + { + private static readonly pb::MessageParser _parser = new pb::MessageParser(() => new Protobuf_TcpP2P_FilePush_RESP()); + private pb::UnknownFieldSet _unknownFields; + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pb::MessageParser Parser { get { return _parser; } } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public static pbr::MessageDescriptor Descriptor { + get { return global::AxibugProtobuf.ProtobufTcpTunnelReflection.Descriptor.MessageTypes[8]; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + pbr::MessageDescriptor pb::IMessage.Descriptor { + get { return Descriptor; } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush_RESP() { + OnConstruction(); + } + + partial void OnConstruction(); + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush_RESP(Protobuf_TcpP2P_FilePush_RESP other) : this() { + taskID_ = other.taskID_; + finishIndex_ = other.finishIndex_; + _unknownFields = pb::UnknownFieldSet.Clone(other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public Protobuf_TcpP2P_FilePush_RESP Clone() { + return new Protobuf_TcpP2P_FilePush_RESP(this); + } + + /// Field number for the "TaskID" field. + public const int TaskIDFieldNumber = 1; + private int taskID_; + /// + ///传输任务ID + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int TaskID { + get { return taskID_; } + set { + taskID_ = value; + } + } + + /// Field number for the "FinishIndex" field. + public const int FinishIndexFieldNumber = 2; + private long finishIndex_; + /// + ///完成包数量 + /// + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public long FinishIndex { + get { return finishIndex_; } + set { + finishIndex_ = value; + } + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override bool Equals(object other) { + return Equals(other as Protobuf_TcpP2P_FilePush_RESP); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public bool Equals(Protobuf_TcpP2P_FilePush_RESP other) { + if (ReferenceEquals(other, null)) { + return false; + } + if (ReferenceEquals(other, this)) { + return true; + } + if (TaskID != other.TaskID) return false; + if (FinishIndex != other.FinishIndex) return false; + return Equals(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override int GetHashCode() { + int hash = 1; + if (TaskID != 0) hash ^= TaskID.GetHashCode(); + if (FinishIndex != 0L) hash ^= FinishIndex.GetHashCode(); + if (_unknownFields != null) { + hash ^= _unknownFields.GetHashCode(); + } + return hash; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public override string ToString() { + return pb::JsonFormatter.ToDiagnosticString(this); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void WriteTo(pb::CodedOutputStream output) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + output.WriteRawMessage(this); + #else + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (FinishIndex != 0L) { + output.WriteRawTag(16); + output.WriteInt64(FinishIndex); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(output); + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) { + if (TaskID != 0) { + output.WriteRawTag(8); + output.WriteInt32(TaskID); + } + if (FinishIndex != 0L) { + output.WriteRawTag(16); + output.WriteInt64(FinishIndex); + } + if (_unknownFields != null) { + _unknownFields.WriteTo(ref output); + } + } + #endif + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public int CalculateSize() { + int size = 0; + if (TaskID != 0) { + size += 1 + pb::CodedOutputStream.ComputeInt32Size(TaskID); + } + if (FinishIndex != 0L) { + size += 1 + pb::CodedOutputStream.ComputeInt64Size(FinishIndex); + } + if (_unknownFields != null) { + size += _unknownFields.CalculateSize(); + } + return size; + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(Protobuf_TcpP2P_FilePush_RESP other) { + if (other == null) { + return; + } + if (other.TaskID != 0) { + TaskID = other.TaskID; + } + if (other.FinishIndex != 0L) { + FinishIndex = other.FinishIndex; + } + _unknownFields = pb::UnknownFieldSet.MergeFrom(_unknownFields, other._unknownFields); + } + + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + public void MergeFrom(pb::CodedInputStream input) { + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + input.ReadRawMessage(this); + #else + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + FinishIndex = input.ReadInt64(); + break; + } + } + } + #endif + } + + #if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE + [global::System.Diagnostics.DebuggerNonUserCodeAttribute] + void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) { + uint tag; + while ((tag = input.ReadTag()) != 0) { + switch(tag) { + default: + _unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input); + break; + case 8: { + TaskID = input.ReadInt32(); + break; + } + case 16: { + FinishIndex = input.ReadInt64(); + break; + } + } + } + } + #endif + + } + #endregion } diff --git a/ProtobufCore/proto/protobuf_Auth.proto b/ProtobufCore/proto/protobuf_Auth.proto index a2835f4..e20e3ba 100644 --- a/ProtobufCore/proto/protobuf_Auth.proto +++ b/ProtobufCore/proto/protobuf_Auth.proto @@ -19,6 +19,12 @@ enum CommandID CMD_TCPTUNNEL_DO = 5002; //TCP打洞请求 下行 对应 Protobuf_TcpTunnel_DoTunnel | Protobuf_TcpTunnel_DoTunnel_RESP CMD_TCP_P2P_CHAT = 10001; //TCPP2P聊天 Protobuf_TcpP2P_Chat + + //TCPP2P 文件传输上下行分开 + CMD_TCP_P2P_FILEPUSH_CONFIRM = 11001; //TCPP2文件传输 上行 对应 Protobuf_TcpP2P_FilePushConfirm + CMD_TCP_P2P_FILEPUSH_CONFIRM_RESP = 11002; //TCPP2文件传输 下行 对应 Protobuf_TcpP2P_FilePushConfirm_RESP + CMD_TCP_P2P_FILEPUSH = 11003; //TCPP2文件传输 过程 上行 对应 Protobuf_TcpP2P_FilePush + CMD_TCP_P2P_FILEPUSH_RESP = 11004; //TCPP2文件传输 过程 下行 对应 Protobuf_TcpP2P_FilePush_RESP } enum ErrorCode diff --git a/ProtobufCore/proto/protobuf_TcpTunnel.proto b/ProtobufCore/proto/protobuf_TcpTunnel.proto index fcf042c..3461d2b 100644 --- a/ProtobufCore/proto/protobuf_TcpTunnel.proto +++ b/ProtobufCore/proto/protobuf_TcpTunnel.proto @@ -40,3 +40,38 @@ message Protobuf_TcpP2P_Chat string ChatMsg = 1;//消息 } + +////////////////////////////TCP P2P文件传输////////////////// + +//TCPP2P文件传输 确认 +message Protobuf_TcpP2P_FilePushConfirm +{ + int64 FileLenght = 1;//文件长度 + string ContentType = 2;//ContentType + string FileName = 3;//文件名 + int32 TaskID = 4;//传输任务ID + int32 PackSize = 5;//每个包大小 + int64 PackCount = 6;//包数量 + string FileHash = 7;//文件hash +} + +message Protobuf_TcpP2P_FilePushConfirm_RESP +{ + int32 TaskID = 1;//传输任务ID + int32 Agree = 2;//[0]拒绝 [1]同意 +} + +//TCPP2P文件传输 过程 +message Protobuf_TcpP2P_FilePush +{ + int32 TaskID = 1;//传输任务ID + int64 PackIndex = 2;//文件片 + bytes File_Data = 3;//文件数量 + int32 PackLenght = 4;//数据长度 +} + +message Protobuf_TcpP2P_FilePush_RESP +{ + int32 TaskID = 1;//传输任务ID + int64 FinishIndex = 2;//完成包数量 +} \ No newline at end of file diff --git a/Server/obj/Debug/net7.0/Server.assets.cache b/Server/obj/Debug/net7.0/Server.assets.cache index abe237f..a09d4ed 100644 Binary files a/Server/obj/Debug/net7.0/Server.assets.cache and b/Server/obj/Debug/net7.0/Server.assets.cache differ diff --git a/Server/obj/Debug/net7.0/Server.csproj.FileListAbsolute.txt b/Server/obj/Debug/net7.0/Server.csproj.FileListAbsolute.txt index 84a3a6f..e69de29 100644 --- a/Server/obj/Debug/net7.0/Server.csproj.FileListAbsolute.txt +++ b/Server/obj/Debug/net7.0/Server.csproj.FileListAbsolute.txt @@ -1,22 +0,0 @@ -F:\Sin365\HaoYueTunnel\Server\bin\Debug\net7.0\Server.exe -F:\Sin365\HaoYueTunnel\Server\bin\Debug\net7.0\Server.deps.json -F:\Sin365\HaoYueTunnel\Server\bin\Debug\net7.0\Server.runtimeconfig.json -F:\Sin365\HaoYueTunnel\Server\bin\Debug\net7.0\Server.dll -F:\Sin365\HaoYueTunnel\Server\bin\Debug\net7.0\Server.pdb -F:\Sin365\HaoYueTunnel\Server\bin\Debug\net7.0\Protobuf.dll -F:\Sin365\HaoYueTunnel\Server\bin\Debug\net7.0\ServerCore.dll -F:\Sin365\HaoYueTunnel\Server\bin\Debug\net7.0\HaoYueNet.ServerNetwork.dll -F:\Sin365\HaoYueTunnel\Server\bin\Debug\net7.0\Google.Protobuf.dll -F:\Sin365\HaoYueTunnel\Server\bin\Debug\net7.0\ServerCore.pdb -F:\Sin365\HaoYueTunnel\Server\bin\Debug\net7.0\Protobuf.pdb -F:\Sin365\HaoYueTunnel\Server\obj\Debug\net7.0\Server.csproj.AssemblyReference.cache -F:\Sin365\HaoYueTunnel\Server\obj\Debug\net7.0\Server.GeneratedMSBuildEditorConfig.editorconfig -F:\Sin365\HaoYueTunnel\Server\obj\Debug\net7.0\Server.AssemblyInfoInputs.cache -F:\Sin365\HaoYueTunnel\Server\obj\Debug\net7.0\Server.AssemblyInfo.cs -F:\Sin365\HaoYueTunnel\Server\obj\Debug\net7.0\Server.csproj.CoreCompileInputs.cache -F:\Sin365\HaoYueTunnel\Server\obj\Debug\net7.0\Server.csproj.CopyComplete -F:\Sin365\HaoYueTunnel\Server\obj\Debug\net7.0\Server.dll -F:\Sin365\HaoYueTunnel\Server\obj\Debug\net7.0\refint\Server.dll -F:\Sin365\HaoYueTunnel\Server\obj\Debug\net7.0\Server.pdb -F:\Sin365\HaoYueTunnel\Server\obj\Debug\net7.0\Server.genruntimeconfig.cache -F:\Sin365\HaoYueTunnel\Server\obj\Debug\net7.0\ref\Server.dll diff --git a/ServerCore/obj/Debug/net7.0/ServerCore.assets.cache b/ServerCore/obj/Debug/net7.0/ServerCore.assets.cache index d6aa0d3..5694e5d 100644 Binary files a/ServerCore/obj/Debug/net7.0/ServerCore.assets.cache and b/ServerCore/obj/Debug/net7.0/ServerCore.assets.cache differ diff --git a/ServerCore/obj/Debug/net7.0/ServerCore.csproj.FileListAbsolute.txt b/ServerCore/obj/Debug/net7.0/ServerCore.csproj.FileListAbsolute.txt index 920fdb7..e69de29 100644 --- a/ServerCore/obj/Debug/net7.0/ServerCore.csproj.FileListAbsolute.txt +++ b/ServerCore/obj/Debug/net7.0/ServerCore.csproj.FileListAbsolute.txt @@ -1,17 +0,0 @@ -F:\Sin365\HaoYueTunnel\ServerCore\bin\Debug\net7.0\ServerCore.deps.json -F:\Sin365\HaoYueTunnel\ServerCore\bin\Debug\net7.0\ServerCore.dll -F:\Sin365\HaoYueTunnel\ServerCore\bin\Debug\net7.0\ServerCore.pdb -F:\Sin365\HaoYueTunnel\ServerCore\bin\Debug\net7.0\Google.Protobuf.dll -F:\Sin365\HaoYueTunnel\ServerCore\bin\Debug\net7.0\HaoYueNet.ServerNetwork.dll -F:\Sin365\HaoYueTunnel\ServerCore\bin\Debug\net7.0\Protobuf.dll -F:\Sin365\HaoYueTunnel\ServerCore\bin\Debug\net7.0\Protobuf.pdb -F:\Sin365\HaoYueTunnel\ServerCore\obj\Debug\net7.0\ServerCore.csproj.AssemblyReference.cache -F:\Sin365\HaoYueTunnel\ServerCore\obj\Debug\net7.0\ServerCore.GeneratedMSBuildEditorConfig.editorconfig -F:\Sin365\HaoYueTunnel\ServerCore\obj\Debug\net7.0\ServerCore.AssemblyInfoInputs.cache -F:\Sin365\HaoYueTunnel\ServerCore\obj\Debug\net7.0\ServerCore.AssemblyInfo.cs -F:\Sin365\HaoYueTunnel\ServerCore\obj\Debug\net7.0\ServerCore.csproj.CoreCompileInputs.cache -F:\Sin365\HaoYueTunnel\ServerCore\obj\Debug\net7.0\ServerCore.csproj.CopyComplete -F:\Sin365\HaoYueTunnel\ServerCore\obj\Debug\net7.0\ServerCore.dll -F:\Sin365\HaoYueTunnel\ServerCore\obj\Debug\net7.0\refint\ServerCore.dll -F:\Sin365\HaoYueTunnel\ServerCore\obj\Debug\net7.0\ServerCore.pdb -F:\Sin365\HaoYueTunnel\ServerCore\obj\Debug\net7.0\ref\ServerCore.dll