Beispiel #1
0
        private void btn_AccountReflush_Click(object sender, EventArgs e)
        {
            CPlayerCtrl.LoadPlayerInfos(txt_svrForder.Text + "\\DataBase\\saves\\players.dat", true);
            List <Account> infos = CSGHelper.SelectAcountInfo();

            lstv_Account.Items.Clear();
            foreach (var info in infos)
            {
                //构建一个ListView的数据,存入数据库数据,以便添加到listView1的行数据中
                ListViewItem lt = new ListViewItem();
                //将数据库数据转变成ListView类型的一行数据
                lt.Text = info.account;
                lt.SubItems.Add(info.password);
                lt.SubItems.Add(CPlayerCtrl.GetNameByAcc(lt.Text));
                lt.SubItems.Add(info.enable);
                lt.SubItems.Add(info.privilege);
                lt.SubItems.Add(info.point);
                lt.SubItems.Add(info.ip);
                lt.SubItems.Add(info.LastLoginTime);
                lt.SubItems.Add(info.LastLogoutTime);
                //将lt数据添加到listView1控件中
                lstv_Account.Items.Add(lt);
            }
            lstv_Account.EndUpdate();
            lbl_AccountCount.Text = "帐号总数:" + infos.Count;
        }
Beispiel #2
0
        public static bool InsertSanvtItem(string sanvtName, string account
                                           , UInt32 DataID1, UInt32 Number1
                                           , UInt32 DataID2, UInt32 Number2
                                           , UInt32 DataID3, UInt32 Number3
                                           , UInt32 DataID4, UInt32 Number4
                                           , UInt32 DataID5, UInt32 Number5)
        {
            if (sanvtName == string.Empty || account == string.Empty)
            {
                return(false);
            }
            if (DataID1 == 0 && Number1 == 0 &&
                DataID2 == 0 && Number2 == 0 &&
                DataID3 == 0 && Number3 == 0 &&
                DataID4 == 0 && Number4 == 0 &&
                DataID5 == 0 && Number5 == 0)
            {
                return(false);
            }

            string cmd = "INSERT INTO " + sanvtName + @".dbo.vitem (Account,Disable,Card,Login_time,Get_time,SName,CharName,Type,"
                         + "DataID1,Number1,DataID2,Number2,DataID3,Number3,DataID4,Number4,DataID5,Number5)"
                         + "values ('" + account + "',0,'" + DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff") + "',getdate(),getdate(),0,0,0,"
                         + "" + DataID1 + "," + Number1 + "," + DataID2 + "," + Number2 + "," + DataID3 + "," + Number3 + "," + DataID4 + "," + Number4 + "," + DataID5 + "," + Number5 + ")";

            string ret = CSGHelper.SqlCommand(cmd);

            if (ret != "success")
            {
                return(false);
            }
            return(true);
        }
Beispiel #3
0
        private void btn_AcountAdd_Click(object sender, EventArgs e)
        {
            string account = txt_AcountName.Text;
            string pwd     = txt_AcountPwd.Text;
            string result  = CSGHelper.CreateAccount(account, pwd);

            MessageBox.Show(result);
        }
Beispiel #4
0
        private void btn_AcountMdifyPwd_Click(object sender, EventArgs e)
        {
            string account = txt_AcountName.Text;
            string pwd     = txt_AcountPwd.Text;
            string pwdnew  = txt_AcountNewPwd.Text;
            string result  = CSGHelper.ModifyPwd(account, pwd, pwdnew);

            MessageBox.Show(result);
        }
Beispiel #5
0
        private void btn_sql_Click(object sender, EventArgs e)
        {
            if (!m_Active)
            {
                MessageBox.Show("软件尚未激活! 请联系软件发布人给予激活!");
                return;
            }
            CSGHelper.SetSQLNames(txt_sqlAccountName.Text, txt_sqlSanvtName.Text, txt_sqlLogName.Text);
            if (btn_sql.Text == "连接数据库")
            {
                //连接数据库
                string conn_str = "Data Source = " + sql_srvAddr + "," + sql_srvPort + "; Initial Catalog = " + txt_sqlAccountName.Text + "; User Id = " + sql_srvUser + "; Password = "******";";
                //string conn_str = "server = " + sql_srvAddr + "," + sql_srvPort + "; database = " + txt_sqlAccountName.Text + "; uid = " + sql_srvUser + "; pwd = " + sql_srvPwd + ";";
                if (!CSGHelper.SqlConn(conn_str))
                {
                    MessageBox.Show("数据库连接失败!");
                    return;
                }
                else
                {
                    MessageBox.Show("数据库连接成功!");

                    btn_sql.Text                = "断开连接";
                    lbl_sqlStatus.Text          = "数据库已连接";
                    txt_sqlsvr.ReadOnly         = true;
                    txt_sqlPort.ReadOnly        = true;
                    txt_sqlAcc.ReadOnly         = true;
                    txt_sqlPwd.ReadOnly         = true;
                    txt_sqlAccountName.ReadOnly = true;
                    txt_sqlSanvtName.ReadOnly   = true;
                    txt_sqlLogName.ReadOnly     = true;
                }
            }
            else
            {
                if (!CSGHelper.SqlClose())
                {
                    MessageBox.Show("断开数据库连接失败!");
                    return;
                }
                else
                {
                    btn_sql.Text                = "连接数据库";
                    lbl_sqlStatus.Text          = "数据库未连接";
                    txt_sqlsvr.ReadOnly         = false;
                    txt_sqlPort.ReadOnly        = false;
                    txt_sqlAcc.ReadOnly         = false;
                    txt_sqlPwd.ReadOnly         = false;
                    txt_sqlAccountName.ReadOnly = false;
                    txt_sqlSanvtName.ReadOnly   = false;
                    txt_sqlLogName.ReadOnly     = false;
                }
            }
        }
Beispiel #6
0
        private void lstv_xbAcc_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (lstv_xbAcc.SelectedIndices != null && lstv_xbAcc.SelectedIndices.Count > 0)
            {
                lstv_xbAcc.Items[xbPlayersInfoSltIndex].BackColor = Color.Transparent;
                xbPlayersInfoSltIndex = this.lstv_xbAcc.SelectedItems[0].Index;
                lstv_xbAcc.Items[xbPlayersInfoSltIndex].BackColor = Color.Pink;

                txt_xbAccount.Text = lstv_xbAcc.Items[xbPlayersInfoSltIndex].SubItems[0].Text;
                txt_xbName.Text    = lstv_xbAcc.Items[xbPlayersInfoSltIndex].SubItems[1].Text;

                //查询代币
                txt_dbCurr.Text = "" + CSGHelper.SelectAcountPoint(txt_xbAccount.Text);
            }
        }
Beispiel #7
0
        private void lstv_xblog_SelectedIndexChanged(object sender, EventArgs e)
        {
            //
            if (lstv_xblog.SelectedIndices != null && lstv_xblog.SelectedIndices.Count > 0)
            {
                lstv_xblog.Items[xblogSltIndex].BackColor = Color.Transparent;
                xblogSltIndex = this.lstv_xblog.SelectedItems[0].Index;
                lstv_xblog.Items[xblogSltIndex].BackColor = Color.Pink;


                txt_xbAccount.Text = lstv_xblog.Items[xblogSltIndex].SubItems[0].Text;
                txt_xbName.Text    = lstv_xblog.Items[xblogSltIndex].SubItems[1].Text;
                txt_xbId1.Text     = lstv_xblog.Items[xblogSltIndex].SubItems[2].Text;
                txt_xbName1.Text   = lstv_xblog.Items[xblogSltIndex].SubItems[3].Text;
                txt_xbCount1.Text  = lstv_xblog.Items[xblogSltIndex].SubItems[4].Text;
                txt_xbId2.Text     = lstv_xblog.Items[xblogSltIndex].SubItems[5].Text;
                txt_xbName2.Text   = lstv_xblog.Items[xblogSltIndex].SubItems[6].Text;
                txt_xbCount2.Text  = lstv_xblog.Items[xblogSltIndex].SubItems[7].Text;
                txt_xbId3.Text     = lstv_xblog.Items[xblogSltIndex].SubItems[8].Text;
                txt_xbName3.Text   = lstv_xblog.Items[xblogSltIndex].SubItems[9].Text;
                txt_xbCount3.Text  = lstv_xblog.Items[xblogSltIndex].SubItems[10].Text;
                txt_xbId4.Text     = lstv_xblog.Items[xblogSltIndex].SubItems[11].Text;
                txt_xbName4.Text   = lstv_xblog.Items[xblogSltIndex].SubItems[12].Text;
                txt_xbCount4.Text  = lstv_xblog.Items[xblogSltIndex].SubItems[13].Text;
                txt_xbId5.Text     = lstv_xblog.Items[xblogSltIndex].SubItems[14].Text;
                txt_xbName5.Text   = lstv_xblog.Items[xblogSltIndex].SubItems[15].Text;
                txt_xbCount5.Text  = lstv_xblog.Items[xblogSltIndex].SubItems[16].Text;

                txt_xbId6.Text     = "";
                txt_xbName6.Text   = "";
                txt_xbCount6.Text  = "";
                txt_xbId7.Text     = "";
                txt_xbName7.Text   = "";
                txt_xbCount7.Text  = "";
                txt_xbId8.Text     = "";
                txt_xbName8.Text   = "";
                txt_xbCount8.Text  = "";
                txt_xbId9.Text     = "";
                txt_xbName9.Text   = "";
                txt_xbCount9.Text  = "";
                txt_xbId10.Text    = "";
                txt_xbName10.Text  = "";
                txt_xbCount10.Text = "";
                //查询代币
                txt_dbCurr.Text = "" + CSGHelper.SelectAcountPoint(txt_xbAccount.Text);
            }
        }
