コード例 #1
0
    public static void RequestSendBookshelf(ulong BookshelfID, bool IsNewbookBookshelf, GameObject WhoBy)
    {
        if (Librarian.IDToBookShelf.ContainsKey(BookshelfID))
        {
            var Bookshelf = Librarian.IDToBookShelf[BookshelfID];
            if (IsNewbookBookshelf)
            {
                if (Bookshelf.Shelf == null)
                {
                    Logger.LogError("Bookshelf has been destroyed > " + BookshelfID, Category.VariableViewer);
                    Librarian.library.TraverseHierarchy();
                    LibraryNetMessage.Send(Librarian.library, WhoBy);
                    return;
                }

                if (Bookshelf.IsPartiallyGenerated)
                {
                    Bookshelf.PopulateBookShelf();
                }
                SubBookshelfNetMessage.Send(Bookshelf, WhoBy);
            }
            else
            {
                SubBookshelfNetMessage.Send(Bookshelf, WhoBy);
            }
        }
        else
        {
            Logger.LogError("Bookshelf ID has not been generated BookshelfID > " + BookshelfID,
                            Category.VariableViewer);
        }
    }
コード例 #2
0
    public static void RequestSendBookshelf(ulong BookshelfID, bool IsNewbookBookshelf, GameObject WhoBy)
    {
        if (Librarian.IDToBookShelf.ContainsKey(BookshelfID))
        {
            Librarian.BookShelf Bookshelf = Librarian.IDToBookShelf[BookshelfID];
            if (IsNewbookBookshelf)
            {
                if (!Bookshelf.ICustomBookshelf && Bookshelf.Shelf == null)
                {
                    Logger.LogError("Bookshelf has been destroyed > " + BookshelfID, Category.VariableViewer);
                    return;
                }

                if (Bookshelf.IsPartiallyGenerated)
                {
                    Bookshelf.PopulateBookShelf();
                }

                if (Bookshelf.ObscuredBy != null)
                {
                    SendBookShelfToClient(Bookshelf.ObscuredBy, WhoBy);
                }
            }
            else
            {
                SubBookshelfNetMessage.Send(Bookshelf);
            }
        }
        else
        {
            Logger.LogError("Bookshelf ID has not been generated BookshelfID > " + BookshelfID,
                            Category.VariableViewer);
        }
    }
コード例 #3
0
 public static void SendBookShelfToClient(Librarian.Library.LibraryBookShelf BookShelf, GameObject ToWho)
 {
     SubBookshelfNetMessage.Send(BookShelf, ToWho);
 }