Ejemplo n.º 1
0
        public static string TalentInfoModify(DBManager dbMgr, int roleID, int totalCount, long exp, long expAdd, int isUp, int zoneID)
        {
            int result = 1;

            using (MyDbConnection3 conn = new MyDbConnection3(false))
            {
                string cmdText = string.Format("REPLACE INTO t_talent(roleID, tatalCount, exp, zoneID) VALUES({0}, {1}, {2}, {3})", new object[]
                {
                    roleID,
                    totalCount,
                    exp,
                    zoneID
                });
                int count = conn.ExecuteNonQuery(cmdText, 0);
                if (count > 0)
                {
                    result = 0;
                    TalentManager.TalentLogAdd(dbMgr, zoneID, roleID, 1, expAdd);
                    if (isUp > 0)
                    {
                        TalentManager.TalentLogAdd(dbMgr, zoneID, roleID, 2, 1L);
                    }
                    TalentManager.DbUpdateTalent(dbMgr, roleID, totalCount, exp);
                }
            }
            return(result.ToString());
        }
Ejemplo n.º 2
0
 public static TCPProcessCmdResults ProcTalentEffectClear(DBManager dbMgr, TCPOutPacketPool pool, int nID, byte[] data, int count, out TCPOutPacket tcpOutPacket)
 {
     tcpOutPacket = null;
     string[] fields = null;
     try
     {
         int length = 2;
         if (!CheckHelper.CheckTCPCmdFields(nID, data, count, out fields, length))
         {
             tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, 1.ToString(), nID);
             return(TCPProcessCmdResults.RESULT_DATA);
         }
         int    roleID = Convert.ToInt32(fields[0]);
         int    zoneID = Convert.ToInt32(fields[1]);
         string strcmd = TalentManager.TalentEffectClear(dbMgr, roleID, zoneID);
         tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, strcmd, nID);
         return(TCPProcessCmdResults.RESULT_DATA);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "", false, false);
     }
     tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, 1.ToString(), nID);
     return(TCPProcessCmdResults.RESULT_DATA);
 }
Ejemplo n.º 3
0
 public static TCPProcessCmdResults ProcTalentModify(DBManager dbMgr, TCPOutPacketPool pool, int nID, byte[] data, int count, out TCPOutPacket tcpOutPacket)
 {
     tcpOutPacket = null;
     string[] fields = null;
     try
     {
         int length = 6;
         if (!CheckHelper.CheckTCPCmdFields(nID, data, count, out fields, length))
         {
             tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, 1.ToString(), nID);
             return(TCPProcessCmdResults.RESULT_DATA);
         }
         int    roleID     = Convert.ToInt32(fields[0]);
         int    totalCount = Convert.ToInt32(fields[1]);
         long   exp        = Convert.ToInt64(fields[2]);
         long   expAdd     = Convert.ToInt64(fields[3]);
         int    isUp       = Convert.ToInt32(fields[4]);
         int    zoneID     = Convert.ToInt32(fields[5]);
         string strcmd     = TalentManager.TalentInfoModify(dbMgr, roleID, totalCount, exp, expAdd, isUp, zoneID);
         tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, strcmd, nID);
         return(TCPProcessCmdResults.RESULT_DATA);
     }
     catch (Exception ex)
     {
         DataHelper.WriteFormatExceptionLog(ex, "", false, false);
     }
     tcpOutPacket = TCPOutPacket.MakeTCPOutPacket(pool, 1.ToString(), nID);
     return(TCPProcessCmdResults.RESULT_DATA);
 }
Ejemplo n.º 4
0
        public static string TalentEffectClear(DBManager dbMgr, int roleID, int zoneID)
        {
            int result = 1;

            using (MyDbConnection3 conn = new MyDbConnection3(false))
            {
                string cmdText = string.Format("DELETE FROM t_talent_effect where roleID={0}", roleID);
                int    count   = conn.ExecuteNonQuery(cmdText, 0);
                if (count > 0)
                {
                    TalentManager.TalentLogAdd(dbMgr, zoneID, roleID, 3, 1L);
                    result = 0;
                    TalentManager.DbTalentClear(dbMgr, roleID);
                }
            }
            return(result.ToString());
        }
Ejemplo n.º 5
0
        public static string TalentEffectModify(DBManager dbMgr, int roleID, int talentType, int effectID, int effectLevel, int zoneID)
        {
            int result = 1;

            using (MyDbConnection3 conn = new MyDbConnection3(false))
            {
                string cmdText = string.Format("REPLACE INTO t_talent_effect(roleID, talentType, effectID, effectLevel, zoneID) VALUES({0}, {1}, {2}, {3}, {4})", new object[]
                {
                    roleID,
                    talentType,
                    effectID,
                    effectLevel,
                    zoneID
                });
                int count = conn.ExecuteNonQuery(cmdText, 0);
                if (count > 0)
                {
                    result = 0;
                    TalentManager.DbUpdateTalentEffect(dbMgr, roleID, talentType, effectID, effectLevel);
                }
            }
            return(result.ToString());
        }