public static TCPProcessCmdResults ProcessMarryInit(TCPManager tcpMgr, TMSKSocket socket, TCPClientPool tcpClientPool, TCPRandKey tcpRandKey, TCPOutPacketPool pool, int nID, byte[] data, int count, out TCPOutPacket tcpOutPacket) { string cmdData = null; try { cmdData = new UTF8Encoding().GetString(data, 0, count); } catch (Exception) { LogManager.WriteLog(LogTypes.Error, string.Format("解析指令字符串错误, CMD={0}, Client={1}", (TCPGameServerCmds)nID, Global.GetSocketRemoteEndPoint(socket, false)), null, true); tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, "", nID); return(TCPProcessCmdResults.RESULT_FAILED); } try { string[] fields = cmdData.Split(new char[] { ':' }); if (fields.Length != 2) { LogManager.WriteLog(LogTypes.Error, string.Format("指令参数个数错误, CMD={0}, Client={1}, Recv={2}", (TCPGameServerCmds)nID, Global.GetSocketRemoteEndPoint(socket, false), fields.Length), null, true); tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, "", nID); return(TCPProcessCmdResults.RESULT_FAILED); } int roleID = Convert.ToInt32(fields[0]); int spouseID = Convert.ToInt32(fields[1]); GameClient client = GameManager.ClientMgr.FindClient(socket); if (KuaFuManager.getInstance().ClientCmdCheckFaild(nID, client, ref roleID)) { LogManager.WriteLog(LogTypes.Error, string.Format("根据RoleID定位GameClient对象失败, CMD={0}, Client={1}, RoleID={2}", (TCPGameServerCmds)nID, Global.GetSocketRemoteEndPoint(socket, false), roleID), null, true); tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, "", nID); return(TCPProcessCmdResults.RESULT_FAILED); } if (client.ClientSocket.IsKuaFuLogin) { client.sendCmd(nID, string.Format("{0}:{1}:{2}", -12, roleID, spouseID), false); tcpOutPacket = null; return(TCPProcessCmdResults.RESULT_OK); } MarryResult result = MarryLogic.MarryInit(client, spouseID); string strcmd = string.Format("{0}:{1}:{2}", (int)result, roleID, spouseID); tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, strcmd, nID); return(TCPProcessCmdResults.RESULT_DATA); } catch (Exception ex) { DataHelper.WriteFormatExceptionLog(ex, Global.GetDebugHelperInfo(socket), false, false); } tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, "", nID); return(TCPProcessCmdResults.RESULT_FAILED); }