Exemple #1
0
    //保存自己发送的消息
    void SaveSelfChatData(string content, ChatType chattype)
    {
        ChatData chatData = new ChatData();

        chatData.Id        = playerData.GetInstance().selfData.playerId;
        chatData.AccountId = playerData.GetInstance().selfData.accountId;
        chatData.HeadId    = GameLibrary.player;
        chatData.Vip       = playerData.GetInstance().selfData.vip;
        if (chatData.Vip > 99)
        {
            chatData.Vip = 1;//vip等级超过三位设置为1
        }
        chatData.NickName     = playerData.GetInstance().selfData.playeName;
        chatData.ChatContent  = content; //聊天内容
        chatData.SpeakingTime = Auxiliary.GetNowTime();
        chatData.Time         = Convert.ToDateTime(PropertyManager.ConvertIntDateTime(chatData.SpeakingTime)).ToString("HH:mm");
        if (chatData.Id == playerData.GetInstance().selfData.playerId)
        {
            chatData.IsLocalPlayer = true;
        }
        else
        {
            chatData.IsLocalPlayer = false;
        }
        chatData.ContentType = ChatContentType.TextContent;
        chatData.Type        = chattype;
        SocietyManager.Single().selfChatData = chatData;
    }
Exemple #2
0
    private void SetTitleString(int index)
    {
        switch (index)
        {
        case 0:
            int month = 0;
            month         = PropertyManager.ConvertIntDateTime(Auxiliary.GetNowTime()).Month;
            titleLab.text = month + "月签到";
            break;

        case 1:
            titleLab.text = "补充体力";
            break;

        case 2:
            titleLab.text = "升级大礼";
            break;

        case 3:
            titleLab.text = "在线奖励";
            break;

        case 4:
            titleLab.text = "登录礼包";
            break;

        case 5:
            titleLab.text = "激活码";
            break;

        default:
            titleLab.text = "福利";
            break;
        }
    }
Exemple #3
0
    void Update()
    {
        //currentTime.text = PropertyManager.Instance.GetGameTime(PropertyManager.Instance.dGameTime);
        currentTime.text = PropertyManager.Instance.GetGameTime(PropertyManager.ConvertIntDateTime(Auxiliary.GetNowTime()));
        switch (this.type)
        {
        case ActionPointType.Vitality:
            //读取一下信息 TODO
            //Debug.Log(TimeManager.Instance.GetMilliTimeClockText(PropertyManager.Instance.vitalityTime));
            //nextTime.text = PropertyManager.Instance.GetTimeSpanTime(PropertyManager.Instance.oneVitalityRemainTime);
            nextTime.text    = TimeManager.Instance.GetMilliTimeClockText(playerData.GetInstance().actionData.vitalityTime);
            allTime.text     = TimeManager.Instance.GetMilliTimeClockText(playerData.GetInstance().actionData.allVitalityTime);
            buyCount.text    = playerData.GetInstance().actionData.vitalityBuyTimes.ToString();
            time.text        = playerData.GetInstance().actionData.vitalityTimeBucket + "分钟";
            singleLabel.text = "下次活力恢复";
            allLabel.text    = "恢复全部活力";
            break;

        case ActionPointType.Energy:
            nextTime.text    = TimeManager.Instance.GetMilliTimeClockText(playerData.GetInstance().actionData.energyTime);
            allTime.text     = TimeManager.Instance.GetMilliTimeClockText(playerData.GetInstance().actionData.allEnergyTime);
            buyCount.text    = playerData.GetInstance().actionData.energyBuyTimes.ToString();
            time.text        = playerData.GetInstance().actionData.energyTimeBucket + "分钟";
            singleLabel.text = "下次体力恢复";
            allLabel.text    = "恢复全部体力";
            break;

        default:
            break;
        }
    }
Exemple #4
0
 void Update()
 {
     if (index == Globe.selectMailIndex)
     {
         iconSprite.spriteName = "banzixuanzhong";
     }
     else
     {
         iconSprite.spriteName = "";
     }
     if (index == 0)
     {
         mailStateIcon.spriteName = "yidu";
     }
     if (mailItem.EndTime > Auxiliary.GetNowTime())
     {
         TimeSpan residueTime = PropertyManager.ConvertIntDateTime(mailItem.EndTime) - PropertyManager.ConvertIntDateTime(Auxiliary.GetNowTime());
         if (residueDay > residueTime.Days)
         {
             residueDay = residueTime.Days;
             if (residueDay <= 0)
             {
                 deleteDate.text = "1天后过期";
             }
             else
             {
                 deleteDate.text = residueDay + "天后过期";
             }
         }
     }
     else//邮件结束时间大于当前系统时间删除本地邮件 服务器处理方式是:再次去获取全部邮件的时候才触发删除到期邮件
     {
         playerData.GetInstance().RemoveSingleMailItem(mailItem.Id);
     }
 }
