Exemplo n.º 1
0
        /// <summary>
        /// 踢用户下线
        /// </summary>
        public static int BANISHPLAYER(string serverIP, string userName, int userbyid, ref string strDesc)
        {
            int    result = -1;
            string sql    = null;

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 5);
                string usby = "0";
                result = BanishPlayer(serverIP, userName);
                if (result == 0)
                {
                    strDesc = lg.JW2API_BANISHPLAYER + userName.ToString() + lg.JW2API_SuccessPleaseWait;
                    SqlHelper.insertGMtoolsLog(userbyid, "jw2", serverIP, "JW2_BanishPlayer", lg.JW2API_BANISHPLAYER + userName.ToString() + lg.JW2API_Success);
                }
                else
                {
                    strDesc = lg.JW2API_BANISHPLAYER + userName.ToString() + lg.JW2API_Failure;
                    SqlHelper.insertGMtoolsLog(userbyid, "jw2", serverIP, "JW2_BanishPlayer", lg.JW2API_BANISHPLAYER + userName.ToString() + lg.JW2API_Failure);
                }
            }
            catch (System.Exception ex)
            {
                strDesc = lg.JW2API_DatebaseConnectError;
                SqlHelper.errLog.WriteLog("ServerIP" + serverIP + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 修改家族名
        /// </summary>
        public static int UpdatePetName_Query(string serverIP, string OLD_petName, string petName, int userByID, int petID, ref string strDesc)
        {
            int    result = -1;
            string sql    = null;

            try
            {
                //修改等级1
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 10);               //9);//maple
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_UpdatePETName_Query' and sql_condition = 'JW2_UpdatePETName_Query'";
                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, petID, petName);
                    result = MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2itemDB), sql);
                }
                if (result == 1)
                {
                    strDesc = "修改宠物名【" + OLD_petName + "】为新宠物名【" + petName + "】成功,请稍等,系统处理中!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_UpdatePETName_Query", "修改宠物名:" + OLD_petName.ToString() + ",为新宠物名:" + petName.ToString() + ",成功");
                }
                else
                {
                    strDesc = "修改宠物名【" + OLD_petName + "】为新宠物名【" + petName + "】失败,请确定游戏中宠物是否存在!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_UpdatePETName_Query", "修改宠物名:" + OLD_petName.ToString() + ",为新宠物名:" + OLD_petName.ToString() + ",失败");
                }
            }
            catch (MySqlException ex)
            {
                strDesc = "数据库连接失败,请稍后尝试!";
                SqlHelper.errLog.WriteLog("劲舞团2_UpdatePetName_Query修改宠物名【" + OLD_petName + "】为新宠物名【" + petName + "】" + serverIP + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 修改金钱
        /// </summary>
        public static int MODIFY_MONEY(string serverIP, int usersn, int iMoney, int userByID, string UserName, ref string strDesc)
        {
            int    result = -1;
            string sql    = null;

            try
            {
                //修改金钱
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 7);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_MODIFY_MONEY' and sql_condition = 'JW2_MODIFY_MONEY'";
                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, iMoney, usersn);
                    result = MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2gameDB), sql);
                }
                if (result == 1)
                {
                    strDesc = "修改玩家:" + UserName.ToString() + ",金钱:" + iMoney.ToString() + ",成功,请稍等,系统处理中!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_MODIFY_MONEY", "修改玩家:" + UserName.ToString() + ",金钱:" + iMoney.ToString() + ",成功(修改金钱,jw2)");
                }
                else
                {
                    strDesc = "修改玩家:" + UserName.ToString() + ",金钱:" + iMoney.ToString() + ",失败,请确认该角色是否存在!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_MODIFY_MONEY", "修改玩家:" + UserName.ToString() + ",金钱:" + iMoney.ToString() + ",失败(修改金钱,jw2)");
                }
            }
            catch (System.Exception ex)
            {
                strDesc = "数据库连接失败,请重新尝试!";
                SqlHelper.errLog.WriteLog("浏览JW2_MODIFY_MONEY_玩家" + usersn.ToString() + "-" + UserName + "修改金钱服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
Exemplo n.º 4
0
        /// <summary>
        /// 修改家族名
        /// </summary>
        public static int UpdateFamilyName_Query(string serverIP, string OLD_familyName, string familyName, int userByID, int familyID)
        {
            int    result = -1;
            string sql    = null;

            try
            {
                //修改等级1
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 9);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_UpdateFamilyName_Query' and sql_condition = 'JW2_UpdateFamilyName_Query'";
                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, familyID, familyName);
                    result = MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2messengerDB), sql);
                }
                if (result == 1)
                {
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_UpdateFamilyName_Query", "修改家族名:" + OLD_familyName.ToString() + ",为新家族名:" + familyName.ToString() + ",成功(修改家族名,jw2)");
                }
                else
                {
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_UpdateFamilyName_Query", "修改家族名:" + OLD_familyName.ToString() + ",为新家族名:" + familyName.ToString() + ",失败(修改家族名,jw2)");
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
Exemplo n.º 5
0
        public static int BanishPlayer(string serverIP, string userName)
        {
            byte[] result     = new byte[255];
            int    handle     = -1;
            int    int_Result = -1;

            try
            {
                handle = JW2_CreateDLL();
                string serverIPStard = CommonInfo.JW2_FindDBIP(serverIP, 5);
                int    state         = JW2_ConnectGW(handle, serverIPStard, 58118);
                if (state == 0)
                {
                    DSNShellUpdate(handle, result);
                    StringBuilder S_UserName = new StringBuilder(userName);
                    int_Result = DSNShellKickUser(handle, S_UserName);
                }
            }
            catch (System.Exception ex)
            {
                string exc = ex.Message;
            }
            finally
            {
                JW2_DestroyDLL(handle);
            }
            return(int_Result);
        }
        /// <summary>
        /// 修改经验
        /// </summary>
        public static int MODIFYEXP_QUERY(string serverIP, int usersn, float iExp, int userByID, string UserName, ref string strDesc)
        {
            int    result = -1;
            string sql    = null;

            try
            {
                //查询等级对应的经验值
                long iLevel = CommonInfo.JW2_ExpToLevel(iExp);
                //修改等级1
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 7);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_MODIFYLEVEL_QUERY1' and sql_condition = 'JW2_MODIFYLEVEL_QUERY1'";
                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, iLevel, usersn);
                    result = MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2gameDB), sql);
                }
                //修改等级2
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 9);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_MODIFYLEVEL_QUERY2' and sql_condition = 'JW2_MODIFYLEVEL_QUERY2'";
                System.Data.DataSet ds1 = SqlHelper.ExecuteDataset(sql);
                if (ds1 != null && ds1.Tables[0].Rows.Count > 0)
                {
                    sql     = ds1.Tables[0].Rows[0].ItemArray[0].ToString();
                    sql     = string.Format(sql, iLevel, usersn);
                    result += MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2messengerDB), sql);
                }

                //修改经验
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 7);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_MODIFYEXP_QUERY' and sql_condition = 'JW2_MODIFYEXP_QUERY'";
                System.Data.DataSet ds2 = SqlHelper.ExecuteDataset(sql);
                if (ds2 != null && ds2.Tables[0].Rows.Count > 0)
                {
                    sql     = ds2.Tables[0].Rows[0].ItemArray[0].ToString();
                    sql     = string.Format(sql, iExp, usersn);
                    result += MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2gameDB), sql);
                }
                if (result == 3)
                {
                    strDesc = "修改玩家:" + UserName.ToString() + ",等级:" + iLevel.ToString() + ",经验:" + iExp.ToString() + ",成功,请稍等,系统处理中!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_MODIFYEXP_QUERY", "修改玩家:" + UserName.ToString() + ",等级:" + iLevel.ToString() + ",经验:" + iExp.ToString() + ",成功(修改经验,jw2)");
                }
                else
                {
                    strDesc = "修改玩家:" + UserName.ToString() + ",等级:" + iLevel.ToString() + ",经验:" + iExp.ToString() + ",失败,请确认该角色是否存在!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_MODIFYEXP_QUERY", "修改玩家:" + UserName.ToString() + ",等级:" + iLevel.ToString() + ",经验:" + iExp.ToString() + ",失败(修改经验,jw2)");
                }
            }
            catch (System.Exception ex)
            {
                strDesc = "数据库连接失败,请重新尝试!";
                SqlHelper.errLog.WriteLog("浏览JW2_MODIFYEXP_QUERY_玩家" + usersn.ToString() + "-" + UserName + "修改经验服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 消费日志
        /// </summary>
        public static DataSet CashMoney_Log(string serverIP, int usersn, int type, string BeginTime, string EndTime)
        {
            DataSet result = null;
            string  sql    = "";

            try
            {
                if (type == 6)
                {
                    int ZoneID = CommonInfo.JW2_ServerIPToZoneID(serverIP);
                    sql = "select sql_statement from sqlexpress where sql_type='JW2_Center_BuyInfo' and sql_condition='JW2_Center_BuyInfo'";
                    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, ZoneID, usersn, BeginTime, EndTime);
                        result = CommonInfo.RunOracle(sql, ZoneID);
                    }
                }
                else if (type == 15)
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 4);
                    sql      = "select sql_statement from sqlexpress where sql_type='jw2_wedding_log_Query' and sql_condition='jw2_wedding_log_Query'";
                    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, type, BeginTime, EndTime);
                        result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2logDB), sql);
                    }
                }
                else
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 4);
                    sql      = "select sql_statement from sqlexpress where sql_type='JW2_CashMoney_Log' and sql_condition='JW2_CashMoney_Log'";
                    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, type, BeginTime, EndTime);
                        result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2logDB), sql);
                    }
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_CashMoney_Log_查看玩家" + usersn.ToString() + "消费日志服务器IP" + serverIP + type.ToString() + "开始时间" + BeginTime + "结束时间" + EndTime + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// GM狀態修改
        /// </summary>
        public static int GM_Update(string serverIP, int usersn, int type, int userByID, string userName, ref string strDesc)
        {
            int    result   = -1;
            string sql      = null;
            string typeName = "";

            try
            {
                switch (type)
                {
                case 0:
                    typeName = "管理员";
                    break;

                case 1:
                    typeName = "普通员";
                    break;

                case 2:
                    typeName = "观察员";
                    break;
                }
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 1);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_GM_Update' and sql_condition = 'JW2_GM_Update'";
                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, type);
                    result = MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2gameDB), sql);
                }
                if (result == 1)
                {
                    strDesc = "修改GM玩家:" + userName.ToString() + ",狀態:" + typeName.ToString() + ",成功,请稍等,系统处理中!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_GM_Update", "修改GM玩家:" + userName.ToString() + ",狀態:" + typeName.ToString() + ",成功(GM状态修改,jw2)");
                }
                else
                {
                    strDesc = "修改GM玩家:" + userName.ToString() + ",狀態:" + typeName.ToString() + ",失败,确认该用户是否存在!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_GM_Update", "修改GM玩家:" + userName.ToString() + ",狀態:" + typeName.ToString() + ",失败(GM状态修改,jw2)");
                }
            }
            catch (MySqlException ex)
            {
                strDesc = "数据库连接失败,请重新尝试!";
                SqlHelper.errLog.WriteLog("服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 重復購買退款
        /// </summary>
        public static int AgainBuy_Query(string serverIP, int buySN, int userSN, int userByID, int cash, string userID, string itemName)
        {
            int    result = -1;
            string sql    = null;

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 8);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_RevBuyCash_Query' and sql_condition = 'JW2_RevBuyCash_Query'";
                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, cash, System.DateTime.Now.ToString());
                    result = MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2loginDB), sql);
                }
                if (result == 1)
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 4);
                    sql      = "select sql_statement from sqlexpress where sql_type='JW2_DELBuyLog_Query' and sql_condition = 'JW2_DELBuyLog_Query'";
                    System.Data.DataSet ds_local = SqlHelper.ExecuteDataset(sql);
                    if (ds_local != null && ds_local.Tables[0].Rows.Count > 0)
                    {
                        sql    = ds_local.Tables[0].Rows[0].ItemArray[0].ToString();
                        sql    = string.Format(sql, buySN);
                        result = MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2logDB), sql);
                    }
                    if (result == 1)
                    {
                        SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_RevBuyCash_Query", "用户:" + userID.ToString() + ",重复购买道具" + itemName.ToString() + "退款M币:" + cash.ToString() + ",成功(重复购买退款,jw2)");
                    }
                    else
                    {
                        SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_RevBuyCash_Query", "用户:" + userID.ToString() + ",重复购买道具" + itemName.ToString() + "退款M币:" + cash.ToString() + ",失败(重复购买退款,jw2)");
                    }
                }
                else
                {
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_RevBuyCash_Query", "用户:" + userID.ToString() + ",重复购买道具" + itemName.ToString() + "退款M币:" + cash.ToString() + ",失败(重复购买退款,jw2)");
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_AgainBuy_Query_查看玩家" + userSN.ToString() + "-" + buySN.ToString() + "重復購買退款服务器IP" + serverIP + "用户名" + userID + "道具名" + itemName + "开始时间" + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 审核图片
        /// </summary>
        public static int CHKPIC_Query(string serverIP, int usersn, int userByID, string UserName, string Url, int type, ref string strDesc)
        {
            int    result   = -1;
            string sql      = null;
            string db       = "";
            string Pic_Name = "";
            string str      = "";

            try
            {
                if (type == 2)
                {
                    str = "审核通过";
                }
                else
                {
                    str = "审核不通过";
                }

                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 10);
                sql      = "select sql_statement from sqlexpress where sql_type='jw2_CHKPIC_Query' and sql_condition='jw2_CHKPIC_Query'";
                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, Url, type);

                    result = MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2itemDB), sql);
                }
                if (result == 1)
                {
                    strDesc = "审核玩家" + UserName.ToString() + "图片" + Url.ToString() + "," + str + ",成功,请稍等,系统处理中!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_MODIFYLEVEL_QUERY", "删除玩家:" + UserName.ToString() + ",道具:" + Url.ToString() + "," + str + ",成功");
                }
                else
                {
                    strDesc = "审核玩家" + UserName.ToString() + "图片" + Url.ToString() + "," + str + ",失败,请游戏中确认此道具是否存在!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_MODIFYLEVEL_QUERY", "审核图片:" + UserName.ToString() + ",道具:" + Url.ToString() + "," + str + ",失败");
                }
            }
            catch (MySqlException ex)
            {
                strDesc = "数据库连接失败,请重新尝试!";
                SqlHelper.errLog.WriteLog("审核图片->JW2_CHKPIC_Query->服务器IP->" + serverIP + "->帐号->" + UserName + "-" + usersn.ToString() + "->图片->" + Url + "->" + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 道具查询
        /// </summary>
        public static DataSet ItemInfo_Query(string serverIP, int usersn, int type)
        {
            DataSet result = null;
            string  sql    = "";
            string  db     = "";

            try
            {
                switch (type)
                {
                case 0:                        //身上
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 2);
                    db       = SqlHelper.jw2itemDB;
                    break;
                }

                case 1:                        //物品栏
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 2);
                    db       = SqlHelper.jw2itemDB;
                    break;
                }

                case 2:                        //礼物栏
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 6);
                    db       = SqlHelper.jw2messengerDB;
                    break;
                }
                }
                sql = "select sql_statement from sqlexpress where sql_type='JW2_ItemInfo_Query" + type + "' and sql_condition='JW2_ItemInfo_Query" + type + "'";
                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.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, db), sql);
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_ItemInfo_Query_查看玩家" + usersn.ToString() + "道具查询服务器IP" + serverIP + type.ToString() + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 查看玩家资料
        /// </summary>
        /// <param name="serverIP">服务器Ip</param>
        /// <param name="account">帐号名</param>
        /// <returns></returns>
        public static DataSet ACCOUNT_QUERY(string serverIP, string strname, ref string strDesc)
        {
            DataSet result     = null;
            string  sql        = "";
            int     zone       = 0;
            string  serverName = "";

            try
            {
                serverName = CommonInfo.JW2_FindDBName(serverIP);
//				zone = CommonInfo.JW2_GetZone_Query(13,serverName);
//				if(serverName=="华北一区"||serverName=="华东一区"||serverName=="华南一区"||serverName=="西南一区")
//				{
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 1);

                sql = "select sql_statement from sqlexpress where sql_type='JW2_ACCOUNT_QUERYBYACCOUNT_bak' and sql_condition='JW2_ACCOUNT_QUERYBYACCOUNT_bak'";
                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, strname);
                    result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2gameDB), sql);
                }
