1. Hello! Guys tell me please how import player blueprints from the player.blueprints.db file to data file in folder oxide\data ?
    P.S: I'm a beginner plugin developer. Sorry for my bad english.
     
  2. Wulf

    Wulf Community Admin

    What data file are you trying to import to? Oxide doesn't have any blueprint data.
     
  3. If I am not mistaken then all the blueprints of the players saved in the file player.blueprints.1.db.
     
  4. Wulf

    Wulf Community Admin

    That wouldn't be from Oxide and wouldn't be under oxide/data.
     
  5. I understand, I want to make a plugin which would put drawings from a DataBase file in my created file in the folder oxide/data
     
  6. Wulf

    Wulf Community Admin

    I'd suggest opening a plugin request if you aren't familiar with how to work with SQLite using the provided API and/or what Rust has available.
     
  7. Okay, then another question. I want to save the blueprints of the players before the global wipe servers. That's how I find drawings in sleeping and active players.
    Code:
    void FindBP(BasePlayer player)
            {           
                foreach (var aplayer in BasePlayer.activePlayerList)
                BpListSave(aplayer.userID);
                foreach (var splayer in BasePlayer.sleepingPlayerList)
                BpListSave(splayer.userID);
                
            }
    void BpListSave(ulong steamID)
            {
                if(!storedlist.PlayerBlueprint.ContainsKey(steamID))
                    storedlist.PlayerBlueprint.Add(steamID, new List<int>());
                
                PersistantPlayer playerInfo = SingletonComponent<ServerMgr>.Instance.persistance.GetPlayerInfo(steamID);
                foreach (var bp in playerInfo.unlockedItems)
                    if(!storedlist.PlayerBlueprint[steamID].Contains(bp))
                        storedlist.PlayerBlueprint[steamID].Add(bp);
                SaveData();
            }
    But I faced a problem if the player was killed and didn't come on the server any more, then I can't define it. Can you tell how to read the drawings from killed players? Or how to determine all the players who ever came to the server?
     
  8. Google “BPSync Rust”, that plugin has a command “bpsync.syncall” where you can push all locally stored BPs to a MySQL DB to persist past global BP wipes.
     
  9. It's very cool, but I'm not looking for a ready-made option, I want to figure out and do a similar one myself.
     
  10. You can find all players in
    Code:
    covalence.Players.All
    but it's contains even very old players, which you don't want to sync I guess, so the fastest way by my opinion it store all players in db, and then just return all blueprints whenever you want to.
    But keep in mind, Rust already stores players in db, so you will do almost the same thing, instead of combine db or something else.
    Anyway, if you'll use another thread for sql requests, this won't cause any server performance issues.
     
  11. Wulf

    Wulf Community Admin

    covalence.Players would be all you need.
     
  12. Ok, thanks guys, I'll try