public bool UpdatePlayer(PlayerInfo player)
{
bool result = false;
try
{
if (player.Grade < 1)
return result;
SqlParameter[] para = new SqlParameter[73]; //trminhpc
para[0] = new SqlParameter("@UserID", player.ID);
para[1] = new SqlParameter("@Attack", player.Attack);
para[2] = new SqlParameter("@Colors", player.Colors == null ? "" : player.Colors);
para[3] = new SqlParameter("@ConsortiaID", player.ConsortiaID);
para[4] = new SqlParameter("@Defence", player.Defence);
para[5] = new SqlParameter("@Gold", player.Gold);
para[6] = new SqlParameter("@GP", player.GP);
para[7] = new SqlParameter("@Grade", player.Grade);
para[8] = new SqlParameter("@Luck", player.Luck);
para[9] = new SqlParameter("@Money", player.Money);
para[10] = new SqlParameter("@Style", player.Style == null ? "" : player.Style);
para[11] = new SqlParameter("@Agility", player.Agility);
para[12] = new SqlParameter("@State", player.State);
para[13] = new SqlParameter("@Hide", player.Hide);
para[14] = new SqlParameter("@ExpendDate", player.ExpendDate == null ? "" : player.ExpendDate.ToString());
para[15] = new SqlParameter("@Win", player.Win);
para[16] = new SqlParameter("@Total", player.Total);
para[17] = new SqlParameter("@Escape", player.Escape);
para[18] = new SqlParameter("@Skin", player.Skin == null ? "" : player.Skin);
para[19] = new SqlParameter("@Offer", player.Offer);
para[20] = new SqlParameter("@AntiAddiction", player.AntiAddiction);
para[20].Direction = ParameterDirection.InputOutput;
para[21] = new SqlParameter("@Result", System.Data.SqlDbType.Int);
para[21].Direction = ParameterDirection.ReturnValue;
para[22] = new SqlParameter("@RichesOffer", player.RichesOffer);
para[23] = new SqlParameter("@RichesRob", player.RichesRob);
para[24] = new SqlParameter("@CheckCount", player.CheckCount);
para[24].Direction = ParameterDirection.InputOutput;
para[25] = new SqlParameter("@MarryInfoID", player.MarryInfoID);
para[26] = new SqlParameter("@DayLoginCount", player.DayLoginCount);
para[27] = new SqlParameter("@Nimbus", player.Nimbus);
para[28] = new SqlParameter("@LastAward", player.LastAward);
para[29] = new SqlParameter("@GiftToken", player.GiftToken);
para[30] = new SqlParameter("@QuestSite", player.QuestSite);
para[31] = new SqlParameter("@PvePermission", player.PvePermission);
para[32] = new SqlParameter("@FightPower", player.FightPower);
para[33] = new SqlParameter("@AnswerSite", player.AnswerSite);
para[34] = new SqlParameter("@LastAuncherAward", player.LastAward);
para[35] = new SqlParameter("@hp", player.hp);
para[36] = new SqlParameter("@ChatCount", player.ChatCount);
para[37] = new SqlParameter("@SpaPubGoldRoomLimit", player.SpaPubGoldRoomLimit);
para[38] = new SqlParameter("@LastSpaDate", player.LastSpaDate);
para[39] = new SqlParameter("@FightLabPermission", player.FightLabPermission);
para[40] = new SqlParameter("@SpaPubMoneyRoomLimit", player.SpaPubMoneyRoomLimit);
para[41] = new SqlParameter("@IsInSpaPubGoldToday", player.IsInSpaPubGoldToday);
para[42] = new SqlParameter("@IsInSpaPubMoneyToday", player.IsInSpaPubMoneyToday);
para[43] = new SqlParameter("@AchievementPoint", player.AchievementPoint);
para[44] = new SqlParameter("@LastWeekly", player.LastWeekly);
para[45] = new SqlParameter("@LastWeeklyVersion", player.LastWeeklyVersion);
para[46] = new SqlParameter("@GiftGp", player.GiftGp);
para[47] = new SqlParameter("@GiftLevel", player.GiftLevel);
para[48] = new SqlParameter("@IsOpenGift", player.IsOpenGift);
para[49] = new SqlParameter("@WeaklessGuildProgressStr", player.WeaklessGuildProgressStr);
para[50] = new SqlParameter("@IsOldPlayer", player.IsOldPlayer);
para[51] = new SqlParameter("@VIPLevel", player.VIPLevel);
para[52] = new SqlParameter("@VIPExp", player.VIPExp);
para[53] = new SqlParameter("@Score", player.Score);
para[54] = new SqlParameter("@OptionOnOff", player.OptionOnOff);
para[55] = new SqlParameter("@isOldPlayerHasValidEquitAtLogin", player.isOldPlayerHasValidEquitAtLogin);
para[56] = new SqlParameter("@badLuckNumber", player.badLuckNumber);
para[57] = new SqlParameter("@luckyNum", player.luckyNum);
para[58] = new SqlParameter("@lastLuckyNumDate", player.lastLuckyNumDate.ToString());
para[59] = new SqlParameter("@lastLuckNum", player.lastLuckNum);
para[60] = new SqlParameter("@CardSoul", player.CardSoul);
para[61] = new SqlParameter("@uesedFinishTime", player.uesedFinishTime);
para[62] = new SqlParameter("@totemId", player.totemId);
para[63] = new SqlParameter("@damageScores", player.damageScores);
para[64] = new SqlParameter("@petScore", player.petScore);
para[65] = new SqlParameter("@IsShowConsortia", player.IsShowConsortia);
para[66] = new SqlParameter("@LastRefreshPet", player.LastRefreshPet.ToString());
para[67] = new SqlParameter("@receiebox", player.receiebox);
para[68] = new SqlParameter("@receieGrade", player.receieGrade);
para[69] = new SqlParameter("@needGetBoxTime", player.needGetBoxTime);
para[70] = new SqlParameter("@myScore", player.myScore);
para[71] = new SqlParameter("@TimeBox", player.TimeBox.ToString());
para[72] = new SqlParameter("@IsFistGetPet", player.IsFistGetPet);
db.RunProcedure("SP_Users_Update", para);
result = ((int)para[21].Value) == 0;
if (result)
{
player.AntiAddiction = (int)para[20].Value;
player.CheckCount = (int)para[24].Value;
}
player.IsDirty = false;
}
catch (Exception e)
{
if (log.IsErrorEnabled)
log.Error("Init", e);
}
return result;
}