Exemple #5
0
 public void ShowTime()
 {
     if (PropertyManager.ConvertIntDateTime(Auxiliary.GetNowTime()).Hour >= 21 && PropertyManager.ConvertIntDateTime(Auxiliary.GetNowTime()).Hour < 24)//服务器发的当前时间大于晚上9点时改变现实状态为晚上
     {
         timeTxt.text = "明日" + Convert.ToDateTime(PropertyManager.ConvertIntDateTime(playerData.GetInstance().lotteryInfo.shopTime)).ToString("HH") + "点自动刷新" + TimeManager.Instance.GetTimeClockText(lostTime);
     }
     else
     {
         timeTxt.text = "今日" + Convert.ToDateTime(PropertyManager.ConvertIntDateTime(playerData.GetInstance().lotteryInfo.shopTime)).ToString("HH") + "点自动刷新" + TimeManager.Instance.GetTimeClockText(lostTime);
     }
     if (lostTime <= 0)
     {
         ClientSendDataMgr.GetSingle().GetCShopSend().RefreshGoodsList(_index, 0, 0);//到时间后手动刷新商店列表
         lostTime = 1;
     }
 }
Exemple #6
0
    public override void Info(object obj)
    {
        base.Info(obj);
        if (index == Globe.selectMailIndex)
        {
            MailDetail.Instance.setMailItemObj(this.gameObject);
        }
        mailItem       = obj as MailItemData;
        mailTitle.text = mailItem.Title;
        //是否有附件
        if (mailItem.accessoryDataList.Count > 0 && mailItem.IsHaveGetGoods == 1)
        {
            accessoryIcon.gameObject.SetActive(true);
        }
        else
        {
            accessoryIcon.gameObject.SetActive(false);
        }
        //是否是重要邮件TODO

        //是否已读 1 新邮件,0已读邮件
        if (mailItem.NewMailFlag == 1)
        {
            mailStateIcon.spriteName = "weidu";
        }
        else
        {
            mailStateIcon.spriteName = "yidu";
        }

        residueDay = (PropertyManager.ConvertIntDateTime(mailItem.EndTime) - PropertyManager.ConvertIntDateTime(Auxiliary.GetNowTime())).Days;
        if (residueDay <= 0)
        {
            deleteDate.text = "1天后过期";
        }
        else
        {
            deleteDate.text = residueDay + "天后过期";
        }
    }
Exemple #7
0
    /// <summary>
    /// 动态生成Item
    /// </summary>
    public void InitSignInItemData()
    {
        int month = 0;
        int year  = 0;

        month = PropertyManager.ConvertIntDateTime(Auxiliary.GetNowTime()).Month;
        year  = PropertyManager.ConvertIntDateTime(Auxiliary.GetNowTime()).Year;

        if ((year % 4 == 0 && year % 100 != 0) || year % 400 == 0)
        {
            goodsMultList.InSize(GetYearDay(month), 5);
            goodsMultList.Info(itemRankList.ToArray());
        }
        else
        {
            if (month == 2)
            {
                goodsMultList.InSize(28, 5);
                goodsMultList.Info(itemRankList.ToArray());
            }
        }
        if (FSDataNodeTable <VipNode> .GetSingleton().DataNodeList.ContainsKey(playerData.GetInstance().selfData.vip))
        {
            sign_inReplenishMax.text = FSDataNodeTable <VipNode> .GetSingleton().DataNodeList[playerData.GetInstance().selfData.vip].retroactive_limit.ToString();
        }
        memberLevle.text          = playerData.GetInstance().selfData.vip.ToString();
        accumulateSign_inNum.text = int.Parse(playerData.GetInstance().singnData.Signed.Substring(6, 2)) + "天";
        Debug.Log(playerData.GetInstance().singnData.Signed);
        if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(6, 2)) >= 3)
        {
            if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(8, 1)) == 0)
            {
                ThreeDay.transform.gameObject.SetActive(true);
            }
            else
            {
                ThreeDay.transform.gameObject.SetActive(false);
            }
        }
        if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(6, 2)) >= 7)
        {
            if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(9, 1)) == 0)
            {
                SevenDay.transform.gameObject.SetActive(true);
            }
            else
            {
                SevenDay.transform.gameObject.SetActive(false);
            }
        }
        if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(6, 2)) >= 15)
        {
            if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(10, 1)) == 0)
            {
                FifteenDay.transform.gameObject.SetActive(true);
            }
            else
            {
                FifteenDay.transform.gameObject.SetActive(false);
            }
        }
        if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(6, 2)) >= 28)
        {
            if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(11, 1)) == 0)
            {
                eightDay.transform.gameObject.SetActive(true);
            }
            else
            {
                eightDay.transform.gameObject.SetActive(false);
            }
        }
        if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(8, 1)) != 0)
        {
            ThreeDayOK.transform.gameObject.SetActive(true);
        }
        if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(9, 1)) != 0)
        {
            SevenDayOK.transform.gameObject.SetActive(true);
        }
        if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(10, 1)) != 0)
        {
            FifteenDayOK.transform.gameObject.SetActive(true);
        }
        if (int.Parse(playerData.GetInstance().singnData.Signed.Substring(11, 1)) != 0)
        {
            EightDayOK.transform.gameObject.SetActive(true);
        }
        foreach (var item in FSDataNodeTable <UISign_inNode> .GetSingleton().DataNodeList.Values)
        {
            if (item.reward_prop != null)
            {
                string goodsID    = item.reward_prop[0].ToString();
                int    goodsIDNum = int.Parse(goodsID.Substring(0, 3));
                if (goodsIDNum == 107)
                {
                    InsHero(GameLibrary.Instance().ItemStateList[item.reward_prop[0]].icon_name);
                    heroName.text = GameLibrary.Instance().ItemStateList[item.reward_prop[0]].name.ToString();
                    long heroID = long.Parse(item.reward_prop[0].ToString().Replace("107", "201"));
                    foreach (var heroitem in FSDataNodeTable <HeroNode> .GetSingleton().DataNodeList.Values)
                    {
                        if (heroID == heroitem.hero_id)
                        {
                            star.IsShow("xing-hui", "xing", heroitem.init_star);
                            heroType.spriteName = GetHeroType(heroitem.attribute);
                        }
                    }
                }
            }
        }
        if (FSDataNodeTable <VipNode> .GetSingleton().DataNodeList[playerData.GetInstance().selfData.vip].retroactive_limit - int.Parse(playerData.GetInstance().singnData.Signed.Substring(12, 2)) > 0)
        {
            sign_inReplenishNum.text = (FSDataNodeTable <VipNode> .GetSingleton().DataNodeList[playerData.GetInstance().selfData.vip].retroactive_limit - int.Parse(playerData.GetInstance().singnData.Signed.Substring(12, 2))).ToString();
        }
        else
        {
            sign_inReplenishNum.text = "0";
        }
        CcumulateSign_inInit();
    }