//				}
//				else
//				{
//					sql = "select sql_statement from sqlexpress where sql_type='JW2_ACCOUNT_QUERYBYACCOUNT_ORACLE' and sql_condition='JW2_ACCOUNT_QUERYBYACCOUNT_ORACLE'";
//					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,strname,zone);
//						result = CommonInfo.RunOracle(sql,SqlHelper.oracleData,SqlHelper.oracleUser,SqlHelper.oraclePwd);
//					}
//				}
            }
            catch (MySqlException ex)
            {
                strDesc = "数据库连接失败";
                SqlHelper.errLog.WriteLog("浏览JW2_ACCOUNT_QUERY_玩家" + strname + "信息服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
Exemplo n.º 13
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);
        }
        /// <summary>
        /// 获得服务器GS列表
        /// </summary>
        public static DataSet GSSvererList_Query(string serverIP)
        {
            DataSet result = null;
            string  sql    = "";

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 1);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_GSServerList_Query' and sql_condition='JW2_GSServerList_Query'";
                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();
                    result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2gameDB), sql);
                }
            }
            catch (System.Exception ex)
            {
                Console.WriteLine(ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 圖片卡使用情況
        /// </summary>
        /// <param name="serverIP">服务器Ip</param>
        /// <param name="account">帐号名</param>
        /// <returns></returns>
        public static DataSet PicCard_Query(string serverIP, int BType, int SType, int usersn, string BeginTime, string EndTime)
        {
            DataSet result = null;
            string  sql    = "";
            string  str    = "";

            try
            {
                if (BType == 1)
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 2);
                    sql      = "select sql_statement from sqlexpress where sql_type='jw2_PicCard_Query' and sql_condition='jw2_PicCard_Query'";
                    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, BeginTime, EndTime);
                        result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2itemDB), sql);
                    }
                }
                else if (BType == 2)
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 4);
                    sql      = "select sql_statement from sqlexpress where sql_type='jw2_Garden_Log_Query' and sql_condition='" + SType + "'";
                    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, BeginTime, EndTime);
                        result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2logDB), sql);
                    }
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("获得圖片卡使用情況->JW2_PicCard_Query->服务器IP->" + serverIP + "->帐号->" + usersn.ToString() + "->" + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 查看玩家活跃度
        /// </summary>
        /// <param name="serverIP">服务器Ip</param>
        /// <param name="account">昵称</param>
        /// <returns></returns>
        public static DataSet ACTIVEPOINT_USERNICK_QUERY(string serverIP, string strname, string BeginTime, string EndTime)
        {
            DataSet result = null;
            string  sql    = "";

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 1);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_ACTIVEPOINT_QUERYBYNICKNAME' and sql_condition='JW2_ACTIVEPOINT_QUERYBYNICKNAME'";
                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, strname, BeginTime, EndTime);
                    result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2gameDB), sql);
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_ACTIVEPOINT_USERNICK_QUERY_查看玩家" + strname + "活跃度服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 查看玩家身上道具信息
        /// </summary>
        public static DataSet ITEMSHOP_BYOWNER_QUERY(string serverIP, int usersn)
        {
            DataSet result = null;
            string  sql    = "";

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 2);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_ITEMSHOP_BYOWNER_QUERY' and sql_condition='JW2_ITEMSHOP_BYOWNER_QUERY'";
                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.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2itemDB), sql);
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_ITEMSHOP_BYOWNER_QUERY_查看玩家" + usersn.ToString() + "身上道具信息服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 查看玩家情侣派对卡
        /// </summary>
        /// <param name="serverIP">服务器Ip</param>
        /// <param name="userSN">用户ID</param>
        /// <returns></returns>
        public static DataSet CoupleParty_Card(string serverIP, int userSN)
        {
            DataSet result = null;
            string  sql    = "";

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 1);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_CoupleParty_Card' and sql_condition='JW2_CoupleParty_Card'";
                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.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2gameDB), sql);
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_CoupleParty_Card_查看玩家" + userSN.ToString() + "情侣派对卡服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
Exemplo n.º 19
0
        /// <summary>
        /// 道具日志
        /// </summary>
        public static DataSet Item_Log(string serverIP, int userSN, string BeginTime, string EndTime)
        {
            DataSet result = null;
            string  sql    = "";

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 6);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_Item_Log' and sql_condition='JW2_Item_Log'";
                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, BeginTime, EndTime);
                    result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2messengerDB), sql);
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_Item_Log_查看玩家" + userSN.ToString() + "道具日志查询服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 任务日志查询
        /// </summary>
        public static DataSet MissionInfoLog_Query(string serverIP, int usersn, int type, string BeginTime, string EndTime)
        {
            DataSet result = null;
            string  sql    = "";

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 4);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_MissionInfoLog_Query' and sql_condition='" + type + "'";
                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, type, BeginTime, EndTime);
                    result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2logDB), sql);
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_MissionInfoLog_Query_查看玩家" + usersn.ToString() + "任务日志查询服务器IP" + serverIP + "->" + type.ToString() + "开始时间" + BeginTime + "结束时间" + EndTime + ex.Message);
            }
            return(result);
        }
