private void GameHandler_DailyCheckRequest(IResponer responer, PktDailyCheckRequest vo) { var player = APlayerManager.Instance.OnGetPlayerByConn(responer.playerConnDesc); if (player == null) { return; } var pinfo = new CakeAvatar(player.psid); if (ApiDateTime.IsSameDay(pinfo.GetIntValue(ParamNameDefs.LastDailyCheckTime))) { return; } var count = pinfo.GetIntValue(ParamNameDefs.DailyCheckCount); var data = DailyCheckLoader.Instance.OnGetData(count + 1); if (data == null) { count = 1; data = DailyCheckLoader.Instance.OnGetData(count); } SCommonds.AddItem("dailycheck", player.psid, data.itemID, data.itemCount); pinfo.SetValue(ParamNameDefs.LastDailyCheckTime, ApiDateTime.SecondsFromBegin()); var pkt = new PktDailyCheckResult(); pkt.eResult = PktDailyCheckResult.EResult.Success; pkt.lItems.Add(new Int2() { int1 = data.itemID, int2 = data.itemCount }); responer.Response(pkt); }
private static void OnDailyCheckCb(PktDailyCheckResult obj) { AClientApp.clientComm.rcvDailyCheckCb(obj.eResult, obj.lItems); }