public static void NotifyClientDailyActiveData(GameClient client, int justCompleteddailyactive = -1, bool bRefresh = false) { if (client.ClientData.MyRoleDailyData != null && !bRefresh) { int nKillBoss = client.ClientData.MyRoleDailyData.TodayKillBoss; } DailyActiveData dailyactiveData = new DailyActiveData { RoleID = client.ClientData.RoleID, DailyActiveValues = (long)client.ClientData.DailyActiveValues, TotalKilledMonsterCount = (long)((ulong)client.ClientData.DailyTotalKillMonsterNum), DailyActiveTotalLoginCount = (long)((ulong)client.ClientData.DailyActiveDayLginCount), DailyActiveOnLineTimer = client.ClientData.DayOnlineSecond, DailyActiveInforFlags = DailyActiveManager.GetDailyActiveInfoArray(client), NowCompletedDailyActiveID = justCompleteddailyactive, TotalKilledBossCount = (int)client.ClientData.DailyTotalKillKillBossNum, PassNormalCopySceneNum = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteCopyMap1), PassHardCopySceneNum = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteCopyMap2), PassDifficultCopySceneNum = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteCopyMap3), BuyItemInMall = client.ClientData.DailyActiveDayBuyItemInMall, CompleteDailyTaskCount = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteDailyTask), CompleteBloodCastleCount = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteBloodCastle), CompleteDaimonSquareCount = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteDaimonSquare), CompleteBattleCount = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteBattle), EquipForge = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveEquipForge), EquipAppend = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveEquipAppend), ChangeLife = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveChangeLife), MergeFruit = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveMergeFruit), GetAwardFlag = Global.GetRoleParamsInt32FromDB(client, "DailyActiveAwardFlag") }; byte[] bytesData = DataHelper.ObjectToBytes <DailyActiveData>(dailyactiveData); GameManager.ClientMgr.SendToClient(client, bytesData, 558); }
public static void InitRoleDailyActiveData(GameClient client) { client.ClientData.DailyActiveValues = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveValue); client.ClientData.DailyActiveDayLginCount = DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveDayLoginNum); client.ClientData.DailyTotalKillMonsterNum = DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveTotalKilledMonsterNum); client.ClientData.DailyTotalKillKillBossNum = DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveTotalKilledBossNum); client.ClientData.DailyCompleteDailyTaskCount = DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteDailyTask); client.ClientData.DailyActiveDayBuyItemInMall = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveBuyItemInMall); }
public static void ProcessDailyActiveMergeFruit(GameClient client) { if (!DailyActiveManager.IsDailyActiveCompleted(client, 1600)) { if (DailyActiveManager.CheckLevCondition(client, 1600)) { int nNum = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveMergeFruit); nNum++; DailyActiveManager.ModifyDailyActiveInfor(client, (uint)nNum, DailyActiveDataField1.DailyActiveMergeFruit, true); bool bIsCompleted = false; DailyActiveManager.CheckSingleConditionForDailyActive(client, 1600, 1600, (long)nNum, "HeChengLimit", out bIsCompleted); } } }
public static void ProcessLoginForDailyActive(GameClient client, out bool bIsCompleted) { bIsCompleted = false; if (!DailyActiveManager.IsDailyActiveCompleted(client, 100)) { if (DailyActiveManager.CheckLevCondition(client, 100)) { client.ClientData.DailyActiveDayLginCount += 1U; uint nvalue = DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveDayLoginNum); DailyActiveManager.ModifyDailyActiveInfor(client, client.ClientData.DailyActiveDayLginCount, DailyActiveDataField1.DailyActiveDayLoginNum, true); nvalue = DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveDayLoginNum); DailyActiveManager.CheckSingleConditionForDailyActive(client, 100, 100, (long)((ulong)client.ClientData.DailyActiveDayLginCount), "Login", out bIsCompleted); client.ClientData.DailyActiveDayLginSetFlag = true; } } }
public static void ProcessCompleteCopyMapForDailyActive(GameClient client, int nCopyMapLev, int count = 1) { if (!DailyActiveManager.IsDailyActiveCompleted(client, 500) || !DailyActiveManager.IsDailyActiveCompleted(client, 600) || !DailyActiveManager.IsDailyActiveCompleted(client, 700)) { if (nCopyMapLev >= 0) { bool bIsCompleted = false; switch (nCopyMapLev) { case 1: if (DailyActiveManager.CheckLevCondition(client, 500)) { int nNum = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteCopyMap1); nNum++; nNum *= count; DailyActiveManager.ModifyDailyActiveInfor(client, (uint)nNum, DailyActiveDataField1.DailyActiveCompleteCopyMap1, true); DailyActiveManager.CheckSingleConditionForDailyActive(client, 500, 500, (long)nNum, "KillRaid", out bIsCompleted); } break; case 2: if (DailyActiveManager.CheckLevCondition(client, 600)) { int nNum = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteCopyMap2); nNum++; nNum *= count; DailyActiveManager.ModifyDailyActiveInfor(client, (uint)nNum, DailyActiveDataField1.DailyActiveCompleteCopyMap2, true); DailyActiveManager.CheckSingleConditionForDailyActive(client, 600, 600, (long)nNum, "KillRaid", out bIsCompleted); } break; case 3: if (DailyActiveManager.CheckLevCondition(client, 700)) { int nNum = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteCopyMap3); nNum++; nNum *= count; DailyActiveManager.ModifyDailyActiveInfor(client, (uint)nNum, DailyActiveDataField1.DailyActiveCompleteCopyMap3, true); DailyActiveManager.CheckSingleConditionForDailyActive(client, 700, 700, (long)nNum, "KillRaid", out bIsCompleted); } break; } } } }
public static void ProcessCompleteDailyActivityForDailyActive(GameClient client, int nType) { if (!DailyActiveManager.IsDailyActiveCompleted(client, 800) || !DailyActiveManager.IsDailyActiveCompleted(client, 900) || !DailyActiveManager.IsDailyActiveCompleted(client, 1000)) { if (nType >= 0) { bool bIsCompleted = false; switch (nType) { case 1: if (DailyActiveManager.CheckLevCondition(client, 800)) { int nNum = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteBloodCastle); nNum++; DailyActiveManager.ModifyDailyActiveInfor(client, (uint)nNum, DailyActiveDataField1.DailyActiveCompleteBloodCastle, true); DailyActiveManager.CheckSingleConditionForDailyActive(client, 800, 800, (long)nNum, "HuoDongLimit", out bIsCompleted); } break; case 2: if (DailyActiveManager.CheckLevCondition(client, 900)) { int nNum = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteDaimonSquare); nNum++; DailyActiveManager.ModifyDailyActiveInfor(client, (uint)nNum, DailyActiveDataField1.DailyActiveCompleteDaimonSquare, true); DailyActiveManager.CheckSingleConditionForDailyActive(client, 900, 900, (long)nNum, "HuoDongLimit", out bIsCompleted); } break; case 3: if (DailyActiveManager.CheckLevCondition(client, 1000)) { int nNum = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveCompleteBattle); nNum++; DailyActiveManager.ModifyDailyActiveInfor(client, (uint)nNum, DailyActiveDataField1.DailyActiveCompleteBattle, true); DailyActiveManager.CheckSingleConditionForDailyActive(client, 1000, 1000, (long)nNum, "HuoDongLimit", out bIsCompleted); } break; } } } }
public static void ProcessBuyItemInMallForDailyActive(GameClient client, int nValue) { int xiaoFei = Global.GetRoleParamsInt32FromDB(client, "10175"); xiaoFei += nValue; if (xiaoFei >= 100) { WebOldPlayerManager.getInstance().ChouJiangAddCheck(client.ClientData.RoleID, 2); } Global.SaveRoleParamsInt32ValueToDB(client, "10175", xiaoFei, true); if (!DailyActiveManager.IsDailyActiveCompleted(client, 300)) { if (DailyActiveManager.CheckLevCondition(client, 300)) { uint nSpend = DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveBuyItemInMall); client.ClientData.DailyActiveDayBuyItemInMall += (int)(nSpend + (uint)nValue); DailyActiveManager.ModifyDailyActiveInfor(client, (uint)client.ClientData.DailyActiveDayBuyItemInMall, DailyActiveDataField1.DailyActiveBuyItemInMall, true); bool bIsCompleted = false; DailyActiveManager.CheckSingleConditionForDailyActive(client, 300, 300, (long)client.ClientData.DailyActiveDayBuyItemInMall, "Consumption", out bIsCompleted); } } }
public int GetDailyActiveValue(GameClient client) { client.ClientData.DailyActiveValues = (int)DailyActiveManager.GetDailyActiveDataByField(client, DailyActiveDataField1.DailyActiveValue); return(client.ClientData.DailyActiveValues); }