Exemplo n.º 1
0
 public void Deserialize(JSON_AppealChargeParam _json)
 {
     if (_json == null)
     {
         throw new InvalidJSONException();
     }
     this.m_AppealId  = _json.fields.appeal_id;
     this.m_BeforeImg = _json.fields.before_img_id;
     this.m_AfterImg  = _json.fields.after_img_id;
     try
     {
         if (!string.IsNullOrEmpty(_json.fields.start_at))
         {
             this.m_StartAt = TimeManager.GetUnixSec(DateTime.Parse(_json.fields.start_at));
         }
         if (string.IsNullOrEmpty(_json.fields.end_at))
         {
             return;
         }
         this.m_EndAt = TimeManager.GetUnixSec(DateTime.Parse(_json.fields.end_at));
     }
     catch (Exception ex)
     {
         DebugUtility.LogError(ex.ToString());
     }
 }
Exemplo n.º 2
0
 public bool Decerialize(int _page, FlowNode_ReqMultiInvitationHistory.Api_MultiInvitationHistory.Json json)
 {
     if (json == null || json.list == null)
     {
         return(false);
     }
     this.page  = _page;
     this.rooms = new MultiInvitationReceiveWindow.LogData.RoomData[json.list.Length];
     for (int index = 0; index < json.list.Length; ++index)
     {
         MultiInvitationReceiveWindow.LogData.RoomData roomData = new MultiInvitationReceiveWindow.LogData.RoomData();
         roomData.id        = json.list[index].id;
         roomData.roomid    = json.list[index].roomid;
         roomData.multiType = !(json.list[index].btype == "multi") ? MultiInvitationReceiveWindow.MultiType.TOWER : MultiInvitationReceiveWindow.MultiType.NORMAL;
         roomData.owner     = new MultiInvitationReceiveWindow.LogData.OwnerData(json.list[index].player);
         roomData.quest     = new MultiInvitationReceiveWindow.LogData.QuestData(json.list[index].iname);
         if (!string.IsNullOrEmpty(json.list[index].created_at))
         {
             DateTime targetTime = DateTime.Parse(json.list[index].created_at);
             roomData.created_at = TimeManager.GetUnixSec(targetTime);
         }
         this.rooms[index] = roomData;
     }
     return(true);
 }
