HandleResult OnReceive(IntPtr connId, int length) { //针对同一连接的数据它是同步的,针对不同连接才是异步执行。 //根据数据库中的配置参数来控制拆包解包规则。 try { if (IsUnpack == 0) { //不启用拆包 IntPtr recivebuffer = Marshal.AllocHGlobal(length); if (_server.Fetch(connId, recivebuffer, length) == FetchResult.Ok) { byte[] sendBytes = new byte[length]; Marshal.Copy(recivebuffer, sendBytes, 0, length); Marshal.FreeHGlobal(recivebuffer);//释放申请的内存空间 return(HandleDeviceMessage(sendBytes, length, connId)); } } else { int reallength = 0; int bytesRead = 0;//包大小 if (GetDataLength(connId, ref reallength)) { while (length >= reallength + HeadSize) { length = length - reallength - HeadSize; IntPtr recivebuffer = Marshal.AllocHGlobal(reallength + HeadSize); //Fetch从数据包中捞出数据,改变缓存数据大小 if (_server.Fetch(connId, recivebuffer, reallength + HeadSize) == FetchResult.Ok) { //上面可以加配置,来控制该设备是否启用线程池处理数据或是启用单线程处理。 //使用线程池不会出现length缓存区溢出的情况。 byte[] sendBytes = new byte[reallength + HeadSize]; bytesRead = sendBytes.Length; Marshal.Copy(recivebuffer, sendBytes, 0, bytesRead); Marshal.FreeHGlobal(recivebuffer);//释放申请的内存空间 //return HandleDeviceMessage(sendBytes, bytesRead, connId); var result = _smartThreadPool.QueueWorkItem(() => { return(HandleDeviceMessage(sendBytes, bytesRead, connId)); }); } GetDataLength(connId, ref reallength); } } } return(HandleResult.Ok); } catch (Exception e) { WriteDeviceLog.WriteLog("Log\\" + _name + "\\OnReceiveError", e.ToString(), Guid.NewGuid().ToString()); return(HandleResult.Error); } }
private void Server_OnReceive(int arg1, int arg2) { //int aaa = server.GetAttached<int>(arg1); //Console.WriteLine($"Pull已接收:{arg1} 长度:{arg2}"); byte[] data = server.Fetch(arg1, server.GetLength(arg1)); server.Send(arg1, data, 0, data.Length); }
private HandleResult server_OnReceive(IServer sender, IntPtr connId, int length) { //string recievedStr = Encoding.Default.GetString(data); byte[] data; server.Fetch(connId, length, out data); RecvPkg pkg = new RecvPkg((uint)connId, data); receiveThreadPool.Submit(AnalyseReciveData, pkg, -1); #if DEBUG Console.WriteLine(string.Format("收到连接ID:{0} 的信息,长度:{1},内容:{2}", connId, length, BitConverter.ToString(data))); #endif return(HandleResult.Ok); }
private HandleResult Server_OnReceive(IntPtr connId, int length) { if (count == 0) { now = DateTime.Now.ToString("yyyyMMddhhmmss"); } if (!Directory.Exists(path + now)) { Directory.CreateDirectory(path + now); dwfFile = path + now + "\\" + now + ".dwf"; jpgFile = dwfFile.Replace(".dwf", ".jpg"); dwgFile = dwfFile.Replace(".dwf", ".dwg"); } #region 收数据 // 需要长度 int required = pkgInfo.Length; // 剩余大小 int remain = length; while (remain >= required) { IntPtr bufferPtr = IntPtr.Zero; try { remain -= required; bufferPtr = Marshal.AllocHGlobal(required); if (server.Fetch(ID, bufferPtr, required) == FetchResult.Ok) { if (pkgInfo.IsHeader == true) { PkgHeader header = (PkgHeader)Marshal.PtrToStructure(bufferPtr, typeof(PkgHeader)); required = header.BodySize; } else { //intptr转byte[] byte[] bytes = new byte[required]; Marshal.Copy(bufferPtr, bytes, 0, required); using (var fs = new FileStream(dwfFile, FileMode.Create)) { fs.Write(bytes, 0, bytes.Length); fs.Close(); } required = pkgHeaderSize; } // 在后面赋值,因为前面需要用到pkgInfo.Length pkgInfo.IsHeader = !pkgInfo.IsHeader; pkgInfo.Length = required; if (server.SetExtra(ID, pkgInfo) == false) { return(HandleResult.Error); } } } catch { return(HandleResult.Error); } finally { if (bufferPtr != IntPtr.Zero) { Marshal.FreeHGlobal(bufferPtr); bufferPtr = IntPtr.Zero; } } } #endregion if (count == 0) { Application.Idle += Application_Idle; count = 1; } return(HandleResult.Ok); }
private HandleResult Server_OnReceive(IntPtr connId, int length) { if (!Directory.Exists(path)) { Directory.CreateDirectory(path); } #region 收数据 // 需要长度 int required = pkgInfo.Length; // 剩余大小 int remain = length; while (remain >= required) { IntPtr bufferPtr = IntPtr.Zero; try { remain -= required; bufferPtr = Marshal.AllocHGlobal(required); if (server.Fetch(connId, bufferPtr, required) == FetchResult.Ok) { if (pkgInfo.IsHeader == true) { PkgHeader header = (PkgHeader)Marshal.PtrToStructure(bufferPtr, typeof(PkgHeader)); required = header.BodySize; } else { //intptr转byte[] byte[] bytes = new byte[required]; Marshal.Copy(bufferPtr, bytes, 0, required); using (var fs = new FileStream(rvtName, FileMode.Create)) { fs.Write(bytes, 0, bytes.Length); fs.Close(); } required = pkgHeaderSize; } // 在后面赋值,因为前面需要用到pkgInfo.Length pkgInfo.IsHeader = !pkgInfo.IsHeader; pkgInfo.Length = required; if (server.SetExtra(connId, pkgInfo) == false) { return(HandleResult.Error); } } } catch { return(HandleResult.Error); } finally { if (bufferPtr != IntPtr.Zero) { Marshal.FreeHGlobal(bufferPtr); bufferPtr = IntPtr.Zero; } } } #endregion return(HandleResult.Ok); }
private void Server_OnReceive(Guid arg1, int arg2) { int aaa = server.GetAttached <int>(arg1); //Console.WriteLine($"Pull已接收:{arg1} 长度:{arg2}"); byte[] buffer = server.Fetch(arg1, server.GetLength(arg1)); if (arg2 > 4) { server.Decode(arg1, buffer, arg2); CMD_DATA cmd_head = new CMD_DATA(); cmd_head.key = buffer[0]; cmd_head.CMDID = System.BitConverter.ToInt16(buffer, 2); if (cmd_head.CMDID == 0x100) // 请求客户端版本号 { DebugLog.Show("客户端版本号" + buffer[11].ToString() + "." + buffer[13].ToString() + "." + buffer[15].ToString() + "." + buffer[17].ToString().ToString()); } else if (cmd_head.CMDID == 0x90) // 请求登陆 { int textLen = buffer[7]; int splitIndex = 0; for (int i = 0; i < arg2 - 8; i++) { if (buffer[8 + i] == 0x0) { splitIndex = 8 + i; break; } } string account = Encoding.UTF8.GetString(buffer, 8, splitIndex - 8); string password = Encoding.UTF8.GetString(buffer, splitIndex + 1, arg2 - splitIndex - 2); DebugLog.Show("玩家登陆 帐号" + account + ",密码:" + password); CMD_SERVER_LIST cmd = new CMD_SERVER_LIST(); byte[] cmd_data = cmd.SetServerStatus("KK开发服", "[33m空闲", "[2;37;0m"); server.Send(arg1, cmd_data, 0, cmd_data.Length); } else if (cmd_head.CMDID == 0x0690) // 帐号属性 { CMD_ACCOUNT_STATUS cmd = new CMD_ACCOUNT_STATUS(); // 点数和可创建角色数 byte[] cmd_data = cmd.SetAccountStatus(32767, 255); server.Send(arg1, cmd_data, 0, cmd_data.Length); CMD_ROLE_LIST cmd_role = new CMD_ROLE_LIST(); // 点数和可创建角色数 byte[] cmd_role_data = cmd_role.SetRoleName("ruby"); server.Send(arg1, cmd_role_data, 0, cmd_role_data.Length); } else if (cmd_head.CMDID == 0x0290) // 登陆角色 { string roleid = Encoding.UTF8.GetString(buffer, 8, buffer[7]); DebugLog.Show("玩家登陆 角色" + roleid); // 登陆游戏包,无需修改任何东西 byte[] data1 = { 0x00, 0x01, 0x70, 0x03, 0x00, 0x00, 0x00, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; server.Send(arg1, data1, 0, data1.Length); // 频道包(内屏) byte[] data2 = { 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x74, 0x65, 0x6c, 0x6c, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x63, 0x68, 0x61, 0x74, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x10, 0x72, 0x75, 0x6d, 0x6f, 0x72, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0e, 0x61, 0x75, 0x63, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x10, 0x70, 0x61, 0x72, 0x74, 0x79, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x12, 0x6b, 0x69, 0x6e, 0x67, 0x64, 0x6f, 0x6d, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x00 }; server.Send(arg1, data2, 0, data2.Length); // 公屏包(包括装备) byte[] data3 = { 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0e, 0x6f, 0x72, 0x67, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x11, 0x73, 0x79, 0x73, 0x74, 0x65, 0x6d, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x10, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x68, 0x65, 0x72, 0x6f, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x66, 0x72, 0x65, 0x65, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0d, 0x61, 0x64, 0x5f, 0x63, 0x68, 0x61, 0x6e, 0x6e, 0x65, 0x6c, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x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x00, 0x1f, 0x00, 0x00, 0x00, 0x02, 0x01, 0x0f, 0x00, 0x01, 0x00, 0x1e, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00, 0x09, 0x00, 0x48, 0x00, 0xc7, 0x00, 0x00, 0x0b, 0xb8, 0x01, 0x00, 0x01, 0x00, 0x0c, 0x00, 0x00, 0x00, 0x04, 0x00, 0x80, 0x00, 0x00, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x0d, 0xe9, 0x95, 0xb7, 0xe5, 0x8a, 0x8d, 0x00, 0x10, 0x00, 0x00, 0x0a, 0x00, 0x18, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x10, 0xe7, 0xb2, 0x97, 0xe5, 0xb8, 0x83, 0xe9, 0x9e, 0x8b, 0x00, 0x10, 0x00, 0x10, 0x09, 0x00, 0x18, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x10, 0xe6, 0xa3, 0x89, 0xe5, 0xb8, 0x83, 0xe8, 0xa1, 0xa3, 0x00, 0x10, 0x00, 0x00, 0x03, 0x00, 0x18, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x16, 0xe4, 0xba, 0x8c, 0xe5, 0xa1, 0x8a, 0xe8, 0x9c, 0xa5, 0xe8, 0x9c, 0xb4, 0xe4, 0xb9, 0xbe, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x18, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1c, 0xe6, 0x9c, 0x88, 0xe7, 0xa5, 0x9e, 0xe5, 0x8c, 0xba, 0x31, 0x30, 0x77, 0xe7, 0xbb, 0x8f, 0xe9, 0xaa, 0x8c, 0xe9, 0x95, 0x96, 0x00, 0x00, 0x00, 0x20, 0x16, 0x00, 0x18, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x13, 0xe4, 0xb8, 0x80, 0xe7, 0xbd, 0x90, 0xe8, 0x97, 0xa5, 0xe8, 0x86, 0x8f, 0x00, 0x00, 0x00, 0x00, 0x1f, 0x00, 0x18, 0x00, 0x01, 0x00, 0x0b, 0x00, 0x00, 0x00, 0x1c, 0xe9, 0x8c, 0xa2, 0xe5, 0x8c, 0x85, 0x20, 0x28, 0xe8, 0x99, 0x9b, 0xe7, 0xa9, 0xba, 0xe5, 0x95, 0x86, 0xe5, 0x9f, 0x8e, 0x29, 0x00, 0x00, 0x00, 0x00, 0x23, 0x00, 0x18, 0x00, 0x01, 0x00, 0x18, 0x00, 0x00, 0x00, 0x0a, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x5f, 0x69, 0x64, 0x00, 0x01 }; server.Send(arg1, data3, 0, data3.Length); // 界面包(角色名称,属性等) byte[] data4 = { 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0f, 0x77, 0x65, 0x61, 0x70, 0x6f, 0x6e, 0x5f, 0x63, 0x6c, 0x61, 0x73, 0x73, 0x00, 0x00, 0x07, 0x00, 0x01, 0x00, 0x0f, 0x00, 0x00, 0x00, 0x0d, 0x6d, 0x61, 0x78, 0x5f, 0x64, 0x61, 0x6d, 0x61, 0x67, 0x65, 0x00, 0x00, 0x09, 0x00, 0x01, 0x00, 0x06, 0x00, 0x00, 0x03, 0x8b, 0x00, 0x48, 0x00, 0xc7, 0x6e, 0x65, 0x77, 0x62, 0x69, 0x65, 0x33, 0x20, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74, 0x00, 0x00, 0x64, 0x00, 0xc8, 0x00, 0x00, 0x00, 0xdc, 0x00, 0x00, 0x24, 0x08, 0x00, 0x00, 0x02, 0x4c, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x02, 0x0c, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x21, 0x10, 0x00, 0x00, 0x21, 0x54, 0x00, 0x00, 0x24, 0x48, 0x00, 0x00, 0x02, 0x24, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x21, 0x4c, 0x00, 0x00, 0x02, 0x34, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, 0x02, 0x5c, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x44, 0x00, 0x00, 0x24, 0x14, 0x00, 0x00, 0x21, 0x24, 0x00, 0x00, 0x24, 0x5c, 0x00, 0x00, 0x02, 0x50, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x21, 0x4c, 0x00, 0x00, 0x02, 0x34, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x02, 0x0c, 0x00, 0x00, 0x02, 0x38, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x02, 0x2c, 0x00, 0x00, 0x02, 0x34, 0x00, 0x00, 0x02, 0x38, 0x00, 0x00, 0x02, 0x5c, 0x00, 0x00, 0x24, 0x3c, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x02, 0x5c, 0x00, 0x00, 0x02, 0x24, 0x00, 0x00, 0x02, 0x54, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x5c, 0x00, 0x00, 0x02, 0x48, 0x00, 0x00, 0x02, 0x14, 0x00, 0x00, 0x02, 0x44, 0x00, 0x00, 0x02, 0x50, 0x00, 0x00, 0x02, 0x4c, 0x00, 0x00, 0x02, 0x4c, 0x00, 0x00, 0x02, 0x30, 0x00, 0x00, 0x02, 0x28, 0x00, 0x00, 0x02, 0x14, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x02, 0x3c, 0x00, 0x00, 0x02, 0x10, 0x00, 0x00, 0x02, 0x40, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x02, 0x3c, 0x00, 0x00, 0x02, 0x14, 0x00, 0x00, 0x02, 0x58, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x02, 0x50, 0x00, 0x00, 0x02, 0x18, 0x00, 0x00, 0x02, 0x5c, 0x00, 0x00, 0x02, 0x38, 0x00, 0x00, 0x02, 0x1c, 0x00, 0x00, 0x02, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x05, 0x00, 0x00, 0x00, 0x4b, 0x00, 0x48, 0x00, 0xc7, 0x02, 0xe5, 0x9c, 0xa3, 0xe9, 0xaa, 0x91, 0x1b, 0x5b, 0x32, 0x3b, 0x33, 0x37, 0x3b, 0x30, 0x6d, 0x00, 0xe7, 0x99, 0xbd, 0xe5, 0x85, 0x94, 0x00, 0x72, 0x61, 0x62, 0x62, 0x69, 0x74, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x03, 0x00, 0x00 }; server.Send(arg1, data4, 0, data4.Length); // 最终登陆包(职业,公屏信息等) byte[] data5 = { 0x00, 0x01, 0x00, 0x00, 0x10, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x14, 0x00, 0x00, 0x00, 0x09, 0x00, 0x48, 0x00, 0xc7, 0x00, 0x00, 0x07, 0xd0, 0x04, 0x00, 0x01, 0x00, 0x23, 0x00, 0x00, 0x00, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0a, 0x00, 0x00, 0x00, 0x55, 0x00, 0x48, 0x00, 0xc7, 0xe4, 0xba, 0xba, 0xe9, 0xa1, 0x9e, 0x00, 0xe7, 0x94, 0xb7, 0xe6, 0x80, 0xa7, 0x00, 0xe6, 0x88, 0xb0, 0xe5, 0xa3, 0xab, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x13, 0x00, 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0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e9, 0x9b, 0x99, 0xe6, 0x93, 0x8a, 0xe8, 0x83, 0x8c, 0xe5, 0x8c, 0x85, 0xe4, 0xb8, 0xad, 0xe7, 0x9a, 0x84, 0xe9, 0x8c, 0xa2, 0xe5, 0x8c, 0x85, 0xe5, 0x8f, 0xaf, 0xe9, 0x80, 0xb2, 0xe5, 0x85, 0xa5, 0xe8, 0x99, 0x9b, 0xe7, 0xa9, 0xba, 0xe5, 0x95, 0x86, 0xe5, 0x9f, 0x8e, 0x29, 0x1b, 0x5b, 0x32, 0x3b, 0x33, 0x37, 0x3b, 0x30, 0x6d, 0x00 }; server.Send(arg1, data5, 0, data5.Length); } else if (cmd_head.CMDID == 0x0b80) // 角色移动 { byte[] data1 = { 0x00, 0x01, 0x00, 0x03, 0x00, 0x00, 0x00, 0x55, 0x00, 0x00, 0x00, 0x00, 0x14, 0x00, 0x00, 0x02, 0x4c, 0x00, 0x00, 0x02, 0x34, 0x00, 0x00, 0x02, 0x34, 0x00, 0x00, 0x02, 0x08, 0x00, 0x00, 0x02, 0x50, 0x00, 0x00, 0x02, 0x3c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x24, 0x00, 0x00, 0x00, 0x11, 0x01, 0x00, 0x3f, 0x00, 0xc6, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 }; server.Send(arg1, data1, 0, data1.Length); } else { DebugLog.Show("接收 CMDID:" + cmd_head.CMD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xb8, 0x85, 0xe9, 0x99, 0xa4, 0xe6, 0x82, 0xa8, 0xe7, 0x9a, 0x84, 0x44, 0x4e, 0x53, 0xe7, 0xb7, 0xa9, 0xe5, 0xad, 0x98, 0x0a, 0x20, 0x20, 0x20, 0x43, 0x3a, 0x5c, 0x3e, 0x69, 0x70, 0x63, 0x6f, 0x6e, 0x66, 0x69, 0x67, 0x20, 0x2f, 0x66, 0x6c, 0x75, 0x73, 0x68, 0x64, 0x6e, 0x73, 0x0a, 0x00 }; //server.Encode(arg1, notice, notice.Length); //server.Send(arg1, notice, 0, notice.Length); } //server.Send(arg1, data, 0, data.Length); }