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); } }
public static BookshelfNetMessage Send(Librarian.BookShelf _BookShelf, GameObject ToWho) { BookshelfNetMessage msg = new BookshelfNetMessage(); msg.data = VariableViewerNetworking.ProcessBookShelf(_BookShelf); msg.SendTo(ToWho); return(msg); }
public static NetFriendlyBookShelf ProcessSUBBookShelf(Librarian.BookShelf _BookShelf) { if (_BookShelf.IsPartiallyGenerated) { Librarian.PopulateBookShelf(_BookShelf); } NetFriendlyBookShelf BookShelf = new NetFriendlyBookShelf { ID = _BookShelf.ID, SN = _BookShelf.ShelfName, IE = _BookShelf.IsEnabled, }; List <IDnName> lisofIDnName = new List <IDnName>(); foreach (var ObscuredBookShelve in _BookShelf.ObscuredBookShelves) { IDnName _IDnName = new IDnName { ID = ObscuredBookShelve.ID, SN = ObscuredBookShelve.ShelfName }; if (_IDnName.SN == null) { _IDnName.SN = "null"; } lisofIDnName.Add(_IDnName); } BookShelf.OBS = lisofIDnName.ToArray(); List <IDnName> _lisofIDnName = new List <IDnName>(); foreach (var HeldBook in _BookShelf.HeldBooks) { IDnName _IDnName = new IDnName { ID = HeldBook.ID, SN = HeldBook.BookClass.GetType().Name }; if (_IDnName.SN == null) { _IDnName.SN = "null"; } _lisofIDnName.Add(_IDnName); } BookShelf.HB = _lisofIDnName.ToArray(); BookShelf.OB = new IDnName { ID = _BookShelf.ObscuredBy.ID, SN = _BookShelf.ObscuredBy.ShelfName, }; return(BookShelf); }
public static NetMessage Send(Librarian.BookShelf _BookShelf) { NetMessage msg = new NetMessage() { BookShelf = VariableViewerNetworking.ProcessSUBBookShelf(_BookShelf) }; SendToAll(msg); return(msg); }
public static SubBookshelfNetMessage Send(Librarian.BookShelf _BookShelf) { SubBookshelfNetMessage msg = new SubBookshelfNetMessage() { BookShelf = VariableViewerNetworking.ProcessSUBBookShelf(_BookShelf) }; msg.SendToAll(); return(msg); }
public static IDnName ProcessBookShelfToID(Librarian.BookShelf _BookShelf) { IDnName _IDnName = new IDnName { ID = _BookShelf.ID, SN = _BookShelf.ShelfName, }; if (_IDnName.SN == null) { _IDnName.SN = "null"; } return(_IDnName); }
public static SubBookshelfNetMessage Send(Librarian.BookShelf _BookShelf) { SubBookshelfNetMessage msg = new SubBookshelfNetMessage() { BookShelf = VariableViewerNetworking.ProcessSUBBookShelf(_BookShelf) }; //VariableViewerNetworking.NetFriendlyBookShelf bookshedl = ; //Logger.Log(bookshedl.OBS.Length.ToString() + " << YY"); //msg.BookShelf = bookshedl; //msg.data = JsonConvert.SerializeObject(bookshedl); //Logger.Log(msg.data); msg.SendToAll(); return(msg); }
public static NetFriendlyBookShelfView ProcessBookShelf(Librarian.BookShelf _BookShelf) { NetFriendlyBookShelfView TopBookShelf = new NetFriendlyBookShelfView { ID = _BookShelf.ID }; List <IDnName> NetFriendlyBookShelfs = new List <IDnName>(); if (_BookShelf.IsPartiallyGenerated) { Librarian.PopulateBookShelf(_BookShelf); } foreach (var ObscuredBookShelve in _BookShelf.ObscuredBookShelves) { NetFriendlyBookShelfs.Add(ProcessBookShelfToID(ObscuredBookShelve)); } TopBookShelf.HeldShelfIDs = NetFriendlyBookShelfs.ToArray(); return(TopBookShelf); }
public static void SendBookShelfToClient(Librarian.BookShelf BookShelf, GameObject ToWho) { BookShelf.UpdateBookShelf(); BookshelfNetMessage.Send(BookShelf, ToWho); }
public static void SendBookShelfToClient(Librarian.BookShelf BookShelf) { BookShelf.UpdateBookShelf(); BookshelfNetMessage.Send(BookShelf); }