Exemplo n.º 3
0
 public void Deserialize(JSON_FriendPresentItemParam json, MasterParam master = null)
 {
     if (json == null)
     {
         throw new InvalidJSONException();
     }
     this.m_Id   = json.iname;
     this.m_Name = json.name;
     this.m_Expr = json.expr;
     if (!string.IsNullOrEmpty(json.item))
     {
         this.m_Item = MonoSingleton <GameManager> .Instance.GetItemParam(json.item);
     }
     this.m_Num  = json.num;
     this.m_Zeny = json.zeny;
     try
     {
         if (!string.IsNullOrEmpty(json.begin_at))
         {
             this.m_BeginAt = TimeManager.GetUnixSec(DateTime.Parse(json.begin_at));
         }
         if (!string.IsNullOrEmpty(json.end_at))
         {
             this.m_EndAt = TimeManager.GetUnixSec(DateTime.Parse(json.end_at));
         }
         if (!(this.m_Id == "FP_DEFAULT"))
         {
             return;
         }
         FriendPresentItemParam.DefaultParam = this;
     }
     catch (Exception ex)
     {
         DebugUtility.LogError(ex.ToString());
     }
 }
        public void InitializeContentList()
        {
            this.ReleaseContentList();
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ContentController, (UnityEngine.Object)null))
            {
                return;
            }
            this.m_ContentSource = new MultiInvitationSendWindow.Content.ItemSource();
            List <FriendData> list     = new List <FriendData>((IEnumerable <FriendData>)MonoSingleton <GameManager> .Instance.Player.Friends);
            MyPhoton          instance = PunMonoSingleton <MyPhoton> .Instance;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance, (UnityEngine.Object)null))
            {
                List <MyPhoton.MyPlayer> roomPlayerList = instance.GetRoomPlayerList();
                for (int index1 = 0; index1 < roomPlayerList.Count; ++index1)
                {
                    if (roomPlayerList[index1] != null && !string.IsNullOrEmpty(roomPlayerList[index1].json))
                    {
                        // ISSUE: object of a compiler-generated type is created
                        // ISSUE: variable of a compiler-generated type
                        MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34A listCAnonStorey34A = new MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34A();
                        // ISSUE: reference to a compiler-generated field
                        listCAnonStorey34A.param = JSON_MyPhotonPlayerParam.Parse(roomPlayerList[index1].json);
                        // ISSUE: reference to a compiler-generated field
                        if (listCAnonStorey34A.param != null)
                        {
                            // ISSUE: reference to a compiler-generated method
                            int index2 = list.FindIndex(new Predicate <FriendData>(listCAnonStorey34A.\u003C\u003Em__3AA));
                            if (index2 != -1)
                            {
                                list.RemoveAt(index2);
                            }
                        }
                    }
                }
            }
            for (int index = 0; index < list.Count; ++index)
            {
                // ISSUE: object of a compiler-generated type is created
                // ISSUE: variable of a compiler-generated type
                MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34B listCAnonStorey34B = new MultiInvitationSendWindow.\u003CInitializeContentList\u003Ec__AnonStorey34B();
                // ISSUE: reference to a compiler-generated field
                listCAnonStorey34B.data = list[index];
                bool flag = false;
                // ISSUE: reference to a compiler-generated field
                if (listCAnonStorey34B.data != null)
                {
                    // ISSUE: reference to a compiler-generated method
                    if (MultiInvitationSendWindow.m_Invited.FindIndex(new Predicate <string>(listCAnonStorey34B.\u003C\u003Em__3AB)) != -1)
                    {
                        flag = true;
                    }
                    else
                    {
                        // ISSUE: reference to a compiler-generated field
                        if (!listCAnonStorey34B.data.MultiPush)
                        {
                            flag = true;
                        }
                        else
                        {
                            // ISSUE: reference to a compiler-generated field
                            if (TimeManager.GetUnixSec(DateTime.Now) - listCAnonStorey34B.data.LastLogin > 86400L)
                            {
                                flag = true;
                            }
                        }
                    }
                }
                else
                {
                    flag = true;
                }
                if (flag)
                {
                    list.RemoveAt(index);
                    --index;
                }
            }
            SortUtility.StableSort <FriendData>(list, (Comparison <FriendData>)((p1, p2) => (!p1.IsFavorite ? p1.LastLogin : long.MaxValue).CompareTo(!p2.IsFavorite ? p2.LastLogin : long.MaxValue)));
            list.Reverse();
            for (int index = 0; index < list.Count; ++index)
            {
                FriendData friend = list[index];
                if (friend != null)
                {
                    MultiInvitationSendWindow.Content.ItemSource.ItemParam itemParam = new MultiInvitationSendWindow.Content.ItemSource.ItemParam(friend);
                    if (itemParam.IsValid())
                    {
                        this.m_ContentSource.Add(itemParam);
                    }
                }
            }
            this.m_ContentController.Initialize((ContentSource)this.m_ContentSource, Vector2.get_zero());
        }
        public void InitializeContentList()
        {
            this.ReleaseContentList();
            if (!UnityEngine.Object.op_Inequality((UnityEngine.Object) this.m_ContentController, (UnityEngine.Object)null))
            {
                return;
            }
            this.m_ContentSource = new MultiInvitationSendWindow.Content.ItemSource();
            List <FriendData> list     = new List <FriendData>((IEnumerable <FriendData>)MonoSingleton <GameManager> .Instance.Player.Friends);
            MyPhoton          instance = PunMonoSingleton <MyPhoton> .Instance;

            if (UnityEngine.Object.op_Inequality((UnityEngine.Object)instance, (UnityEngine.Object)null))
            {
                List <MyPhoton.MyPlayer> roomPlayerList = instance.GetRoomPlayerList();
                for (int index1 = 0; index1 < roomPlayerList.Count; ++index1)
                {
                    if (roomPlayerList[index1] != null && !string.IsNullOrEmpty(roomPlayerList[index1].json))
                    {
                        JSON_MyPhotonPlayerParam param = JSON_MyPhotonPlayerParam.Parse(roomPlayerList[index1].json);
                        if (param != null)
                        {
                            int index2 = list.FindIndex((Predicate <FriendData>)(prop => prop.UID == param.UID));
                            if (index2 != -1)
                            {
                                list.RemoveAt(index2);
                            }
                        }
                    }
                }
            }
            for (int index = 0; index < list.Count; ++index)
            {
                FriendData data = list[index];
                bool       flag = false;
                if (data != null)
                {
                    if (MultiInvitationSendWindow.m_Invited.FindIndex((Predicate <string>)(prop => prop == data.UID)) != -1)
                    {
                        flag = true;
                    }
                    else if (!data.MultiPush)
                    {
                        flag = true;
                    }
                    else if (TimeManager.GetUnixSec(DateTime.Now) - data.LastLogin > 86400L)
                    {
                        flag = true;
                    }
                }
                else
                {
                    flag = true;
                }
                if (flag)
                {
                    list.RemoveAt(index);
                    --index;
                }
            }
            SortUtility.StableSort <FriendData>(list, (Comparison <FriendData>)((p1, p2) => (!p1.IsFavorite ? p1.LastLogin : long.MaxValue).CompareTo(!p2.IsFavorite ? p2.LastLogin : long.MaxValue)));
            list.Reverse();
            for (int index = 0; index < list.Count; ++index)
            {
                FriendData friend = list[index];
                if (friend != null)
                {
                    MultiInvitationSendWindow.Content.ItemSource.ItemParam itemParam = new MultiInvitationSendWindow.Content.ItemSource.ItemParam(friend);
                    if (itemParam.IsValid())
                    {
                        this.m_ContentSource.Add(itemParam);
                    }
                }
            }
            this.m_ContentController.Initialize((ContentSource)this.m_ContentSource, Vector2.get_zero());
        }