Beispiel #8
0
 private void btn_FreezeListAcc_Click(object sender, EventArgs e)
 {
     for (int i = 0; i < lstv_GtList.Items.Count; i++)
     {
         string acc = lstv_GtList.Items[i].SubItems[0].Text;
         //封号
         try
         {
             string log = CSGHelper.FreezeAccount(acc, 1, "非法登录或者使用外挂!", "GM");
             LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, acc + ":" + log, new StackTrace(new StackFrame(true)));
         }
         catch (Exception ex)
         {
             LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, acc + ":" + ex.Message, new StackTrace(new StackFrame(true)));
         }
     }
 }
Beispiel #9
0
        public static string CmdModyPwd(Mdfy_Pwd_Info modyInfo)
        {
            string ErrInfo = "";

            try
            {
                //找出传递过来的用户名和密码
                string name      = "";
                string oldpasswd = "";
                string newpasswd = "";
                if (modyInfo.key == "110")
                {
                    name      = modyInfo.name;
                    oldpasswd = modyInfo.oldpasswd;
                    newpasswd = modyInfo.newpasswd;

                    ErrInfo = CSGHelper.ModifyPwd(name, oldpasswd, newpasswd);
                    LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, "ModifyPwd name:" + name + "\toldpasswd:" + oldpasswd + "\tnewpasswd:" + newpasswd, new StackTrace(new StackFrame(true)));
                }
                else
                {
                    name      = CSecurity.DecryptDES(modyInfo.name, modyInfo.key);
                    oldpasswd = CSecurity.DecryptDES(modyInfo.oldpasswd, modyInfo.key);
                    newpasswd = CSecurity.DecryptDES(modyInfo.newpasswd, modyInfo.key);
                    if (name == modyInfo.name || oldpasswd == modyInfo.oldpasswd ||
                        newpasswd == modyInfo.newpasswd)
                    {
                        ErrInfo = "修改失败,请稍后再试!";
                    }
                    else
                    {
                        ErrInfo = CSGHelper.ModifyPwd(name, oldpasswd, newpasswd);
                        LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, "ModifyPwd name:" + name + "\toldpasswd:" + oldpasswd + "\tnewpasswd:" + newpasswd, new StackTrace(new StackFrame(true)));
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, ex.Message, new StackTrace(new StackFrame(true)));
                ErrInfo = "注册失败,请稍后再试!";
            }


            return(ErrInfo);
        }
Beispiel #10
0
        private void btn_sql_Click(object sender, EventArgs e)
        {
            if (btn_sql.Text == "连接数据库")
            {
                //连接数据库
                //*
                string conn_str = "Data Source = " + sql_srvAddr + "," + sql_srvPort + "; Initial Catalog = " + sqlAccountName + "; User Id = " + sql_srvUser + "; Password = "******";";
                if (!CSGHelper.SqlConn(conn_str))
                {
                    MessageBox.Show("数据库连接失败!");
                    return;
                }
                else
                {
                    MessageBox.Show("数据库连接成功!");

                    btn_sql.Text                = "断开连接";
                    lbl_sqlStatus.Text          = "数据库已连接";
                    txt_sqlsvr.ReadOnly         = true;
                    txt_sqlPort.ReadOnly        = true;
                    txt_sqlAcc.ReadOnly         = true;
                    txt_sqlPwd.ReadOnly         = true;
                    txt_sqlAccountName.ReadOnly = true;
                }
            }
            else
            {
                //*
                if (!CSGHelper.SqlClose())
                {
                    MessageBox.Show("断开数据库连接失败!");
                    return;
                }
                else
                {
                    btn_sql.Text                = "连接数据库";
                    lbl_sqlStatus.Text          = "数据库未连接";
                    txt_sqlsvr.ReadOnly         = false;
                    txt_sqlPort.ReadOnly        = false;
                    txt_sqlAcc.ReadOnly         = false;
                    txt_sqlPwd.ReadOnly         = false;
                    txt_sqlAccountName.ReadOnly = false;
                }
            }
        }
Beispiel #11
0
        public static string CmdRegister(Rg_Info rg_info)
        {
            string ErrInfo = "";

            try {
                //找出传递过来的用户名和密码
                string name   = "";
                string passwd = "";
                if (rg_info.key == "110")
                {
                    name    = rg_info.name;
                    passwd  = rg_info.passwd;
                    ErrInfo = CSGHelper.CreateAccount(name, passwd);
                    LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, "CreateAccount name:" + name + "\tpasswd:" + passwd + "\t" + ErrInfo, new StackTrace(new StackFrame(true)));
                }
                else
                {
                    name   = CSecurity.DecryptDES(rg_info.name, rg_info.key);
                    passwd = CSecurity.DecryptDES(rg_info.passwd, rg_info.key);
                    if (name == rg_info.name || passwd == rg_info.passwd)
                    {
                        ErrInfo = "注册失败,请稍后再试!";
                    }
                    else
                    {
                        ErrInfo = CSGHelper.CreateAccount(name, passwd);
                        LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, "CreateAccount name:" + name + "\tpasswd:" + passwd, new StackTrace(new StackFrame(true)));
                    }
                }
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, ex.Message, new StackTrace(new StackFrame(true)));
                ErrInfo = "注册失败,请稍后再试!";
            }


            return(ErrInfo);
        }
Beispiel #12
0
        private void btn_AcountFreeze_Click(object sender, EventArgs e)
        {
            string acc = CFormat.PureString(txt_AcountName.Text);

            if (acc == "")
            {
                return;
            }
            //封号
            string log = "";

            try
            {
                log = CSGHelper.FreezeAccount(acc, 1, "手动封禁!", "GM");
                LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, acc + ":" + log, new StackTrace(new StackFrame(true)));
                btn_AccountReflush_Click(null, null);
            }
            catch (Exception ex)
            {
                LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, acc + ":" + ex.Message, new StackTrace(new StackFrame(true)));
            }
            MessageBox.Show("账户:" + acc + log);
        }
Beispiel #13
0
        public static bool AddAcountPoint(string account, int dbCount)
        {
            if (!m_SqlConnected)
                return false;

            string cmd = "DECLARE @account varchar(21) \n"
                                + "DECLARE @point int \n"
                                + "DECLARE @old_point int \n"
                                + "DECLARE @new_point int \n"
                                + "set @account = '" + account + "' \n"
                                + "set @point = " + dbCount + " \n"
                                + "Select @old_point=point from " + m_sqlAccount + ".dbo.game_acc where account = @account \n"
                                + "SET @new_point = @point + @old_point \n"
                                + "Update " + m_sqlAccount + ".dbo.game_acc set point = @new_point where account = @account";

            mutex.WaitOne();
            string ret = CSGHelper.SqlCommand(cmd);
            mutex.ReleaseMutex();
            if (ret != "success")
            {
                return false;
            }
            return true;
        }