Exemplo n.º 21
0
        /// <summary>
        /// 查看家族宠物信息
        /// </summary>
        public static DataSet FamilyPet_Query(string serverIP, int FamilyID)
        {
            DataSet result = null;
            string  sql    = "";

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 6);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_Family_Pet_Query' and sql_condition='JW2_Family_Pet_Query'";
                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, FamilyID);
                    result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2messengerDB), sql);
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_FamilyPet_Query_查看家族" + FamilyID.ToString() + "宠物信息服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
Exemplo n.º 22
0
        /// <summary>
        /// 玩家封停帐号信息查询
        /// </summary>
        public static DataSet ACCOUNT_BANISHMENT_QUERY(string serverIP, string userid, int type)
        {
            DataSet result = null;
            string  sql    = "";

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 8);
                if (type == 0)
                {
                    sql = "select sql_statement from sqlexpress where sql_type='JW2_ACCOUNT_BANISHMENT_QUERY_ALL' and sql_condition='JW2_ACCOUNT_BANISHMENT_QUERY_ALL'";
                    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, serverIP);
                        result = SqlHelper.ExecuteDataset(sql);
                    }
                }
                else
                {
                    sql = "select sql_statement from sqlexpress where sql_type='JW2_ACCOUNT_BANISHMENT_QUERY' and sql_condition='JW2_ACCOUNT_BANISHMENT_QUERY'";
                    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, userid, serverIP);
                        result = SqlHelper.ExecuteDataset(sql);
                    }
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("ServerIP" + serverIP + ex.Message);
            }
            return(result);
        }