Exemple #8
0
    private bool HaveNewChatResult(CReadPacket packet)
    {
        Debug.Log("HaveNewChatResult");
        //{msgid=4703,pid=发言者ID,pn=发言者昵称,pp=发言者头像,pv=发言者VIP等级,tp=聊天类型,ct=发言时间}
        //tp 聊天类型 1世界聊天 2公会聊天 3私聊 4附近聊天 5队伍聊天 6系统
        Dictionary <string, object> data = packet.data;

        ChatData chatData = new ChatData();

        chatData.Id        = long.Parse(data["pid"].ToString());
        chatData.AccountId = long.Parse(data["aid"].ToString());
        chatData.HeadId    = long.Parse(data["pp"].ToString());
        chatData.Vip       = int.Parse(data["pv"].ToString());
        if (chatData.Vip > 99)
        {
            chatData.Vip = 1;//vip等级超过三位设置为1
        }
        chatData.NickName     = data["pn"].ToString();
        chatData.ChatContent  = data["c"].ToString(); //聊天内容
        chatData.SpeakingTime = long.Parse(data["ct"].ToString());
        chatData.Time         = Convert.ToDateTime(PropertyManager.ConvertIntDateTime(chatData.SpeakingTime)).ToString("HH:mm");
        if (chatData.Id == playerData.GetInstance().selfData.playerId)
        {
            chatData.IsLocalPlayer = true;
        }
        else
        {
            chatData.IsLocalPlayer = false;
        }
        chatData.ContentType = ChatContentType.TextContent;
        switch (int.Parse(data["tp"].ToString()))
        {
        case 1:
            chatData.Type = ChatType.WorldChat;
            //playerData.GetInstance().iChat.worldChatList.Add(chatData);
            break;

        case 2:
            chatData.Type = ChatType.SocietyChat;
            //playerData.GetInstance().iChat.societyChatList.Add(chatData);
            break;

        case 3:
            chatData.Type = ChatType.PrivateChat;
            //私聊在其他频道都可以看到
            //playerData.GetInstance().iChat.privateChatList.Add(chatData);

            //playerData.GetInstance().iChat.worldChatList.Add(chatData);
            //playerData.GetInstance().iChat.societyChatList.Add(chatData);
            //playerData.GetInstance().iChat.nearbyChatList.Add(chatData);
            //playerData.GetInstance().iChat.troopsChatList.Add(chatData);
            //playerData.GetInstance().iChat.systemChatList.Add(chatData);
            break;

        case 4:
            chatData.Type = ChatType.NearbyChat;
            //playerData.GetInstance().iChat.nearbyChatList.Add(chatData);
            break;

        case 5:
            chatData.Type = ChatType.TroopsChat;
            //playerData.GetInstance().iChat.troopsChatList.Add(chatData);
            break;

        case 6:
            chatData.Type = ChatType.SystemChat;
            //playerData.GetInstance().iChat.systemChatList.Add(chatData);
            break;

        default:
            break;
        }
        //暂时聊天只在主城可见 避免在战斗的时候null
        if (SceneManager.GetActiveScene().name == GameLibrary.UI_Major)
        {
            playerData.GetInstance().AddChatInfoToList(chatData);
            //UIChatPanel.Instance.AddChatInfoToList(chatData);
        }
        //界面单条聊天显示
        //playerData.GetInstance().NewChatHandler(chatData);
        return(true);
    }