Beispiel #14
0
        private void btn_rcgInit_Click(object sender, EventArgs e)
        {
            if (btn_sql.Text == "连接数据库")
            {
                MessageBox.Show("请先连接数据库!");
                return;
            }

            //加载设定的配置
            Recharge_Conf[] conf = new Recharge_Conf[7];
            for (int i = 0; i < 7; i++)
            {
                string rcgLevel = "档位:" + (i + 1);
                string rcgConf  = CIniCtrl.ReadIniData(rcgLevel, "rcgConf", "", serverIni);
                string leftNum  = CIniCtrl.ReadIniData(rcgLevel, "leftNum", "", serverIni);
                string rightNum = CIniCtrl.ReadIniData(rcgLevel, "rightNum", "", serverIni);

                string id   = "";
                string name = "";
                string num  = "";
                //读取
                id   = CIniCtrl.ReadIniData("Recharge", rcgConf + "_id1", "", serverIni);
                name = CIniCtrl.ReadIniData("Recharge", rcgConf + "_name1", "", serverIni);
                num  = CIniCtrl.ReadIniData("Recharge", rcgConf + "_num1", "", serverIni);
                //配置内容
                conf[i].id1   = id == "" ? "0" : id;
                conf[i].name1 = name == "" ? "空" : name;
                conf[i].num1  = num == "" ? "0" : num;

                //读取
                id   = CIniCtrl.ReadIniData("Recharge", rcgConf + "_id2", "", serverIni);
                name = CIniCtrl.ReadIniData("Recharge", rcgConf + "_name2", "", serverIni);
                num  = CIniCtrl.ReadIniData("Recharge", rcgConf + "_num2", "", serverIni);
                //配置内容
                conf[i].id2   = id == "" ? "0" : id;
                conf[i].name2 = name == "" ? "空" : name;
                conf[i].num2  = num == "" ? "0" : num;

                //读取
                id   = CIniCtrl.ReadIniData("Recharge", rcgConf + "_id3", "", serverIni);
                name = CIniCtrl.ReadIniData("Recharge", rcgConf + "_name3", "", serverIni);
                num  = CIniCtrl.ReadIniData("Recharge", rcgConf + "_num3", "", serverIni);
                //配置内容
                conf[i].id3   = id == "" ? "0" : id;
                conf[i].name3 = name == "" ? "空" : name;
                conf[i].num3  = num == "" ? "0" : num;

                //读取
                id   = CIniCtrl.ReadIniData("Recharge", rcgConf + "_id4", "", serverIni);
                name = CIniCtrl.ReadIniData("Recharge", rcgConf + "_name4", "", serverIni);
                num  = CIniCtrl.ReadIniData("Recharge", rcgConf + "_num4", "", serverIni);
                //配置内容
                conf[i].id4   = id == "" ? "0" : id;
                conf[i].name4 = name == "" ? "空" : name;
                conf[i].num4  = num == "" ? "0" : num;

                //读取
                id   = CIniCtrl.ReadIniData("Recharge", rcgConf + "_id5", "", serverIni);
                name = CIniCtrl.ReadIniData("Recharge", rcgConf + "_name5", "", serverIni);
                num  = CIniCtrl.ReadIniData("Recharge", rcgConf + "_num5", "", serverIni);
                //配置内容
                conf[i].id5   = id == "" ? "0" : id;
                conf[i].name5 = name == "" ? "空" : name;
                conf[i].num5  = num == "" ? "0" : num;

                leftNum  = leftNum == "" ? "0" : leftNum;
                rightNum = rightNum == "" ? "-1" : rightNum;
                if (Int32.Parse(leftNum) >= Int32.Parse(rightNum))
                {
                    conf[i].leftNum  = "0";
                    conf[i].rightNum = "-1";
                }
                else
                {
                    conf[i].leftNum  = leftNum;
                    conf[i].rightNum = rightNum;
                }
            }

            string cmd = "";
            string ret = "";

            //删除[recharge_history]表
            cmd = @"DROP TABLE recharge_history";
            ret = CSGHelper.SqlCommand(cmd);
            if (ret != "success")
            {
                MessageBox.Show("删除[recharge_history]表失败!");
                //return;
            }
            //删除game_acc 的 Account_Insert触发器
            cmd = @"drop trigger Account_Insert ";
            ret = CSGHelper.SqlCommand(cmd);
            if (ret != "success")
            {
                MessageBox.Show("删除game_acc 的 Account_Insert触发器失败!");
                //return;
            }
            //创建[recharge_history]表
            cmd =
                @"create table [recharge_history]
(
account varchar(21) PRIMARY KEY,
point int default 0,
time datetime
)";
            ret = CSGHelper.SqlCommand(cmd);
            if (ret != "success")
            {
                MessageBox.Show("创建[recharge_history]表失败!");
                return;
            }
            //同步账户名
            cmd =
                @"insert INTO recharge_history(account,point)
SELECT account,point
FROM game_acc";
            ret = CSGHelper.SqlCommand(cmd);
            if (ret != "success")
            {
                MessageBox.Show("同步game_acc账户名和point到recharge_history失败!");
                return;
            }
            //创建game_acc 的 Account_Insert触发器,game_acc有插入时同样插入信息到recharge_history
            cmd =
                @"CREATE TRIGGER Account_Insert ON dbo.game_acc 
FOR INSERT 
AS 
DECLARE @account varchar(21)
Select @account=account from inserted 
insert INTO recharge_history(account,point) values (@account,0)";
            ret = CSGHelper.SqlCommand(cmd);
            if (ret != "success")
            {
                MessageBox.Show("创建game_acc 的 Account_Insert触发器失败!");
                return;
            }
            //创建recharge_history 的 Recharge_Update触发器,充值更新point,触发更新game_acc的point
            cmd =
                @"CREATE TRIGGER Recharge_Update ON dbo.recharge_history 
FOR UPDATE 
AS 
DECLARE @account varchar(21)
DECLARE @point int
DECLARE @old_point int
DECLARE @add_point int
DECLARE @old_point_acc int
DECLARE @new_point_acc int
Select @account=account from inserted 
Select @point=point from inserted 
SELECT @old_point=point FROM DELETED
SET @add_point = @point - @old_point

Select @old_point_acc=point from dbo.game_acc where account = @account
set @new_point_acc = @old_point_acc + @add_point
Update dbo.game_acc set point = @new_point_acc where account = @account

DECLARE @cardid varchar(100)
DECLARE @dtDate datetime
set @dtDate = getdate()
SET @cardid = CONVERT(varchar(100), GETDATE(), 21)
PRINT @cardid

DECLARE @DataID1 int
DECLARE @Number1 int
DECLARE @DataID2 int
DECLARE @Number2 int
DECLARE @DataID3 int
DECLARE @Number3 int
DECLARE @DataID4 int
DECLARE @Number4 int
DECLARE @DataID5 int
DECLARE @Number5 int

set @DataID1 = 0
set @Number1 = 0
set @DataID2 = 0
set @Number2 = 0
set @DataID3 = 0
set @Number3 = 0
set @DataID4 = 0
set @Number4 = 0
set @DataID5 = 0
set @Number5 = 0

if (@add_point >= " + conf[0].leftNum + " AND @add_point < " + conf[0].rightNum + @")
	begin
	set @DataID1 = "     + conf[0].id1 + @"
	set @Number1 = "     + conf[0].num1 + @"
	set @DataID2 = "     + conf[0].id2 + @"
	set @Number2 = "     + conf[0].num2 + @"
	set @DataID3 = "     + conf[0].id3 + @"
	set @Number3 = "     + conf[0].num3 + @"
	set @DataID4 = "     + conf[0].id4 + @"
	set @Number4 = "     + conf[0].num4 + @"
	set @DataID5 = "     + conf[0].id5 + @"
	set @Number5 = "     + conf[0].num5 + @"
	end
else if (@add_point >= " + conf[1].leftNum + " AND @add_point < " + conf[1].rightNum + @")
	begin
	set @DataID1 = "     + conf[1].id1 + @"
	set @Number1 = "     + conf[1].num1 + @"
	set @DataID2 = "     + conf[1].id2 + @"
	set @Number2 = "     + conf[1].num2 + @"
	set @DataID3 = "     + conf[1].id3 + @"
	set @Number3 = "     + conf[1].num3 + @"
	set @DataID4 = "     + conf[1].id4 + @"
	set @Number4 = "     + conf[1].num4 + @"
	set @DataID5 = "     + conf[1].id5 + @"
	set @Number5 = "     + conf[1].num5 + @"
	end
else if (@add_point >= " + conf[2].leftNum + " AND @add_point < " + conf[2].rightNum + @")
	begin
	set @DataID1 = "     + conf[2].id1 + @"
	set @Number1 = "     + conf[2].num1 + @"
	set @DataID2 = "     + conf[2].id2 + @"
	set @Number2 = "     + conf[2].num2 + @"
	set @DataID3 = "     + conf[2].id3 + @"
	set @Number3 = "     + conf[2].num3 + @"
	set @DataID4 = "     + conf[2].id4 + @"
	set @Number4 = "     + conf[2].num4 + @"
	set @DataID5 = "     + conf[2].id5 + @"
	set @Number5 = "     + conf[2].num5 + @"
	end
else if (@add_point >= " + conf[3].leftNum + " AND @add_point < " + conf[3].rightNum + @")
	begin
	set @DataID1 = "     + conf[3].id1 + @"
	set @Number1 = "     + conf[3].num1 + @"
	set @DataID2 = "     + conf[3].id2 + @"
	set @Number2 = "     + conf[3].num2 + @"
	set @DataID3 = "     + conf[3].id3 + @"
	set @Number3 = "     + conf[3].num3 + @"
	set @DataID4 = "     + conf[3].id4 + @"
	set @Number4 = "     + conf[3].num4 + @"
	set @DataID5 = "     + conf[3].id5 + @"
	set @Number5 = "     + conf[3].num5 + @"
	end
else if (@add_point >= " + conf[4].leftNum + " AND @add_point < " + conf[4].rightNum + @")
	begin
	set @DataID1 = "     + conf[4].id1 + @"
	set @Number1 = "     + conf[4].num1 + @"
	set @DataID2 = "     + conf[4].id2 + @"
	set @Number2 = "     + conf[4].num2 + @"
	set @DataID3 = "     + conf[4].id3 + @"
	set @Number3 = "     + conf[4].num3 + @"
	set @DataID4 = "     + conf[4].id4 + @"
	set @Number4 = "     + conf[4].num4 + @"
	set @DataID5 = "     + conf[4].id5 + @"
	set @Number5 = "     + conf[4].num5 + @"
	end
else if (@add_point >= " + conf[5].leftNum + " AND @add_point < " + conf[5].rightNum + @")
	begin
	set @DataID1 = "     + conf[5].id1 + @"
	set @Number1 = "     + conf[5].num1 + @"
	set @DataID2 = "     + conf[5].id2 + @"
	set @Number2 = "     + conf[5].num2 + @"
	set @DataID3 = "     + conf[5].id3 + @"
	set @Number3 = "     + conf[5].num3 + @"
	set @DataID4 = "     + conf[5].id4 + @"
	set @Number4 = "     + conf[5].num4 + @"
	set @DataID5 = "     + conf[5].id5 + @"
	set @Number5 = "     + conf[5].num5 + @"
	end
else if (@add_point >= " + conf[6].leftNum + " AND @add_point < " + conf[6].rightNum + @")
	begin
	set @DataID1 = "     + conf[6].id1 + @"
	set @Number1 = "     + conf[6].num1 + @"
	set @DataID2 = "     + conf[6].id2 + @"
	set @Number2 = "     + conf[6].num2 + @"
	set @DataID3 = "     + conf[6].id3 + @"
	set @Number3 = "     + conf[6].num3 + @"
	set @DataID4 = "     + conf[6].id4 + @"
	set @Number4 = "     + conf[6].num4 + @"
	set @DataID5 = "     + conf[6].id5 + @"
	set @Number5 = "     + conf[6].num5 + @"
	end

INSERT INTO " + txt_sanvtName.Text + @".dbo.vitem (Account,Disable,Card,Login_time,Get_time,SName,CharName,Type,
DataID1,Number1,DataID2,Number2,DataID3,Number3,DataID4,Number4,DataID5,Number5)
values (@account,0,@cardid,@dtDate,@dtDate,0,0,0,
@DataID1,@Number1,@DataID2,@Number2,@DataID3,@Number3,@DataID4,@Number4,@DataID5,@Number5)";
            ret = CSGHelper.SqlCommand(cmd);

            if (ret == "success")
            {
                string msg = @"当前设定如下:

本服不设定非固定充值,非以下固定充值将以第三方设置比例结算。

(1)范围:" + conf[0].leftNum + "-" + conf[0].rightNum + "额外获得:" + conf[0].name1 + "*" + conf[0].num1 + ";" + conf[0].name2 + "*" + conf[0].num2 + ";" + conf[0].name3 + "*" + conf[0].num3 + ";" + conf[0].name4 + "*" + conf[0].num4 + ";" + conf[0].name5 + "*" + conf[0].num5 + @";

(2)范围:" + conf[1].leftNum + "-" + conf[1].rightNum + "额外获得:" + conf[1].name1 + "*" + conf[1].num1 + ";" + conf[1].name2 + "*" + conf[1].num2 + ";" + conf[1].name3 + "*" + conf[1].num3 + ";" + conf[1].name4 + "*" + conf[1].num4 + ";" + conf[1].name5 + "*" + conf[1].num5 + @";

(3)范围:" + conf[2].leftNum + "-" + conf[2].rightNum + "额外获得:" + conf[2].name1 + "*" + conf[2].num1 + ";" + conf[2].name2 + "*" + conf[2].num2 + ";" + conf[2].name3 + "*" + conf[2].num3 + ";" + conf[2].name4 + "*" + conf[2].num4 + ";" + conf[2].name5 + "*" + conf[2].num5 + @";

(4)范围:" + conf[3].leftNum + "-" + conf[3].rightNum + "额外获得:" + conf[3].name1 + "*" + conf[3].num1 + ";" + conf[3].name2 + "*" + conf[3].num2 + ";" + conf[3].name3 + "*" + conf[3].num3 + ";" + conf[3].name4 + "*" + conf[3].num4 + ";" + conf[3].name5 + "*" + conf[3].num5 + @";

(5)范围:" + conf[4].leftNum + "-" + conf[4].rightNum + "额外获得:" + conf[4].name1 + "*" + conf[4].num1 + ";" + conf[4].name2 + "*" + conf[4].num2 + ";" + conf[4].name3 + "*" + conf[4].num3 + ";" + conf[4].name4 + "*" + conf[4].num4 + ";" + conf[4].name5 + "*" + conf[4].num5 + @";

(6)范围:" + conf[5].leftNum + "-" + conf[5].rightNum + "额外获得:" + conf[5].name1 + "*" + conf[5].num1 + ";" + conf[5].name2 + "*" + conf[5].num2 + ";" + conf[5].name3 + "*" + conf[5].num3 + ";" + conf[5].name4 + "*" + conf[5].num4 + ";" + conf[5].name5 + "*" + conf[5].num5 + @";

(6)范围:" + conf[6].leftNum + "-" + conf[6].rightNum + "额外获得:" + conf[6].name1 + "*" + conf[6].num1 + ";" + conf[6].name2 + "*" + conf[6].num2 + ";" + conf[6].name3 + "*" + conf[6].num3 + ";" + conf[6].name4 + "*" + conf[6].num4 + ";" + conf[6].name5 + "*" + conf[6].num5 + @";";
                MessageBox.Show(msg);
            }
            else
            {
                MessageBox.Show("创建recharge_history 的 Recharge_Update触发器失败!");
                return;
            }
        }
