void LoadPlayer(string userid) { if (!storedData.knownPlayers.Contains(userid)) { storedData.knownPlayers.Add(userid); } string path = subDirectory + userid; if (datafile.ExistsDatafile(path)) { } object profile; try { profile = datafile.ReadObject <Dictionary <string, Dictionary <string, object> > >(path); } catch (Exception exception) { profile = new Dictionary <string, object>(); datafile.WriteObject <Dictionary <string, Dictionary <string, object> > >(path, new Dictionary <string, Dictionary <string, object> >()); } playersData[userid] = profile as Dictionary <string, Dictionary <string, object> >; }
////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Placeback ////////////////////////////////////////////////////////////////////////////////////////////////////////////// object TryPlaceback(string filename, BasePlayer player, string[] args) { string path = subDirectory + filename; if (datafile.ExistsDatafile(path)) { } var data = Interface.GetMod().DataFileSystem.GetDatafile(path); if (data["default"] == null || data["entities"] == null) { return(GetMsg("This file is empty.", player.userID.ToString())); } var defaultdata = data["default"] as Dictionary <string, object>; var pos = defaultdata["position"] as Dictionary <string, object>; var startPos = new Vector3(Convert.ToSingle(pos["x"]), Convert.ToSingle(pos["y"]), Convert.ToSingle(pos["z"])); var RotationCorrection = Convert.ToSingle(defaultdata["rotationdiff"]); return(TryPaste(startPos, filename, player, RotationCorrection, args)); }
void LoadPlayerData(string userid) { if (!storedData.knownPlayers.Contains(userid)) { storedData.knownPlayers.Add(userid); } string path = subDirectory + userid; if (datafile.ExistsDatafile(path)) { } DynamicConfigFile profile = Interface.GetMod().DataFileSystem.GetDatafile(path); playersData[userid] = profile; }