public override void OnClose() { _tileEntity.SetModified(); _tileEntity.SetUserAccessing(false); GameManager.Instance.TEUnlockServer(_tileEntity.GetChunk().ClrIdx, _tileEntity.ToWorldPos(), _tileEntity.entityId); base.OnClose(); xui.playerUI.entityPlayer.PlayOneShot("close_sign"); if (!string.IsNullOrEmpty(textInput.Text)) { SetText(textInput.Text, true); } else { SetText("Storage", true); } }
public override void Execute(List <string> _params, CommandSenderInfo _senderInfo) { try { if (_params.Count != 1) { SingletonMonoBehaviour <SdtdConsole> .Instance.Output(string.Format("[SERVERTOOLS] Wrong number of arguments, expected 1, found '{0}'", _params.Count)); return; } if (!string.IsNullOrEmpty(_senderInfo.RemoteClientInfo.CrossplatformId.CombinedString)) { LinkedList <Chunk> chunkArray = new LinkedList <Chunk>(); DictionaryList <Vector3i, TileEntity> tiles = new DictionaryList <Vector3i, TileEntity>(); ChunkClusterList chunklist = GameManager.Instance.World.ChunkClusters; for (int i = 0; i < chunklist.Count; i++) { ChunkCluster chunk = chunklist[i]; chunkArray = chunk.GetChunkArray(); foreach (Chunk _c in chunkArray) { tiles = _c.GetTileEntities(); foreach (TileEntity tile in tiles.dict.Values) { TileEntityType type = tile.GetTileEntityType(); if (type.ToString().Equals("SecureLoot")) { TileEntitySecureLootContainer SecureLoot = (TileEntitySecureLootContainer)tile; if (!SecureLoot.IsUserAllowed(_senderInfo.RemoteClientInfo.CrossplatformId)) { List <PlatformUserIdentifierAbs> _users = SecureLoot.GetUsers(); _users.Add(_senderInfo.RemoteClientInfo.CrossplatformId); SecureLoot.SetModified(); } } } } } } SingletonMonoBehaviour <SdtdConsole> .Instance.Output(string.Format("[SERVERTOOLS] Secure loot access set for '{0}' in all loaded areas. Unloaded areas have not changed", _senderInfo.RemoteClientInfo.CrossplatformId.CombinedString)); } catch (Exception e) { Log.Out(string.Format("[SERVERTOOLS] Error in SecureLootAccessConsole.Execute: {0}", e.Message)); } }