Beispiel #15
0
        private void FreezeCheck()
        {
            //读取loginserverlog,获取非法信息列表
            List <Illegal> nameList = GetIllegalList();

            int FreezeCount = 0;
            int IllCount    = 0;

            //更新列表
            lstv_GtList.Items.Clear();
            foreach (var name in nameList)
            {
                //过滤
                if (m_FreezeFilterList != null)
                {
                    bool   filter     = false;
                    String PureAcount = CFormat.PureString(name.account);
                    foreach (var item in m_FreezeFilterList)
                    {
                        if (PureAcount == item)
                        {
                            filter = true;
                            break;
                        }
                    }
                    if (filter)
                    {
                        continue;
                    }
                }
                IllCount++;
                ListViewItem lvi = new ListViewItem();

                lvi.Text = CFormat.PureString(name.account);
                //lvi.SubItems.Add(_id);
                lvi.SubItems.Add(CFormat.ToSimplified(CFormat.PureString(name.name)));
                lvi.SubItems.Add(name.time_str);

                if (cbx_AutoFreeze.Checked)
                {
                    string acc = CFormat.PureString(name.account);
                    //封号
                    try
                    {
                        string log = CSGHelper.FreezeAccount(acc, 1, "非法登录或者使用外挂!", "GM");
                        lvi.SubItems.Add(log);
                        if (log == "冻结成功")
                        {
                            FreezeCount++;
                        }
                        LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, acc + ":" + log, new StackTrace(new StackFrame(true)));
                    }
                    catch (Exception ex)
                    {
                        LogHelper.WriteLog(System.AppDomain.CurrentDomain.BaseDirectory, acc + ":" + ex.Message, new StackTrace(new StackFrame(true)));
                    }
                }
                lstv_GtList.Items.Add(lvi);
            }
            lstv_GtList.EndUpdate();

            lbl_IllCount.Text    = IllCount.ToString();
            lbl_FreezeCount.Text = FreezeCount.ToString();
        }
