Beispiel #1
0
        /// <summary>
        /// 解封用户
        /// </summary>
        public static int ACCOUNT_OPEN(string serverIP, int usersn, string userNick, string userName, int userbyid, string Reason, ref string strDesc)
        {
            int    result = -1;
            string sql    = null;

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 8);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_ACCOUNT_OPEN' and sql_condition = 'JW2_ACCOUNT_OPEN'";
                System.Data.DataSet ds = SqlHelper.ExecuteDataset(sql);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    sql    = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                    sql    = string.Format(sql, usersn);
                    result = MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2loginDB), sql);
                }
                if (result == 1)
                {
                    strDesc = lg.JW2API_ACCOUNTOPEN + userName.ToString() + lg.JW2API_PlayerSN + userNick.ToString() + lg.JW2API_Success;
                    result  = CommonInfo.JW2_UnBanUser(serverIP, userbyid, usersn, userName, Reason);
                    SqlHelper.insertGMtoolsLog(userbyid, "JW2", serverIP, "JW2_ACCOUNT_OPEN", lg.JW2API_ACCOUNTOPEN + userName.ToString() + lg.JW2API_Success);
                }
                else
                {
                    strDesc = lg.JW2API_ACCOUNTOPEN + userName.ToString() + lg.JW2API_PlayerSN + userNick.ToString() + lg.JW2API_Failure;
                    result  = CommonInfo.JW2_UnBanUser(serverIP, userbyid, usersn, userName, Reason);
                    SqlHelper.insertGMtoolsLog(userbyid, "JW2", serverIP, "JW2_ACCOUNT_OPEN", lg.JW2API_ACCOUNTOPEN + userName.ToString() + lg.JW2API_Failure);
                }
            }
            catch (System.Exception ex)
            {
                strDesc = lg.JW2API_DatebaseConnectError;
                SqlHelper.errLog.WriteLog("ServerIP" + serverIP + ex.Message);
            }
//			catch (MySqlException  ex)
//			{
//				strDesc = "数据库连接失败,请重新尝试!";
//				SqlHelper.errLog.WriteLog("服务器IP"+serverIP+ex.Message);
//			}
            return(result);
        }