Exemplo n.º 23
0
        /// <summary>
        /// 查看玩家登陆登出信息
        /// </summary>
        public static DataSet LOGINOUT_QUERY(string serverIP, int usersn, string login_IP, string BeginTime, string EndTime)
        {
            DataSet result = null;
            string  sql    = "";

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 3);
                if (login_IP == "")
                {
                    sql = "select sql_statement from sqlexpress where sql_type='JW2_LOGINOUT_QUERY' and sql_condition='1'";
                    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, BeginTime, EndTime);
                        result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2loginDB), sql);
                    }
                }
                else
                {
                    sql = "select sql_statement from sqlexpress where sql_type='JW2_LOGINOUT_QUERY' and sql_condition='2'";
                    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, login_IP, BeginTime, EndTime);
                        result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2loginDB), sql);
                    }
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_LOGINOUT_QUERY_查看玩家" + usersn.ToString() + "登陆登出信息服务器IP" + serverIP + "登陆ip" + login_IP + "开始时间" + BeginTime + "结束时间" + EndTime + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 查看购物,送礼
        /// </summary>
        public static DataSet SMALL_PRESENT_QUERY(string serverIP, int usersn, int type)
        {
            DataSet result = null;
            string  sql    = "";

            try
            {
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 4);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_SMALL_PRESENT_QUERY' and sql_condition='JW2_SMALL_PRESENT_QUERY'";
                System.Data.DataSet ds = SqlHelper.ExecuteDataset(sql);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    if (type == 1)
                    {
                        sql = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                        sql = string.Format(sql, usersn, "M", "G");
                    }
                    else if (type == 2)
                    {
                        sql = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                        sql = string.Format(sql, usersn, "M", "M");
                    }
                    else if (type == 3)
                    {
                        sql = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                        sql = string.Format(sql, usersn, "G", "G");
                    }

                    result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2logDB), sql);
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_SMALL_PRESENT_QUERY_查看玩家" + usersn.ToString() + "购物,送礼服务器IP" + serverIP + type.ToString() + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 获得需要审核的图片列表
        /// </summary>
        /// <param name="serverIP">服务器Ip</param>
        /// <param name="account">帐号名</param>
        /// <returns></returns>
        public static DataSet GETPIC_Query(string serverIP, string account)
        {
            DataSet result = null;
            string  sql    = "";
            string  str    = "";

            try
            {
                if (account != "")
                {
                    int UserSn = CommonInfo.JW2_Account_UserSn(serverIP, account);
                    str = "and usersn=" + UserSn;
                }
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 2);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_GETPIC_Query_Query' and sql_condition='JW2_GETPIC_Query_Query'";
                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, str);
                    if (serverIP != "114.80.167.192,3306")
                    {
                        result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2itemDB), sql);
                    }
                    else
                    {
                        result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, "gmtools", "E#.92lG^$kd)205K", SqlHelper.jw2itemDB), sql);
                    }
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_GETPIC_Query_查看玩家" + account + "获得需要审核的图片列表服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 删除道具
        /// </summary>
        public static int ITEM_DEL(string serverIP, int usersn, int userByID, string UserName, int itemID, string itemName, int type, int itemNo, ref string strDesc)
        {
            int    result = -1;
            string sql    = null;
            string db     = "";

            try
            {
                switch (type)
                {
                case 0:                        //身上
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 10);
                    db       = SqlHelper.jw2itemDB;
                    break;
                }

                case 1:                        //物品栏
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 10);
                    db       = SqlHelper.jw2itemDB;
                    break;
                }

                case 2:                        //礼物栏
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 9);
                    db       = SqlHelper.jw2messengerDB;
                    break;
                }
                }

                sql = "select sql_statement from sqlexpress where sql_type='JW2_ITEM_DEL" + type + "' and sql_condition='JW2_ITEM_DEL" + type + "'";
                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();
                    if (type == 2)
                    {
                        sql = string.Format(sql, itemNo, itemID, usersn);
                    }
                    else
                    {
                        sql = string.Format(sql, itemID, usersn);
                    }
                    result = MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, db), sql);
                }
                if (result == 1)
                {
                    strDesc = "删除玩家" + UserName.ToString() + "道具" + itemName.ToString() + ",成功,请稍等,系统处理中!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_ITEM_DEL", "删除玩家:" + UserName.ToString() + ",道具:" + itemName.ToString() + ",成功");
                }
                else
                {
                    strDesc = "删除玩家" + UserName.ToString() + "道具" + itemName.ToString() + ",失败,请游戏中确认此道具是否存在!";
                    SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_ITEM_DEL", "删除玩家:" + UserName.ToString() + ",道具:" + itemName.ToString() + ",失败");
                }
            }
            catch (MySqlException ex)
            {
                strDesc = "数据库连接失败,请重新尝试!";
                SqlHelper.errLog.WriteLog("服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
Exemplo n.º 27
0
        /// <summary>
        /// 恢复临时密码
        /// </summary>
        /// <param name="serverIP">服务器Ip</param>
        /// <param name="account">帐号名</param>
        /// <returns></returns>
        public static int ReTmpPassWord_Query(string serverIP, string serverName, int UserByID, int userid, string username, ref string strDesc)
        {
            DataSet ds     = null;
            int     result = -1;
            string  RelPwd = null;
            string  sql    = null;

            try
            {
                //获取本地真实密码
                sql = "select sql_statement from sqlexpress where sql_type='JW2_GetRelPassWord_Query' and sql_condition = 'JW2_GetRelPassWord_Query'";
                System.Data.DataSet ds1 = SqlHelper.ExecuteDataset(sql);
                if (ds1 != null && ds1.Tables[0].Rows.Count > 0)
                {
                    sql = ds1.Tables[0].Rows[0].ItemArray[0].ToString();
                    sql = string.Format(sql, serverName, userid);
                    ds  = SqlHelper.ExecuteDataset(sql);
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        RelPwd = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                        //恢复临时密码
                        serverIP = CommonInfo.JW2_FindDBIP(serverIP, 8);
                        sql      = "select sql_statement from sqlexpress where sql_type='JW2_TmpPassWord_Query' and sql_condition = 'JW2_TmpPassWord_Query'";
                        System.Data.DataSet ds2 = SqlHelper.ExecuteDataset(sql);
                        if (ds2 != null && ds2.Tables[0].Rows.Count > 0)
                        {
                            sql    = ds2.Tables[0].Rows[0].ItemArray[0].ToString();
                            sql    = string.Format(sql, RelPwd, userid);
                            result = MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2loginDB), sql);
                        }
                        if (result == 1)
                        {
                            //更新本地临时密码状态
                            sql = "select sql_statement from sqlexpress where sql_type='JW2_UpdateTmpPassWord_Query' and sql_condition = 'JW2_UpdateTmpPassWord_Query'";
                            System.Data.DataSet ds3 = SqlHelper.ExecuteDataset(sql);
                            if (ds3 != null && ds3.Tables[0].Rows.Count > 0)
                            {
                                sql = ds3.Tables[0].Rows[0].ItemArray[0].ToString();
                                sql = string.Format(sql, serverName, userid, 0);
                                SqlHelper.ExecCommand(sql);
                            }
                        }
                    }
                    else
                    {
                        result = 2;
                    }
                }
                if (result == 1)
                {
                    strDesc = "恢复用户" + username.ToString() + "临时密码成功,请稍等,系统处理中!";
                    SqlHelper.insertGMtoolsLog(UserByID, "劲舞团2", serverIP, "JW2_TmpPassWord_Query", "恢复用户" + username.ToString() + "临时密码,成功(恢复临时密码,jw2)");
                }
                else
                {
                    strDesc = "恢复用户" + username.ToString() + "临时密码失败,确认该玩家是否设置临时密码!";
                    SqlHelper.insertGMtoolsLog(UserByID, "劲舞团2", serverIP, "JW2_TmpPassWord_Query", "恢复用户" + username.ToString() + "临时密码,失败(恢复临时密码,jw2)");
                }
            }
            catch (MySqlException ex)
            {
                strDesc = "数据库连接失败,请重新尝试!";
                SqlHelper.errLog.WriteLog("服务器IP" + serverIP + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 购买日志
        /// </summary>
        public static DataSet MoneyLog_Query(string serverIP, int usersn, int goodstype, string BeginTime, string EndTime, int type, string itemName)
        {
            DataSet result     = new DataSet();;
            int     itemID     = 0;
            string  sql        = "";
            int     zone       = 0;
            string  serverName = "";

            try
            {
                serverName = CommonInfo.JW2_FindDBName(serverIP);
                zone       = CommonInfo.JW2_GetZone_Query(13, serverName);
                if (serverName == "华北一区" || serverName == "华东一区" || serverName == "华南一区" || serverName == "西南一区")
                {
                    serverIP = CommonInfo.JW2_FindDBIP(serverIP, 4);
                    sql      = "select sql_statement from sqlexpress where sql_type='JW2_AgainBuyLog_Query_new' and sql_condition='" + type + "'";
                    System.Data.DataSet ds = SqlHelper.ExecuteDataset(sql);
                    if (ds != null && ds.Tables[0].Rows.Count > 0)
                    {
                        if (itemName == "")
                        {
                            if (goodstype == 1)
                            {
                                sql = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                                sql = string.Format(sql, usersn, "M", "G", "C", BeginTime, EndTime, "");
                            }
                            else if (goodstype == 2)
                            {
                                sql = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                                sql = string.Format(sql, usersn, "M", "M", "M", BeginTime, EndTime, "");
                            }
                            else if (goodstype == 3)
                            {
                                sql = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                                sql = string.Format(sql, usersn, "G", "G", "G", BeginTime, EndTime, "");
                            }
                            else if (goodstype == 4)
                            {
                                sql = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                                sql = string.Format(sql, usersn, "C", "C", "C", BeginTime, EndTime, "");
                            }
                            result = MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2logDB), sql);
                        }
                        else
                        {
                            System.Data.DataSet ds1 = CommonInfo.JW2_ProductNameToID(itemName);
                            for (int i = 0; i < ds1.Tables[0].Rows.Count; i++)
                            {
                                itemID = int.Parse(ds1.Tables[0].Rows[i].ItemArray[0].ToString());
                                string str = "and goodsindex=" + itemID.ToString();
                                if (goodstype == 1)
                                {
                                    sql = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                                    sql = string.Format(sql, usersn, "M", "G", "C", BeginTime, EndTime, str);
                                }
                                else if (goodstype == 2)
                                {
                                    sql = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                                    sql = string.Format(sql, usersn, "M", "M", "M", BeginTime, EndTime, str);
                                }
                                else if (goodstype == 3)
                                {
                                    sql = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                                    sql = string.Format(sql, usersn, "G", "G", "G", BeginTime, EndTime, str);
                                }
                                else if (goodstype == 4)
                                {
                                    sql = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                                    sql = string.Format(sql, usersn, "C", "C", "C", BeginTime, EndTime, "");
                                }
                                result.Merge(MySqlHelper.ExecuteDataset(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2logDB), sql));
                            }
                        }
                    }
                }
                else
                {
                    sql = "select sql_statement from sqlexpress where sql_type='JW2_AgainBuyLog_Oracle_Query' and sql_condition='" + type + "'";
                    System.Data.DataSet ds2 = SqlHelper.ExecuteDataset(sql);
                    if (ds2 != null && ds2.Tables[0].Rows.Count > 0)
                    {
                        if (itemName == "")
                        {
                            if (goodstype == 1)
                            {
                                sql = ds2.Tables[0].Rows[0].ItemArray[0].ToString();
                                sql = string.Format(sql, usersn, "M", "G", BeginTime, EndTime, "", zone);
                            }
                            else if (goodstype == 2)
                            {
                                sql = ds2.Tables[0].Rows[0].ItemArray[0].ToString();
                                sql = string.Format(sql, usersn, "M", "M", BeginTime, EndTime, "", zone);
                            }
                            else if (goodstype == 3)
                            {
                                sql = ds2.Tables[0].Rows[0].ItemArray[0].ToString();
                                sql = string.Format(sql, usersn, "G", "G", BeginTime, EndTime, "", zone);
                            }
                            result = CommonInfo.RunOracle(sql, SqlHelper.oracleData, SqlHelper.oracleUser, SqlHelper.oraclePwd);
                        }
                        else
                        {
                            System.Data.DataSet ds3 = CommonInfo.JW2_ProductNameToID(itemName);
                            for (int i = 0; i < ds3.Tables[0].Rows.Count; i++)
                            {
                                itemID = int.Parse(ds3.Tables[0].Rows[i].ItemArray[0].ToString());
                                string str = "and buy_goods=" + itemID.ToString();
                                if (goodstype == 1)
                                {
                                    sql = ds2.Tables[0].Rows[0].ItemArray[0].ToString();
                                    sql = string.Format(sql, usersn, "M", "G", BeginTime, EndTime, str, zone);
                                }
                                else if (goodstype == 2)
                                {
                                    sql = ds2.Tables[0].Rows[0].ItemArray[0].ToString();
                                    sql = string.Format(sql, usersn, "M", "M", BeginTime, EndTime, str, zone);
                                }
                                else if (goodstype == 3)
                                {
                                    sql = ds2.Tables[0].Rows[0].ItemArray[0].ToString();
                                    sql = string.Format(sql, usersn, "G", "G", BeginTime, EndTime, str, zone);
                                }
                                result = CommonInfo.RunOracle(sql, SqlHelper.oracleData, SqlHelper.oracleUser, SqlHelper.oraclePwd);
                            }
                        }
                    }
                }
            }
            catch (MySqlException ex)
            {
                SqlHelper.errLog.WriteLog("浏览JW2_MoneyLog_Query_查看玩家" + usersn.ToString() + "购买日志服务器IP" + serverIP + type.ToString() + "开始时间" + BeginTime + "结束时间" + EndTime + goodstype.ToString() + ex.Message);
            }
            return(result);
        }
        /// <summary>
        /// 添加道具(批量)
        /// </summary>
        public static string ITEM_ADD_ALL(string serverIP, int userByID, string itemName, string strMailTitle, string strMailContent)
        {
            int    result     = 0;
            int    userSN     = 0;
            string UserName   = "";
            string get_result = "";
            string sql        = null;
            int    itemID     = 0;
            int    itemNum    = 0;
            string itemLimit  = "";
            string itemN      = "";
            int    count      = 0;
            string ItemSex    = "";

            try
            {
                string[] item = itemName.Split('|');
                serverIP = CommonInfo.JW2_FindDBIP(serverIP, 9);
                sql      = "select sql_statement from sqlexpress where sql_type='JW2_ADD_ITEM' and sql_condition='JW2_ADD_ITEM'";
                System.Data.DataSet ds = SqlHelper.ExecuteDataset(sql);
                if (ds != null && ds.Tables[0].Rows.Count > 0)
                {
                    for (int i = 0; i < item.Length - 1; i++)
                    {
                        result   = 0;
                        UserName = item[i].Split(',')[0].ToString();
                        userSN   = CommonInfo.JW2_Account_UserSn(serverIP, UserName);
                        if (userSN != 0)
                        {
                            itemID  = int.Parse(item[i].Split(',')[1].ToString());
                            itemNum = int.Parse(item[i].Split(',')[2].ToString());
                            itemN   = CommonInfo.JW2_ProductIDToName(itemID);
                            ItemSex = CommonInfo.JW2_ItemID_Sex(itemID);
                            switch (CommonInfo.JW2_ItemCodeToLimitDay(itemID))
                            {
                            case 0:
                                itemLimit = "永久";
                                break;

                            case 7:
                                itemLimit = "7天";
                                break;

                            case 30:
                                itemLimit = "30天";
                                break;
                            }
                            for (int j = 0; j < itemNum; j++)
                            {
                                sql     = ds.Tables[0].Rows[0].ItemArray[0].ToString();
                                sql     = string.Format(sql, userSN, strMailTitle, strMailContent, itemID);
                                result += MySqlHelper.ExecuteNonQuery(SqlHelper.JW2GetConnectionString(serverIP, SqlHelper.jw2User, SqlHelper.jw2UserPwd, SqlHelper.jw2messengerDB), sql);
                            }
                            if (result > 0)
                            {
                                get_result += "添加玩家:【" + UserName.ToString() + "】,道具ID:【" + itemID.ToString() + "】,发送性别:【" + ItemSex.ToString() + "】,道具:【" + itemN.ToString() + "】,数量:【" + result + "】,成功\n";
                                SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_ITEM_ADD_ALL", "添加玩家:" + UserName.ToString() + ",道具ID:" + itemID.ToString() + ",发送性别:" + ItemSex.ToString() + ",道具:" + itemN.ToString() + ",道具数量:" + result + ",道具期限:" + itemLimit + ",成功");
                            }
                            else
                            {
                                get_result += "添加玩家:【" + UserName.ToString() + "】,道具ID:【" + itemID.ToString() + "】,发送性别:【" + ItemSex.ToString() + "】,道具:【" + itemN.ToString() + "】,数量:【" + result + "】,成功\n";
                                SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_ITEM_ADD_ALL", "添加玩家:" + UserName.ToString() + ",道具ID:" + itemID.ToString() + ",发送性别:" + ItemSex.ToString() + ",道具:" + itemN.ToString() + ",道具数量:" + result + ",道具期限:" + itemLimit + ",成功");
                            }
                        }
                        else
                        {
                            get_result += "玩家:【" + UserName.ToString() + "】,不存在\n";
                            SqlHelper.insertGMtoolsLog(userByID, "劲舞团II", serverIP, "JW2_ITEM_ADD_ALL", "玩家:【" + UserName.ToString() + "】,不存在");
                        }
                    }
                }
            }
            catch (MySqlException ex)
            {
                get_result += "数据库连接失败,请稍后尝试";
                SqlHelper.errLog.WriteLog("服务器IP" + serverIP + ex.Message);
            }
            return(get_result);
        }
        /// <summary>
        /// GM修改雙倍狀態
        /// </summary>
        public static string  ChangeServerExp_Query(string serverIP, int iExp, int iMoney, int userByID, string serverName, int type)
        {
            int    handle     = -1;
            int    state      = -1;
            string get_Result = "";

            serverIP = CommonInfo.JW2_FindDBIP(serverIP, 5);
            string userPwd = MD5EncryptAPI.MDString(SqlHelper.jw2gwUserPwd);

            try
            {
                string[] serverList = serverName.Split('|');
                for (int i = 0; i < serverList.Length - 1; i++)
                {
                    string[] GSserverList = serverList[i].Split(',');
                    string   GSserverName = GSserverList[0].ToString();
                    string   GSserverIP   = GSserverList[1].ToString();
                    int      GSserverNo   = int.Parse(GSserverList[2].ToString());
                    int      port         = int.Parse(GSserverList[3].ToString());
                    string   city         = CommonInfo.serverIP_Query(serverIP);
                    handle = JW2_CreateDLL();
                    state  = JW2_ConnectGW(handle, serverIP, 58118);
                    if (state == 0)
                    {
                        state = JW2_LoginGW(state, handle, SqlHelper.jw2gwUser, userPwd, SqlHelper.jw2gwVersion);
                        if (state == 0)
                        {
                            state = JW2_ConnectGS(handle, GSserverIP, port);
                            if (state == 0)
                            {
                                state = JW2_LoginGS(state, handle, 7044699);
                                if (state == 0)
                                {
                                    if (type == 0)
                                    {
                                        get_Result += JW2_SetGPointTimes(state, handle, (byte)iMoney, city, GSserverName, userByID);
                                    }
                                    else if (type == 1)
                                    {
                                        get_Result = JW2_SetExpTimes(state, handle, (byte)iExp, city, GSserverName, userByID);
                                    }
                                    else if (type == 2)
                                    {
                                        get_Result += JW2_SetGPointTimes(state, handle, (byte)iMoney, city, GSserverName, userByID);
                                        get_Result += JW2_SetExpTimes(state, handle, (byte)iExp, city, GSserverName, userByID);
                                    }
                                }
                                else
                                {
                                    get_Result += "【" + city.ToString() + "】大区,登?GS服务器:【" + GSserverName.ToString() + "】,失敗\n";
                                }
                            }
                            else
                            {
                                get_Result += "【" + city.ToString() + "】大区,連接GS服务器:【" + GSserverName.ToString() + "】,失敗\n";
                            }
                        }
                        else
                        {
                            get_Result += "【" + city.ToString() + "】大区,登?,失敗\n";
                        }
                    }
                    else
                    {
                        get_Result += "【" + city.ToString() + "】大区,連接,失敗\n";
                    }
                }
            }
            catch (System.Exception ex)
            {
                get_Result += "数据库连接失败,请重新尝试!";
                Console.WriteLine("789" + ex.Message);
            }
            JW2_DestroyDLL(handle);
            return(get_Result);
        }