Beispiel #16
0
        private void btn_bxSend_Click(object sender, EventArgs e)
        {
            if (!m_Active)
            {
                MessageBox.Show("软件尚未激活! 请联系软件发布人给予激活!");
                return;
            }
            if (txt_xbAccount.Text != string.Empty)
            {
                int xbCount1  = 0;
                int xbCount2  = 0;
                int xbCount3  = 0;
                int xbCount4  = 0;
                int xbCount5  = 0;
                int xbCount6  = 0;
                int xbCount7  = 0;
                int xbCount8  = 0;
                int xbCount9  = 0;
                int xbCount10 = 0;
                int xbId1     = 1;
                int xbId2     = 1;
                int xbId3     = 1;
                int xbId4     = 1;
                int xbId5     = 1;
                int xbId6     = 1;
                int xbId7     = 1;
                int xbId8     = 1;
                int xbId9     = 1;
                int xbId10    = 1;
                if (!string.IsNullOrEmpty(txt_xbCount1.Text) || CFormat.isNumberic(txt_xbCount1.Text))
                {
                    xbCount1 = Convert.ToInt32(txt_xbCount1.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount2.Text) || CFormat.isNumberic(txt_xbCount2.Text))
                {
                    xbCount2 = Convert.ToInt32(txt_xbCount2.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount3.Text) || CFormat.isNumberic(txt_xbCount3.Text))
                {
                    xbCount3 = Convert.ToInt32(txt_xbCount3.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount4.Text) || CFormat.isNumberic(txt_xbCount4.Text))
                {
                    xbCount4 = Convert.ToInt32(txt_xbCount4.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount5.Text) || CFormat.isNumberic(txt_xbCount5.Text))
                {
                    xbCount5 = Convert.ToInt32(txt_xbCount5.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount6.Text) || CFormat.isNumberic(txt_xbCount6.Text))
                {
                    xbCount6 = Convert.ToInt32(txt_xbCount6.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount7.Text) || CFormat.isNumberic(txt_xbCount7.Text))
                {
                    xbCount7 = Convert.ToInt32(txt_xbCount7.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount8.Text) || CFormat.isNumberic(txt_xbCount8.Text))
                {
                    xbCount8 = Convert.ToInt32(txt_xbCount8.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount9.Text) || CFormat.isNumberic(txt_xbCount9.Text))
                {
                    xbCount9 = Convert.ToInt32(txt_xbCount9.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount10.Text) || CFormat.isNumberic(txt_xbCount10.Text))
                {
                    xbCount10 = Convert.ToInt32(txt_xbCount10.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbId1.Text) || CFormat.isNumberic(txt_xbId1.Text))
                {
                    xbId1 = Convert.ToInt32(txt_xbId1.Text);
                    if (xbId1 == 0)
                    {
                        xbId1    = 1;
                        xbCount1 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId2.Text) || CFormat.isNumberic(txt_xbId2.Text))
                {
                    xbId2 = Convert.ToInt32(txt_xbId2.Text);
                    if (xbId2 == 0)
                    {
                        xbId2    = 1;
                        xbCount2 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId3.Text) || CFormat.isNumberic(txt_xbId3.Text))
                {
                    xbId3 = Convert.ToInt32(txt_xbId3.Text);
                    if (xbId3 == 0)
                    {
                        xbId3    = 1;
                        xbCount3 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId4.Text) || CFormat.isNumberic(txt_xbId4.Text))
                {
                    xbId4 = Convert.ToInt32(txt_xbId4.Text);
                    if (xbId4 == 0)
                    {
                        xbId4    = 1;
                        xbCount4 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId5.Text) || CFormat.isNumberic(txt_xbId5.Text))
                {
                    xbId5 = Convert.ToInt32(txt_xbId5.Text);
                    if (xbId5 == 0)
                    {
                        xbId5    = 1;
                        xbCount5 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId6.Text) || CFormat.isNumberic(txt_xbId6.Text))
                {
                    xbId6 = Convert.ToInt32(txt_xbId6.Text);
                    if (xbId6 == 0)
                    {
                        xbId6    = 1;
                        xbCount6 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId7.Text) || CFormat.isNumberic(txt_xbId7.Text))
                {
                    xbId7 = Convert.ToInt32(txt_xbId7.Text);
                    if (xbId7 == 0)
                    {
                        xbId7    = 1;
                        xbCount7 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId8.Text) || CFormat.isNumberic(txt_xbId8.Text))
                {
                    xbId8 = Convert.ToInt32(txt_xbId8.Text);
                    if (xbId8 == 0)
                    {
                        xbId8    = 1;
                        xbCount8 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId9.Text) || CFormat.isNumberic(txt_xbId9.Text))
                {
                    xbId9 = Convert.ToInt32(txt_xbId9.Text);
                    if (xbId9 == 0)
                    {
                        xbId9    = 1;
                        xbCount9 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId10.Text) || CFormat.isNumberic(txt_xbId10.Text))
                {
                    xbId10 = Convert.ToInt32(txt_xbId10.Text);
                    if (xbId10 == 0)
                    {
                        xbId10    = 1;
                        xbCount10 = 0;
                    }
                }
                string msg = "\n"
                             + "账户:" + txt_xbAccount.Text + "\n"
                             + "角色:" + txt_xbName.Text + "\n"
                             + "代币:" + txt_dbSend.Text + "\n";
                if (txt_xbId1.Text != "" && xbCount1 != 0)
                {
                    msg += "物品:" + txt_xbName1.Text + "\t数量:" + txt_xbCount1.Text + "\t\n";
                }
                if (txt_xbId2.Text != "" && xbCount2 != 0)
                {
                    msg += "物品:" + txt_xbName2.Text + "\t数量:" + txt_xbCount2.Text + "\t\n";
                }
                if (txt_xbId3.Text != "" && xbCount3 != 0)
                {
                    msg += "物品:" + txt_xbName3.Text + "\t数量:" + txt_xbCount3.Text + "\t\n";
                }
                if (txt_xbId4.Text != "" && xbCount4 != 0)
                {
                    msg += "物品:" + txt_xbName4.Text + "\t数量:" + txt_xbCount4.Text + "\t\n";
                }
                if (txt_xbId5.Text != "" && xbCount5 != 0)
                {
                    msg += "物品:" + txt_xbName5.Text + "\t数量:" + txt_xbCount5.Text + "\t\n";
                }
                if (txt_xbId6.Text != "" && xbCount6 != 0)
                {
                    msg += "物品:" + txt_xbName6.Text + "\t数量:" + txt_xbCount6.Text + "\t\n";
                }
                if (txt_xbId7.Text != "" && xbCount7 != 0)
                {
                    msg += "物品:" + txt_xbName7.Text + "\t数量:" + txt_xbCount7.Text + "\t\n";
                }
                if (txt_xbId8.Text != "" && xbCount8 != 0)
                {
                    msg += "物品:" + txt_xbName8.Text + "\t数量:" + txt_xbCount8.Text + "\t\n";
                }
                if (txt_xbId9.Text != "" && xbCount9 != 0)
                {
                    msg += "物品:" + txt_xbName9.Text + "\t数量:" + txt_xbCount9.Text + "\t\n";
                }
                if (txt_xbId10.Text != "" && xbCount10 != 0)
                {
                    msg += "物品:" + txt_xbName10.Text + "\t数量:" + txt_xbCount10.Text + "\t\n";
                }

                msg += "\n确认信息无误?";
                DialogResult dr = MessageBox.Show(msg, "对话框标题", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (dr != DialogResult.OK)
                {
                    return;
                }

                //确保有效
                if ((txt_xbId1.Text == "" || xbCount1 == 0) && (txt_xbId2.Text == "" || xbCount2 == 0) &&
                    (txt_xbId3.Text == "" || xbCount3 == 0) && (txt_xbId4.Text == "" || xbCount4 == 0) &&
                    (txt_xbId5.Text == "" || xbCount5 == 0))
                {
                }
                else
                {
                    string cmd = "INSERT INTO " + txt_sanvtName.Text + @".dbo.vitem (Account,Disable,Card,Login_time,Get_time,SName,CharName,Type,"
                                 + "DataID1,Number1,DataID2,Number2,DataID3,Number3,DataID4,Number4,DataID5,Number5)"
                                 + "values ('" + txt_xbAccount.Text + "',0,CONVERT(varchar(100), GETDATE(), 21),getdate(),getdate(),0,0,0,"
                                 + xbId1 + "," + xbCount1 + "," + xbId2 + "," + xbCount2 + "," + xbId3 + "," + xbCount3 + "," + xbId4 + "," + xbCount4 + "," + xbId5 + "," + xbCount5 + ")";
                    string ret = CSGHelper.SqlCommand(cmd);
                    if (ret == "success")
                    {
                        SGExHandle.WriteXbLog(txt_xbAccount.Text + "\t" + txt_xbName.Text + "\t"
                                              + txt_xbId1.Text + "\t" + txt_xbName1.Text + "\t" + txt_xbCount1.Text + "\t"
                                              + txt_xbId2.Text + "\t" + txt_xbName2.Text + "\t" + txt_xbCount2.Text + "\t"
                                              + txt_xbId4.Text + "\t" + txt_xbName3.Text + "\t" + txt_xbCount3.Text + "\t"
                                              + txt_xbId5.Text + "\t" + txt_xbName4.Text + "\t" + txt_xbCount4.Text + "\t"
                                              + txt_xbId6.Text + "\t" + txt_xbName5.Text + "\t" + txt_xbCount5.Text + "\t");

                        ListViewItem lvi = new ListViewItem();
                        lvi.Text = txt_xbAccount.Text;
                        lvi.SubItems.Add(txt_xbName.Text);
                        lvi.SubItems.Add(txt_xbId1.Text);
                        lvi.SubItems.Add(txt_xbName1.Text);
                        lvi.SubItems.Add(txt_xbCount1.Text);
                        lvi.SubItems.Add(txt_xbId2.Text);
                        lvi.SubItems.Add(txt_xbName2.Text);
                        lvi.SubItems.Add(txt_xbCount2.Text);
                        lvi.SubItems.Add(txt_xbId3.Text);
                        lvi.SubItems.Add(txt_xbName3.Text);
                        lvi.SubItems.Add(txt_xbCount3.Text);
                        lvi.SubItems.Add(txt_xbId4.Text);
                        lvi.SubItems.Add(txt_xbName4.Text);
                        lvi.SubItems.Add(txt_xbCount4.Text);
                        lvi.SubItems.Add(txt_xbId5.Text);
                        lvi.SubItems.Add(txt_xbName5.Text);
                        lvi.SubItems.Add(txt_xbCount5.Text);
                        lstv_xblog.Items.Add(lvi);
                    }
                    else
                    {
                        string msg2 = "\n"
                                      + "账户:" + txt_xbAccount.Text + "\n"
                                      + "角色:" + txt_xbName.Text + "\n";
                        if (txt_xbId1.Text != "" && xbCount1 != 0)
                        {
                            msg += "物品:" + txt_xbName1.Text + "\t数量:" + txt_xbCount1.Text + "\t\n";
                        }
                        if (txt_xbId2.Text != "" && xbCount2 != 0)
                        {
                            msg += "物品:" + txt_xbName2.Text + "\t数量:" + txt_xbCount2.Text + "\t\n";
                        }
                        if (txt_xbId3.Text != "" && xbCount3 != 0)
                        {
                            msg += "物品:" + txt_xbName3.Text + "\t数量:" + txt_xbCount3.Text + "\t\n";
                        }
                        if (txt_xbId4.Text != "" && xbCount4 != 0)
                        {
                            msg += "物品:" + txt_xbName4.Text + "\t数量:" + txt_xbCount4.Text + "\t\n";
                        }
                        if (txt_xbId5.Text != "" && xbCount5 != 0)
                        {
                            msg += "物品:" + txt_xbName5.Text + "\t数量:" + txt_xbCount5.Text + "\t\n";
                        }
                        MessageBox.Show("发送失败,\t\n" + msg2);
                    }
                }

                Thread.Sleep(200);
                if ((txt_xbId6.Text == "" || xbCount6 == 0) && (txt_xbId7.Text == "" || xbCount7 == 0) &&
                    (txt_xbId8.Text == "" || xbCount8 == 0) && (txt_xbId9.Text == "" || xbCount9 == 0) &&
                    (txt_xbId10.Text == "" || xbCount10 == 0))
                {
                }
                else
                {
                    string cmd = "INSERT INTO " + txt_sanvtName.Text + @".dbo.vitem (Account,Disable,Card,Login_time,Get_time,SName,CharName,Type,"
                                 + "DataID1,Number1,DataID2,Number2,DataID3,Number3,DataID4,Number4,DataID5,Number5)"
                                 + "values ('" + txt_xbAccount.Text + "',0,CONVERT(varchar(100), GETDATE(), 21),getdate(),getdate(),0,0,0,"
                                 + xbId6 + "," + xbCount6 + "," + xbId7 + "," + xbCount7 + "," + xbId8 + "," + xbCount8 + "," + xbId9 + "," + xbCount9 + "," + xbId10 + "," + xbCount10 + ")";
                    string ret = CSGHelper.SqlCommand(cmd);
                    if (ret == "success")
                    {
                        SGExHandle.WriteXbLog(txt_xbAccount.Text + "\t" + txt_xbName.Text + "\t"
                                              + txt_xbId6.Text + "\t" + txt_xbName6.Text + "\t" + txt_xbCount6.Text + "\t"
                                              + txt_xbId7.Text + "\t" + txt_xbName7.Text + "\t" + txt_xbCount7.Text + "\t"
                                              + txt_xbId8.Text + "\t" + txt_xbName8.Text + "\t" + txt_xbCount8.Text + "\t"
                                              + txt_xbId9.Text + "\t" + txt_xbName9.Text + "\t" + txt_xbCount9.Text + "\t"
                                              + txt_xbId10.Text + "\t" + txt_xbName10.Text + "\t" + txt_xbCount10.Text + "\t");

                        ListViewItem lvi = new ListViewItem();
                        lvi.Text = txt_xbAccount.Text;
                        lvi.SubItems.Add(txt_xbName.Text);
                        lvi.SubItems.Add(txt_xbId6.Text);
                        lvi.SubItems.Add(txt_xbName6.Text);
                        lvi.SubItems.Add(txt_xbCount6.Text);
                        lvi.SubItems.Add(txt_xbId7.Text);
                        lvi.SubItems.Add(txt_xbName7.Text);
                        lvi.SubItems.Add(txt_xbCount7.Text);
                        lvi.SubItems.Add(txt_xbId8.Text);
                        lvi.SubItems.Add(txt_xbName8.Text);
                        lvi.SubItems.Add(txt_xbCount8.Text);
                        lvi.SubItems.Add(txt_xbId9.Text);
                        lvi.SubItems.Add(txt_xbName9.Text);
                        lvi.SubItems.Add(txt_xbCount9.Text);
                        lvi.SubItems.Add(txt_xbId10.Text);
                        lvi.SubItems.Add(txt_xbName10.Text);
                        lvi.SubItems.Add(txt_xbCount10.Text);
                        lstv_xblog.Items.Add(lvi);
                    }
                    else
                    {
                        string msg2 = "\n"
                                      + "账户:" + txt_xbAccount.Text + "\n"
                                      + "角色:" + txt_xbName.Text + "\n";
                        if (txt_xbId6.Text != "" && xbCount6 != 0)
                        {
                            msg += "物品:" + txt_xbName6.Text + "\t数量:" + txt_xbCount6.Text + "\t\n";
                        }
                        if (txt_xbId7.Text != "" && xbCount7 != 0)
                        {
                            msg += "物品:" + txt_xbName7.Text + "\t数量:" + txt_xbCount7.Text + "\t\n";
                        }
                        if (txt_xbId8.Text != "" && xbCount8 != 0)
                        {
                            msg += "物品:" + txt_xbName8.Text + "\t数量:" + txt_xbCount8.Text + "\t\n";
                        }
                        if (txt_xbId9.Text != "" && xbCount9 != 0)
                        {
                            msg += "物品:" + txt_xbName9.Text + "\t数量:" + txt_xbCount9.Text + "\t\n";
                        }
                        if (txt_xbId10.Text != "" && xbCount10 != 0)
                        {
                            msg += "物品:" + txt_xbName10.Text + "\t数量:" + txt_xbCount10.Text + "\t\n";
                        }
                        MessageBox.Show("发送失败,\t\n" + msg2);
                    }
                }
                Thread.Sleep(200);
                //代币
                if (!string.IsNullOrEmpty(txt_dbSend.Text) && CFormat.isNumberic(txt_dbSend.Text))
                {
                    int dbCount = Convert.ToInt32(txt_dbSend.Text);
                    if (dbCount > 0)
                    {
                        //虚宝增加
                        string cmd = "DECLARE @account varchar(21) \n"
                                     + "DECLARE @point int \n"
                                     + "DECLARE @old_point int \n"
                                     + "DECLARE @new_point int \n"
                                     + "set @account = '" + txt_xbAccount.Text + "' \n"
                                     + "set @point = " + dbCount + " \n"
                                     + "Select @old_point=point from dbo.game_acc where account = @account \n"
                                     + "SET @new_point = @point + @old_point \n"
                                     + "Update dbo.game_acc set point = @new_point where account = @account";
                        string ret = CSGHelper.SqlCommand(cmd);
                        if (ret == "success")
                        {
                            txt_dbCurr.Text = "" + CSGHelper.SelectAcountPoint(txt_xbAccount.Text);
                        }
                        else
                        {
                            MessageBox.Show("发送代币失败,代币:" + dbCount);
                        }
                    }
                }

                if (cbx_xbconf.Text == "新人起步")
                {
                    m_SGExHandle.SendWorldWords("新人玩家 " + txt_xbName.Text + " 的新手起步已经发放,请到大鸿胪处领取虚宝,欢迎加入大家庭,祝游戏愉快。");
                }
            }
            else
            {
                MessageBox.Show("请核对发放帐号!");
            }
        }
Beispiel #17
0
        private void btn_bxSend_Click(object sender, EventArgs e)
        {
            if (!m_Active)
            {
                MessageBox.Show("软件尚未激活! 请联系软件发布人给予激活!");
                return;
            }
            if (txt_xbAccount.Text != string.Empty)
            {
                int xbCount1  = 0;
                int xbCount2  = 0;
                int xbCount3  = 0;
                int xbCount4  = 0;
                int xbCount5  = 0;
                int xbCount6  = 0;
                int xbCount7  = 0;
                int xbCount8  = 0;
                int xbCount9  = 0;
                int xbCount10 = 0;
                int xbId1     = 1;
                int xbId2     = 1;
                int xbId3     = 1;
                int xbId4     = 1;
                int xbId5     = 1;
                int xbId6     = 1;
                int xbId7     = 1;
                int xbId8     = 1;
                int xbId9     = 1;
                int xbId10    = 1;
                if (!string.IsNullOrEmpty(txt_xbCount1.Text) || CFormat.isNumberic(txt_xbCount1.Text))
                {
                    xbCount1 = Convert.ToInt32(txt_xbCount1.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount2.Text) || CFormat.isNumberic(txt_xbCount2.Text))
                {
                    xbCount2 = Convert.ToInt32(txt_xbCount2.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount3.Text) || CFormat.isNumberic(txt_xbCount3.Text))
                {
                    xbCount3 = Convert.ToInt32(txt_xbCount3.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount4.Text) || CFormat.isNumberic(txt_xbCount4.Text))
                {
                    xbCount4 = Convert.ToInt32(txt_xbCount4.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount5.Text) || CFormat.isNumberic(txt_xbCount5.Text))
                {
                    xbCount5 = Convert.ToInt32(txt_xbCount5.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount6.Text) || CFormat.isNumberic(txt_xbCount6.Text))
                {
                    xbCount6 = Convert.ToInt32(txt_xbCount6.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount7.Text) || CFormat.isNumberic(txt_xbCount7.Text))
                {
                    xbCount7 = Convert.ToInt32(txt_xbCount7.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount8.Text) || CFormat.isNumberic(txt_xbCount8.Text))
                {
                    xbCount8 = Convert.ToInt32(txt_xbCount8.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount9.Text) || CFormat.isNumberic(txt_xbCount9.Text))
                {
                    xbCount9 = Convert.ToInt32(txt_xbCount9.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbCount10.Text) || CFormat.isNumberic(txt_xbCount10.Text))
                {
                    xbCount10 = Convert.ToInt32(txt_xbCount10.Text);
                }
                if (!string.IsNullOrEmpty(txt_xbId1.Text) || CFormat.isNumberic(txt_xbId1.Text))
                {
                    xbId1 = Convert.ToInt32(txt_xbId1.Text);
                    if (xbId1 == 0)
                    {
                        xbId1    = 1;
                        xbCount1 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId2.Text) || CFormat.isNumberic(txt_xbId2.Text))
                {
                    xbId2 = Convert.ToInt32(txt_xbId2.Text);
                    if (xbId2 == 0)
                    {
                        xbId2    = 1;
                        xbCount2 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId3.Text) || CFormat.isNumberic(txt_xbId3.Text))
                {
                    xbId3 = Convert.ToInt32(txt_xbId3.Text);
                    if (xbId3 == 0)
                    {
                        xbId3    = 1;
                        xbCount3 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId4.Text) || CFormat.isNumberic(txt_xbId4.Text))
                {
                    xbId4 = Convert.ToInt32(txt_xbId4.Text);
                    if (xbId4 == 0)
                    {
                        xbId4    = 1;
                        xbCount4 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId5.Text) || CFormat.isNumberic(txt_xbId5.Text))
                {
                    xbId5 = Convert.ToInt32(txt_xbId5.Text);
                    if (xbId5 == 0)
                    {
                        xbId5    = 1;
                        xbCount5 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId6.Text) || CFormat.isNumberic(txt_xbId6.Text))
                {
                    xbId6 = Convert.ToInt32(txt_xbId6.Text);
                    if (xbId6 == 0)
                    {
                        xbId6    = 1;
                        xbCount6 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId7.Text) || CFormat.isNumberic(txt_xbId7.Text))
                {
                    xbId7 = Convert.ToInt32(txt_xbId7.Text);
                    if (xbId7 == 0)
                    {
                        xbId7    = 1;
                        xbCount7 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId8.Text) || CFormat.isNumberic(txt_xbId8.Text))
                {
                    xbId8 = Convert.ToInt32(txt_xbId8.Text);
                    if (xbId8 == 0)
                    {
                        xbId8    = 1;
                        xbCount8 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId9.Text) || CFormat.isNumberic(txt_xbId9.Text))
                {
                    xbId9 = Convert.ToInt32(txt_xbId9.Text);
                    if (xbId9 == 0)
                    {
                        xbId9    = 1;
                        xbCount9 = 0;
                    }
                }
                if (!string.IsNullOrEmpty(txt_xbId10.Text) || CFormat.isNumberic(txt_xbId10.Text))
                {
                    xbId10 = Convert.ToInt32(txt_xbId10.Text);
                    if (xbId10 == 0)
                    {
                        xbId10    = 1;
                        xbCount10 = 0;
                    }
                }
                string msg = "\n"
                             + "账户:" + txt_xbAccount.Text + "\n"
                             + "角色:" + txt_xbName.Text + "\n"
                             + "代币:" + txt_dbSend.Text + "\n";
                if (txt_xbId1.Text != "" && xbCount1 != 0)
                {
                    msg += "物品:" + txt_xbName1.Text + "\t数量:" + txt_xbCount1.Text + "\t\n";
                }
                if (txt_xbId2.Text != "" && xbCount2 != 0)
                {
                    msg += "物品:" + txt_xbName2.Text + "\t数量:" + txt_xbCount2.Text + "\t\n";
                }
                if (txt_xbId3.Text != "" && xbCount3 != 0)
                {
                    msg += "物品:" + txt_xbName3.Text + "\t数量:" + txt_xbCount3.Text + "\t\n";
                }
                if (txt_xbId4.Text != "" && xbCount4 != 0)
                {
                    msg += "物品:" + txt_xbName4.Text + "\t数量:" + txt_xbCount4.Text + "\t\n";
                }
                if (txt_xbId5.Text != "" && xbCount5 != 0)
                {
                    msg += "物品:" + txt_xbName5.Text + "\t数量:" + txt_xbCount5.Text + "\t\n";
                }
                if (txt_xbId6.Text != "" && xbCount6 != 0)
                {
                    msg += "物品:" + txt_xbName6.Text + "\t数量:" + txt_xbCount6.Text + "\t\n";
                }
                if (txt_xbId7.Text != "" && xbCount7 != 0)
                {
                    msg += "物品:" + txt_xbName7.Text + "\t数量:" + txt_xbCount7.Text + "\t\n";
                }
                if (txt_xbId8.Text != "" && xbCount8 != 0)
                {
                    msg += "物品:" + txt_xbName8.Text + "\t数量:" + txt_xbCount8.Text + "\t\n";
                }
                if (txt_xbId9.Text != "" && xbCount9 != 0)
                {
                    msg += "物品:" + txt_xbName9.Text + "\t数量:" + txt_xbCount9.Text + "\t\n";
                }
                if (txt_xbId10.Text != "" && xbCount10 != 0)
                {
                    msg += "物品:" + txt_xbName10.Text + "\t数量:" + txt_xbCount10.Text + "\t\n";
                }

                msg += "\n确认信息无误?";
                DialogResult dr = MessageBox.Show(msg, "对话框标题", MessageBoxButtons.OKCancel, MessageBoxIcon.Question);
                if (dr != DialogResult.OK)
                {
                    return;
                }

                //确保有效
                if ((txt_xbId1.Text == "" || xbCount1 == 0) && (txt_xbId2.Text == "" || xbCount2 == 0) &&
                    (txt_xbId3.Text == "" || xbCount3 == 0) && (txt_xbId4.Text == "" || xbCount4 == 0) &&
                    (txt_xbId5.Text == "" || xbCount5 == 0))
                {
                }
                else
                {
                    bool result = CSGHelper.InsertSanvtItem(txt_xbAccount.Text
                                                            , (uint)xbId1, (uint)xbCount1, (uint)xbId2, (uint)xbCount2, (uint)xbId3, (uint)xbCount3
                                                            , (uint)xbId4, (uint)xbCount4, (uint)xbId5, (uint)xbCount5);
                    if (result)
                    {
                        SGExHandle.WriteXbLog(txt_xbAccount.Text + "\t" + txt_xbName.Text + "\t"
                                              + txt_xbId1.Text + "\t" + txt_xbName1.Text + "\t" + txt_xbCount1.Text + "\t"
                                              + txt_xbId2.Text + "\t" + txt_xbName2.Text + "\t" + txt_xbCount2.Text + "\t"
                                              + txt_xbId4.Text + "\t" + txt_xbName3.Text + "\t" + txt_xbCount3.Text + "\t"
                                              + txt_xbId5.Text + "\t" + txt_xbName4.Text + "\t" + txt_xbCount4.Text + "\t"
                                              + txt_xbId6.Text + "\t" + txt_xbName5.Text + "\t" + txt_xbCount5.Text + "\t");

                        ListViewItem lvi = new ListViewItem();
                        lvi.Text = txt_xbAccount.Text;
                        lvi.SubItems.Add(txt_xbName.Text);
                        lvi.SubItems.Add(txt_xbId1.Text);
                        lvi.SubItems.Add(txt_xbName1.Text);
                        lvi.SubItems.Add(txt_xbCount1.Text);
                        lvi.SubItems.Add(txt_xbId2.Text);
                        lvi.SubItems.Add(txt_xbName2.Text);
                        lvi.SubItems.Add(txt_xbCount2.Text);
                        lvi.SubItems.Add(txt_xbId3.Text);
                        lvi.SubItems.Add(txt_xbName3.Text);
                        lvi.SubItems.Add(txt_xbCount3.Text);
                        lvi.SubItems.Add(txt_xbId4.Text);
                        lvi.SubItems.Add(txt_xbName4.Text);
                        lvi.SubItems.Add(txt_xbCount4.Text);
                        lvi.SubItems.Add(txt_xbId5.Text);
                        lvi.SubItems.Add(txt_xbName5.Text);
                        lvi.SubItems.Add(txt_xbCount5.Text);
                        lstv_xblog.Items.Add(lvi);
                    }
                    else
                    {
                        string msg2 = "\n"
                                      + "账户:" + txt_xbAccount.Text + "\n"
                                      + "角色:" + txt_xbName.Text + "\n";
                        if (txt_xbId1.Text != "" && xbCount1 != 0)
                        {
                            msg += "物品:" + txt_xbName1.Text + "\t数量:" + txt_xbCount1.Text + "\t\n";
                        }
                        if (txt_xbId2.Text != "" && xbCount2 != 0)
                        {
                            msg += "物品:" + txt_xbName2.Text + "\t数量:" + txt_xbCount2.Text + "\t\n";
                        }
                        if (txt_xbId3.Text != "" && xbCount3 != 0)
                        {
                            msg += "物品:" + txt_xbName3.Text + "\t数量:" + txt_xbCount3.Text + "\t\n";
                        }
                        if (txt_xbId4.Text != "" && xbCount4 != 0)
                        {
                            msg += "物品:" + txt_xbName4.Text + "\t数量:" + txt_xbCount4.Text + "\t\n";
                        }
                        if (txt_xbId5.Text != "" && xbCount5 != 0)
                        {
                            msg += "物品:" + txt_xbName5.Text + "\t数量:" + txt_xbCount5.Text + "\t\n";
                        }
                        MessageBox.Show("发送失败,\t\n" + msg2);
                    }
                }

                Thread.Sleep(200);
                if ((txt_xbId6.Text == "" || xbCount6 == 0) && (txt_xbId7.Text == "" || xbCount7 == 0) &&
                    (txt_xbId8.Text == "" || xbCount8 == 0) && (txt_xbId9.Text == "" || xbCount9 == 0) &&
                    (txt_xbId10.Text == "" || xbCount10 == 0))
                {
                }
                else
                {
                    bool result = CSGHelper.InsertSanvtItem(txt_xbAccount.Text
                                                            , (uint)xbId6, (uint)xbCount6, (uint)xbId7, (uint)xbCount7, (uint)xbId8, (uint)xbCount8
                                                            , (uint)xbId9, (uint)xbCount9, (uint)xbId10, (uint)xbCount10);
                    if (result)
                    {
                        SGExHandle.WriteXbLog(txt_xbAccount.Text + "\t" + txt_xbName.Text + "\t"
                                              + txt_xbId6.Text + "\t" + txt_xbName6.Text + "\t" + txt_xbCount6.Text + "\t"
                                              + txt_xbId7.Text + "\t" + txt_xbName7.Text + "\t" + txt_xbCount7.Text + "\t"
                                              + txt_xbId8.Text + "\t" + txt_xbName8.Text + "\t" + txt_xbCount8.Text + "\t"
                                              + txt_xbId9.Text + "\t" + txt_xbName9.Text + "\t" + txt_xbCount9.Text + "\t"
                                              + txt_xbId10.Text + "\t" + txt_xbName10.Text + "\t" + txt_xbCount10.Text + "\t");

                        ListViewItem lvi = new ListViewItem();
                        lvi.Text = txt_xbAccount.Text;
                        lvi.SubItems.Add(txt_xbName.Text);
                        lvi.SubItems.Add(txt_xbId6.Text);
                        lvi.SubItems.Add(txt_xbName6.Text);
                        lvi.SubItems.Add(txt_xbCount6.Text);
                        lvi.SubItems.Add(txt_xbId7.Text);
                        lvi.SubItems.Add(txt_xbName7.Text);
                        lvi.SubItems.Add(txt_xbCount7.Text);
                        lvi.SubItems.Add(txt_xbId8.Text);
                        lvi.SubItems.Add(txt_xbName8.Text);
                        lvi.SubItems.Add(txt_xbCount8.Text);
                        lvi.SubItems.Add(txt_xbId9.Text);
                        lvi.SubItems.Add(txt_xbName9.Text);
                        lvi.SubItems.Add(txt_xbCount9.Text);
                        lvi.SubItems.Add(txt_xbId10.Text);
                        lvi.SubItems.Add(txt_xbName10.Text);
                        lvi.SubItems.Add(txt_xbCount10.Text);
                        lstv_xblog.Items.Add(lvi);
                    }
                    else
                    {
                        string msg2 = "\n"
                                      + "账户:" + txt_xbAccount.Text + "\n"
                                      + "角色:" + txt_xbName.Text + "\n";
                        if (txt_xbId6.Text != "" && xbCount6 != 0)
                        {
                            msg += "物品:" + txt_xbName6.Text + "\t数量:" + txt_xbCount6.Text + "\t\n";
                        }
                        if (txt_xbId7.Text != "" && xbCount7 != 0)
                        {
                            msg += "物品:" + txt_xbName7.Text + "\t数量:" + txt_xbCount7.Text + "\t\n";
                        }
                        if (txt_xbId8.Text != "" && xbCount8 != 0)
                        {
                            msg += "物品:" + txt_xbName8.Text + "\t数量:" + txt_xbCount8.Text + "\t\n";
                        }
                        if (txt_xbId9.Text != "" && xbCount9 != 0)
                        {
                            msg += "物品:" + txt_xbName9.Text + "\t数量:" + txt_xbCount9.Text + "\t\n";
                        }
                        if (txt_xbId10.Text != "" && xbCount10 != 0)
                        {
                            msg += "物品:" + txt_xbName10.Text + "\t数量:" + txt_xbCount10.Text + "\t\n";
                        }
                        MessageBox.Show("发送失败,\t\n" + msg2);
                    }
                }
                Thread.Sleep(200);
                //代币
                if (!string.IsNullOrEmpty(txt_dbSend.Text) && CFormat.isNumberic(txt_dbSend.Text))
                {
                    int dbCount = Convert.ToInt32(txt_dbSend.Text);
                    if (dbCount > 0)
                    {
                        //虚宝增加
                        bool result = CSGHelper.AddAcountPoint(txt_xbAccount.Text, dbCount);
                        if (result)
                        {
                            txt_dbCurr.Text = "" + CSGHelper.SelectAcountPoint(txt_xbAccount.Text);
                        }
                        else
                        {
                            MessageBox.Show("发送代币失败,代币:" + dbCount);
                        }
                    }
                }

                if (cbx_xbconf.Text == "新人起步")
                {
                    m_SGExHandle.SendWorldWords("新人玩家 " + txt_xbName.Text + " 的新手起步已经发放,请到大鸿胪处领取虚宝,欢迎加入大家庭,祝游戏愉快。");
                }
            }
            else
            {
                MessageBox.Show("请核对发放帐号!");
            }
        }