From a804769abd49c2566e15cf25713b66de36e28bef Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Florian=20N=C3=BCcke?= Date: Sat, 3 Jan 2015 02:06:22 +0100 Subject: [PATCH] Killed remote terminals. More power to tablets! --- .../li/cil/oc/api/internal/ServerRack.java | 5 - .../assets/opencomputers/lang/de_DE.lang | 8 +- .../assets/opencomputers/lang/en_US.lang | 11 +- .../assets/opencomputers/lang/fr_FR.lang | 8 +- .../assets/opencomputers/lang/it_IT.lang | 10 +- .../assets/opencomputers/lang/ru_RU.lang | 8 +- .../assets/opencomputers/lang/zh_CN.lang | 8 +- .../assets/opencomputers/lang/zh_TW.lang | 8 +- .../opencomputers/models/item/terminal.json | 6 - .../opencomputers/recipes/default.recipes | 5 - .../opencomputers/recipes/hardmode.recipes | 5 - .../textures/gui/button_range.png | Bin 177 -> 0 bytes .../opencomputers/textures/gui/range.png | Bin 144 -> 0 bytes .../opencomputers/textures/items/terminal.png | Bin 294 -> 0 bytes .../textures/items/terminalOff.png | Bin 282 -> 0 bytes .../textures/items/terminalOn.png | Bin 306 -> 0 bytes .../textures/items/terminalOn.png.mcmeta | 6 - src/main/scala/li/cil/oc/Localization.scala | 8 -- src/main/scala/li/cil/oc/Settings.scala | 7 -- .../scala/li/cil/oc/client/GuiHandler.scala | 37 ------ .../li/cil/oc/client/PacketHandler.scala | 15 +-- .../scala/li/cil/oc/client/PacketSender.scala | 9 -- .../scala/li/cil/oc/client/Textures.scala | 2 - .../li/cil/oc/client/gui/ServerRack.scala | 48 -------- src/main/scala/li/cil/oc/common/GuiType.scala | 47 ++++---- .../scala/li/cil/oc/common/PacketType.scala | 1 - src/main/scala/li/cil/oc/common/Proxy.scala | 2 +- .../li/cil/oc/common/component/Terminal.scala | 90 --------------- .../scala/li/cil/oc/common/init/Items.scala | 2 - .../scala/li/cil/oc/common/item/Present.scala | 1 - .../scala/li/cil/oc/common/item/Server.scala | 2 - .../li/cil/oc/common/item/Terminal.scala | 105 ------------------ .../cil/oc/common/tileentity/ServerRack.scala | 58 +--------- .../li/cil/oc/server/PacketHandler.scala | 13 --- .../scala/li/cil/oc/server/PacketSender.scala | 15 --- 35 files changed, 42 insertions(+), 508 deletions(-) delete mode 100644 src/main/resources/assets/opencomputers/models/item/terminal.json delete mode 100644 src/main/resources/assets/opencomputers/textures/gui/button_range.png delete mode 100644 src/main/resources/assets/opencomputers/textures/gui/range.png delete mode 100644 src/main/resources/assets/opencomputers/textures/items/terminal.png delete mode 100644 src/main/resources/assets/opencomputers/textures/items/terminalOff.png delete mode 100644 src/main/resources/assets/opencomputers/textures/items/terminalOn.png delete mode 100644 src/main/resources/assets/opencomputers/textures/items/terminalOn.png.mcmeta delete mode 100644 src/main/scala/li/cil/oc/common/component/Terminal.scala delete mode 100644 src/main/scala/li/cil/oc/common/item/Terminal.scala diff --git a/src/main/java/li/cil/oc/api/internal/ServerRack.java b/src/main/java/li/cil/oc/api/internal/ServerRack.java index 46447ed45..4776ce4b4 100644 --- a/src/main/java/li/cil/oc/api/internal/ServerRack.java +++ b/src/main/java/li/cil/oc/api/internal/ServerRack.java @@ -30,9 +30,4 @@ public interface ServerRack extends Environment, SidedEnvironment, Rotatable, II * @return the machine currently hosted in the specified slot. */ Server server(int slot); - - /** - * The currently set wireless range in which remote terminals work. - */ - int range(); } diff --git a/src/main/resources/assets/opencomputers/lang/de_DE.lang b/src/main/resources/assets/opencomputers/lang/de_DE.lang index 71bd3f583..daa8decc1 100644 --- a/src/main/resources/assets/opencomputers/lang/de_DE.lang +++ b/src/main/resources/assets/opencomputers/lang/de_DE.lang @@ -82,7 +82,6 @@ item.oc.Server2.name=Server (Stufe 3) item.oc.Server3.name=Server (Kreativ) item.oc.Tablet.name=Tablet item.oc.TabletCase.name=Tablet-Gehäuse -item.oc.Terminal.name=Fernbedienung item.oc.Transistor.name=Transistor item.oc.UpgradeAngel.name=Schwebe-Upgrade item.oc.UpgradeBattery0.name=Akku-Upgrade (Stufe 1) @@ -162,8 +161,6 @@ oc:gui.ServerRack.WirelessRange=Reichweite oc:gui.Switch.TransferRate=Taktung oc:gui.Switch.PacketsPerCycle=Pakete / Zyklus oc:gui.Switch.QueueSize=Puffergröße -oc:gui.Terminal.InvalidKey=Ungültiger Schlüssel, vermutlich wurde eine andere Fernbedienung an den Server gebunden. -oc:gui.Terminal.OutOfRange=Kein Signal. # Containers oc:container.AccessPoint=Access Point @@ -243,13 +240,12 @@ oc:tooltip.Robot=Im Gegensatz zu normalen Computern können sich Roboter in der oc:tooltip.Robot_Level=§fStufe§7: §a%s§7. oc:tooltip.Robot_StoredEnergy=§fGespeicherte Energie§7: §a%s§7. oc:tooltip.Screen=Zeigt Text an, gesteuert von Grafikkarten in Computern.[nl] Höchstauflösung: §f%sx%s§7[nl] Maximale Farbtiefe: §f%s§7 -oc:tooltip.Server=Ein Server kann wie ein gewöhnliches Computergehäuse mit Komponenten verbessert werden. Um den Server zu starten, muss er in einem Servergehäuse installiert werden.[nl] Anzahl unterstützter Fernbedienungen: §f%s§7 +oc:tooltip.Server=Ein Server kann wie ein gewöhnliches Computergehäuse mit Komponenten verbessert werden. Um den Server zu starten, muss er in einem Servergehäuse installiert werden. oc:tooltip.Server.Components=Installierte Komponenten: -oc:tooltip.ServerRack=Erlaubt die Installation von bis zu vier Servern. Stellt für jeden eingebauten Server eine virtuelle Tastatur- und Bildschirmkomponente zur Verfügung, welche je eine Fernbedienung repräsentieren. +oc:tooltip.ServerRack=Erlaubt die Installation von bis zu vier Servern. Server müssen konfiguriert werden bevor sie in einem Rack brauchbar sind. oc:tooltip.Switch=Erlaubt es, mehrere Netzwerke miteinander zu verbinden. Leitet ausschließlich Netzwerknachrichten weiter, Komponenten "hinter" dem Switch sind nicht sichtbar. Nützlich, um Netzwerke zu trennen, jedoch nach wie vor Kommunikation zwischen den Netzwerken zu erlauben, z.b. mittels Netzwerkkarten. oc:tooltip.Tablet=Ein Tablet-PC, für Lua unterwegs. Kann durch Sneak-Aktivierung zwangsgestoppt werden. oc:tooltip.TabletCase=Einfaches Gehäuse für Tablet-PCs. Kann in der Elektronik-Werkbank mit Komponenten bestückt werden, um einen Tablet-PC zu fertigen. -oc:tooltip.Terminal=Erlaubt es, einen Server aus der Ferne zu steuern, so lange man sich in Reichweite des Servers befindet. Verhält sich wie Bildschirm und Tastatur in einem. Kann mit Shift-Rechtsklick an einen Server in einem Serverschrank gebunden werden. oc:tooltip.Tier=§8Stufe %s oc:tooltip.TooLong=Halte [§f%s§7] gedrückt für mehr Infos. oc:tooltip.Transistor=Elementarer Baustein der meisten Computerkomponenten. Nicht zu verwechseln mit Steinelementaren. diff --git a/src/main/resources/assets/opencomputers/lang/en_US.lang b/src/main/resources/assets/opencomputers/lang/en_US.lang index b30fc9db6..6ebc63b18 100644 --- a/src/main/resources/assets/opencomputers/lang/en_US.lang +++ b/src/main/resources/assets/opencomputers/lang/en_US.lang @@ -93,7 +93,6 @@ item.oc.Server2.name=Server (Tier 3) item.oc.Server3.name=Server (Creative) item.oc.Tablet.name=Tablet item.oc.TabletCase.name=Tablet Case -item.oc.Terminal.name=Remote Terminal item.oc.Transistor.name=Transistor item.oc.UpgradeAngel.name=Angel Upgrade item.oc.UpgradeBattery0.name=Battery Upgrade (Tier 1) @@ -179,8 +178,6 @@ oc:gui.ServerRack.WirelessRange=Range oc:gui.Switch.TransferRate=Cycle rate oc:gui.Switch.PacketsPerCycle=Packets / cycle oc:gui.Switch.QueueSize=Queue size -oc:gui.Terminal.InvalidKey=Invalid key, most likely another terminal has been bound to the server. -oc:gui.Terminal.OutOfRange=No signal. # Containers oc:container.AccessPoint=Access Point @@ -269,13 +266,12 @@ oc:tooltip.Robot=Unlike computers, robots can move around and interact with the oc:tooltip.Robot_Level=§fLevel§7: §a%s§7 oc:tooltip.Robot_StoredEnergy=§fStored energy§7: §a%s§7 oc:tooltip.Screen=Display text, controlled by a Graphics Card in a Case.[nl] Maximum resolution: §f%sx%s§7[nl] Maximum color depth: §f%s§7 -oc:tooltip.Server=This is a server, there are many like it, but this one can be upgraded with components much like a computer case can be. It can be run by inserting it into a server rack.[nl] Number of supported terminals: §f%s§7 +oc:tooltip.Server=This is a server, there are many like it, but this one can be upgraded with components much like a computer case can be. It can be run by inserting it into a server rack. oc:tooltip.Server.Components=Installed components: -oc:tooltip.ServerRack=Allows the installation of up to four servers. Use a Remote Terminal to access the servers built into this server rack. +oc:tooltip.ServerRack=Allows the installation of up to four servers. Servers have to be configured before being placed into a server rack. oc:tooltip.Switch=Allows connecting different networks to each other. Only network messages will be passed along, components will not be visible through this. Use this to separate networks while still allowing communication using Network Cards, for example. oc:tooltip.Tablet=A tablet computer, for fresh Lua on the go. Can be forced to shut down by sneak-activating it. oc:tooltip.TabletCase=Basic case for tablets. Place it into the assembler to add in components and create a tablet computer. -oc:tooltip.Terminal=Allows controlling a server remotely, as long as you are in range of it. Acts like a portable screen and keyboard. Shift-right-click a server in a server rack to bind the terminal to it. oc:tooltip.Tier=§8Tier %s oc:tooltip.TooLong=Hold [§f%s§7] for a detailed tooltip. oc:tooltip.Transistor=A basic element in most other computer parts. It's a bit twisted, but it does the job. @@ -319,7 +315,6 @@ item.oc.NetworkCard.usage=The §oNetwork Card§r allows computers to send and re item.oc.RedstoneCard.usage=The §oRedstone Card§r allows computers to read and emit analog redstone signal in adjacent blocks. When an ingoing signal strength changes, a signal is injected into the computer.[nl][nl]If there are any supported mods present that provide bundled redstone facilities, such as RedLogic, Project Red or MineFactory Reloaded, or mods that provide wireless redstone facilities such as WR-CBE and Slimevoid's Wireless mod, a second tier card is available that allows interacting with these systems.[nl][nl]The side provided to the several methods are relative to the orientation of the computer case / robot / server rack. That means when looking at the front of the computer, right is at your left and vice versa. item.oc.Server.usage=§oServers§r are a form of higher tier computer. They can be configured by holding them in the hand and rightclicking - like opening a backpack or ender pouch, for example. After inserting CPU, memory and cards, the server has to be placed inside a §oServer Rack§r. For more information see the server rack entry. item.oc.TabletCase.usage=The §oTablet Case§r is the base part when building tablets in the §oAssembler§r. Tablets are very compact and portable computers. They can host a small number of select upgrades, but obviously cannot interact with the world like computer cases can (using simple §oNetwork Cards§r or §oRedstone Cards§r for example). Upgrades and cards that cannot be used in tablets can generally not be placed into the assembler, so if you can install an upgrade, you can usually assume that you will also be able to use it.[nl][nl]They must also remain in a player's inventory to continue running. When dropped or placed into some other inventory, they will turn off after a short amount of time. -item.oc.Terminal.usage=The §oRemote Terminal§r can be used to remote control §oServers§r. To use it, sneak-activate a server that is installed in a §oServer Rack§r (click on the server rack block in the world, targeting the server to bind the terminal to). When a terminal is bound to a server, a virtual screen and keyboard get connected to the server. This can lead to unexpected behavior if another real screen and/or keyboard is connected to the server, so this should be avoided. When rightclicking with the terminal in hand after binding it, a GUI will open, the same as when opening the GUI of a screen with an attached keyboard.[nl][nl]Multiple terminals can be bound to one server, but they will all display the same information, as they will share the virtual screen and keyboard. The number of terminals that can be bound to a server depends on the server's tier. The range in which the terminals work can be configured in the server rack's GUI. item.oc.UpgradeChunkloader.usage=The §oChunkloader Upgrade§r can be installed in robots to allow them too keep the chunk they are in - as well as the surrounding chunks - loaded. This consumes quite a bit of energy, however. The chunkloader can be turned on and off using the component the upgrade exposes to the robot.[nl][nl]The upgrade is automatically enabled when the robot powers up, and automatically disabled when the robot powers down. item.oc.UpgradeContainerCard.usage=The §oCard Container§r is a container type upgrade for robots that provides a slot in the finished robots into which cards can be placed. The tier of card that slot can hold is equal to the tier of the container. Unlike normal upgrades, the complexity of containers is twice their tier. item.oc.UpgradeContainerUpgrade.usage=The §oUpgrade Container§r is a container type upgrade for robots that provides a slot in the finished robots into which normal upgrades can be placed. The tier of upgrade that slot can hold is equal to the tier of the container. Unlike normal upgrades, the complexity of containers is twice their tier. @@ -353,7 +348,7 @@ tile.oc.powerDistributor.usage=The §oPower Distributor§r is for energy what th tile.oc.raid.usage=The §oRaid§r block houses three hard drives which will be combined into a single file system. This combined file system has the size of the sum of the capacities of the individual hard drives and is available to all computers connected to the raid.[nl][nl]The raid only works (and shows up as a file system) when three disks are present. The disks may differ in size.[nl][nl]Beware that adding a hard drive to the raid block will wipe it of its contents. Removing a single disk from a complete raid will also wipe the raid. Adding the disk back in will §lnot§r restore it, the raid's new file system will not contain any files. tile.oc.redstone.usage=The §oRedstone I/O§r block can be used to remotely read and emit redstone signals. It behaves like a hybrid of a tier one and two §oRedstone Card§r, in that it can read and emit simple analog as well as bundled signals, but cannot read or emit wireless redstone signals.[nl][nl]When providing a side to the methods of the component exposed by this block, the directions are the global principal directions, i.e. it is recommended to use sides.north, sides.east and so on.[nl][nl]Like the redstone card, this block injects a signal into connected computers when the state of a redstone signal changes - both for analog as well as for bundled signals. tile.oc.screen.usage=A §oScreen§r is used in combination with a §oGraphics Card§r to allow computers to display text. Different screen tiers have different capabilties, that being that they support different resolutions and color depths, ranging from very low resolution, monochrome displays, to very high resolutions with up to 256 different colors.[nl][nl]The available resolution and color depth depends on the weakest link. When using a tier one graphics card with a tier three screen, only the tier one resolution and color depth is usable.[nl][nl]Screens can be placed next to each other to form multi-block screens. This has no impact on the available resolution. To control how adjacent screens connect, screens can also be dyed using any dye. Screens with different colors will not connect. Screens with different tiers will never connect, even if they have the same color.[nl][nl]Tier two and tier three screens also support mouse input. Clicks can either be performed in a screen's GUI (which can only be opened if a keyboard is connected to the screen), or by sneak-activating a screen empty-handed. Note that whether the GUI opens when sneak- or normally activating a screen can be controlled via the component it exposes to connected computers. -tile.oc.serverRack.usage=A §oServer Rack§r houses up to four §oServers§r. A server is a higher tier computer, which can only run when inside a server rack. Servers can be remote controlled using a §oRemote Terminal§r. The number of terminals that can be connected to a single server at a time depends on the tier of the server. The distance up to which the remote terminals work can be configured in the rack's GUI. Higher values have a higher constant energy draw.[nl][nl]Each server in a server rack can only communicate with one "face" of the server rack at a time - or none at all. Which side each server is connected to can be configured in the server rack's GUI. Beware that the sides are from the point of view of the server rack, i.e. if you are looking at the front of the server rack, right will be to your left and vice versa.[nl][nl]Server racks act as §oSwitch§r and §oPower Distributor§r in one. The switch mode of the server rack can be configured in its GUI, with the two options being internal and external. In external mode the server rack will behave like a normal switch. In internal mode, messages are only passed to the servers in the rack, they will not be automatically relayed to the other faces of the rack. Servers will still be able to send messages to each other. This allows using server racks as advanced switches that can perform filter and mapping operations, for example. +tile.oc.serverRack.usage=A §oServer Rack§r houses up to four §oServers§r. A server is a higher tier computer, which can only run when inside a server rack.[nl][nl]Each server in a server rack can only communicate with one "face" of the server rack at a time - or none at all. Which side each server is connected to can be configured in the server rack's GUI. Beware that the sides are from the point of view of the server rack, i.e. if you are looking at the front of the server rack, right will be to your left and vice versa.[nl][nl]Server racks act as §oSwitch§r and §oPower Distributor§r in one. The switch mode of the server rack can be configured in its GUI, with the two options being internal and external. In external mode the server rack will behave like a normal switch. In internal mode, messages are only passed to the servers in the rack, they will not be automatically relayed to the other faces of the rack. Servers will still be able to send messages to each other. This allows using server racks as advanced switches that can perform filter and mapping operations, for example. tile.oc.switch.usage=The §oSwitch§r can be used to allow different subnetworks to send network messages to each other without exposing components to computers in other networks. Keeping components local is usually a good idea, to avoid computers using the wrong screen or to avoid component overflows to happen (in which computers will crash / not start anymore).[nl][nl]There is also a wireless variation of this block, the §oAccess Point§r, which will also relay messages wirelessly.[nl][nl]Switches and access point do §lnot§r keep track of which packets they relayed recently, so avoid cycles in your network, or you may receive the same packet multiple times.[nl][nl]Packets are only re-sent a certain number of times, so chaining an arbitrary number of switches or access points is not possible. # NEI Integration diff --git a/src/main/resources/assets/opencomputers/lang/fr_FR.lang b/src/main/resources/assets/opencomputers/lang/fr_FR.lang index f51319b97..80e794530 100644 --- a/src/main/resources/assets/opencomputers/lang/fr_FR.lang +++ b/src/main/resources/assets/opencomputers/lang/fr_FR.lang @@ -88,7 +88,6 @@ item.oc.Server2.name=Serveur (Niveau 3) item.oc.Server3.name=Serveur (Créatif) item.oc.Tablet.name=Tablette item.oc.TabletCase.name=Boitier de tablette -item.oc.Terminal.name=Terminal à distance item.oc.Transistor.name=Transistor item.oc.UpgradeAngel.name=Amélioration ange item.oc.UpgradeBattery0.name=Amélioration batterie (Niveau 1) @@ -173,8 +172,6 @@ oc:gui.ServerRack.WirelessRange=Portée oc:gui.Switch.TransferRate=Vitesse du cycle oc:gui.Switch.PacketsPerCycle=paquets / cycle oc:gui.Switch.QueueSize=Taille de la file -oc:gui.Terminal.InvalidKey=Clef invalide, très probablement qu'un autre terminal a dû nécessité le serveur. -oc:gui.Terminal.OutOfRange=Pas de signal. # Containers oc:container.AccessPoint=Point d'accès @@ -260,13 +257,12 @@ oc:tooltip.Robot=Contrairement aux ordinateurs, les robots peuvent se déplacer oc:tooltip.Robot_Level=§fNiveau§7: §a%s§7. oc:tooltip.Robot_StoredEnergy=§fEnergie stockée§7: §a%s§7. oc:tooltip.Screen=Affiche du texte, contrôlé par une Carte graphique dans un Boitier.[nl] Résolution maximum: §f%sx%s§7[nl] Couleurs maximales: §f%s§7 -oc:tooltip.Server=Ceci est un serveur, il y en a beaucoup comme ca, mais celui-ci peut être amélioré avec des composants bien plus qu'un ordinateur peut l'être. Il peut être placé dans un support de serveur.[nl] Numbre de terminaux supportés : §f%s§7 +oc:tooltip.Server=Ceci est un serveur, il y en a beaucoup comme ca, mais celui-ci peut être amélioré avec des composants bien plus qu'un ordinateur peut l'être. Il peut être placé dans un support de serveur. oc:tooltip.Server.Components=Composants installés : -oc:tooltip.ServerRack=Permet l'installation jusqu'à quatre serveurs. Utilisez un terminal à distance pour avoir accès aux serveurs placés dans ce support. +oc:tooltip.ServerRack=Permet l'installation jusqu'à quatre serveurs. oc:tooltip.Switch=Permet de connecter différents réseaux entre eux. Seulement des messages réseau seront transmis, les composants ne seront pas visibles via celui ci. A utiliser pour séparer des réseaux tout en leur permettant de communiquer entre eux, grâce aux Cartes réseau, par exemple. oc:tooltip.Tablet=Une tablette, pour une Lua fraiche en route. Peut être forcé à l'arrêt par un accroupi-clique droit. oc:tooltip.TabletCase=Boitier de tablettes de base. Placez-le dans l'assembleur pour ajouter des composants et créez une tablette. -oc:tooltip.Terminal=Permet de contrôler un serveur à distance, tant que vous êtes à portée de lui. Fonctionne comme un écran-clavier portable. Maj-clique droit un serveur du support pour le lier au terminal. oc:tooltip.Tier=§8Niv. %s oc:tooltip.TooLong=Maintenez la touche [§f%s§7] pour plus d'informations. oc:tooltip.Transistor=Un élément basique constituant la plupart des pièces d'un ordinateur. Il est un peu tordu, mais il fait son boulot. diff --git a/src/main/resources/assets/opencomputers/lang/it_IT.lang b/src/main/resources/assets/opencomputers/lang/it_IT.lang index 502ae9162..b8125bf91 100644 --- a/src/main/resources/assets/opencomputers/lang/it_IT.lang +++ b/src/main/resources/assets/opencomputers/lang/it_IT.lang @@ -80,7 +80,6 @@ item.oc.Server2.name=Server (Livello 3) item.oc.Server3.name=Server (Creativo) item.oc.Tablet.name=Tablet item.oc.TabletCase.name=Custodia Tablet -item.oc.Terminal.name=Terminale Remoto item.oc.Transistor.name=Transistor item.oc.UpgradeAngel.name=Upgrade Angel item.oc.UpgradeBattery0.name=Upgrade Batteria (Livello 1) @@ -160,8 +159,6 @@ oc:gui.ServerRack.WirelessRange=Portata oc:gui.Switch.TransferRate=Tasso di ciclo oc:gui.Switch.PacketsPerCycle=Pacchetti / ciclo oc:gui.Switch.QueueSize=Dimensione coda -oc:gui.Terminal.InvalidKey=Tasto invalido, molto probabilmente un altro terminale è stato collegato al server. -oc:gui.Terminal.OutOfRange=Nessun segnale # Containers oc:container.AccessPoint=Punto di accesso @@ -241,14 +238,13 @@ oc:tooltip.Robot=A differenza dei computer, i robot possono muoversi e interagir oc:tooltip.Robot_Level=§fLivelli§7: §a%s§7 oc:tooltip.Robot_StoredEnergy=§fEnergia immagazzinata§7: §a%s§7 oc:tooltip.Screen=Mostra del testo, contollato da una scheda grafica contenuta nel case del computer.[nl] Risoluzione massima: §f%sx%s§7[nl] Profondità di colore massima: §f%s§7 -oc:tooltip.Server=Questo è un server, ci sono tanti come lui, ma questo può essere aggiornato con i componenti in modo simile a un case del computer. Può essere avviato inserendolo in un rack di server.[nl] Numero di terminali supportati: §f%s§7 +oc:tooltip.Server=Questo è un server, ci sono tanti come lui, ma questo può essere aggiornato con i componenti in modo simile a un case del computer. Può essere avviato inserendolo in un rack di server. oc:tooltip.Server.Components=Componenti installati: -oc:tooltip.ServerRack=Permette l'installazione di un massimo di quattro server. Utilizzare un terminale remoto per accedere ai server contenuti in questo server rack. +oc:tooltip.ServerRack=Permette l'installazione di un massimo di quattro server. oc:tooltip.Switch=Consente il collegamento di reti diverse tra loro. Solo i messaggi di rete saranno inoltrati attraverso il blocco, i componenti non saranno invece visibili Utilizzarlo per separare le reti pur consentendo la comunicazione utilizzando schede di rete, per esempio. oc:tooltip.Tablet=Un computer tablet, per del Lua fresco in movimento. Può essere forzato lo spegnimento usandolo mentre si preme maiusc. oc:tooltip.TabletCase=Case di base per i tablet. Posizionarlo in assembler per aggiungere componenti e creare un tablet PC. -oc:tooltip.Terminal=Permette il controllo di un server in remoto, fino a quando si è nella portata di esso. Agisce come uno schermo portatile e una tastiera. Utilizzare i tasti maiusc-destro del mouse su un server in un rack di server per associare il terminale ad esso. -oc:tooltip.Livello=§8Livello %s +oc:tooltip.Tier=§8Livello %s oc:tooltip.TooLong=Tenere premuto [§f%s§7] per un tooltip dettagliato. oc:tooltip.Transistor=Un elemento fondamentale in molte altre parti del computer. È un po' contorto, ma fa il suo lavoro. oc:tooltip.UpgradeAngel=Consente ai robot di posizionare i blocchi nel nulla, anche se non vi è alcun blocco di riferimento. diff --git a/src/main/resources/assets/opencomputers/lang/ru_RU.lang b/src/main/resources/assets/opencomputers/lang/ru_RU.lang index 6b1c4d802..c965ac1e1 100644 --- a/src/main/resources/assets/opencomputers/lang/ru_RU.lang +++ b/src/main/resources/assets/opencomputers/lang/ru_RU.lang @@ -77,7 +77,6 @@ item.oc.Server1.name=Сервер (2-ой уровень) item.oc.Server2.name=Сервер (3-ий уровень) item.oc.Server3.name=Сервер (Творческий) item.oc.Tablet.name=Планшет -item.oc.Terminal.name=Беспроводной терминал item.oc.Transistor.name=Транзистор item.oc.UpgradeAngel.name=«Ангельское» улучшение item.oc.UpgradeBattery0.name=Улучшение «Ёмкость» (1-ый уровень) @@ -154,8 +153,6 @@ oc:gui.ServerRack.WirelessRange=Радиус oc:gui.Switch.TransferRate=Цикличность oc:gui.Switch.PacketsPerCycle=Пакеты / цикл oc:gui.Switch.QueueSize=Размер очереди -oc:gui.Terminal.InvalidKey=Неверный ключ, возможно, к серверу уже подключен другой терминал. -oc:gui.Terminal.OutOfRange=Нет сигнала. # Containers oc:container.AccessPoint=Точка доступа @@ -229,12 +226,11 @@ oc:tooltip.Robot=В отличие от компьютеров, роботы м oc:tooltip.Robot_Level=§fУровень§7: §a%s§7. oc:tooltip.Robot_StoredEnergy=§fНакопленная энергия§7: §a%s§7. oc:tooltip.Screen=Отображает текст, передаваемый видеокартой.[nl] Максимальное разрешение: §f%sx%s§7[nl] Максимальная глубина цвета: §f%s§7 -oc:tooltip.Server=Это сервер, который может быть улучшен компонентами, как системный блок. Включается размещением в стойку.[nl] Количество поддерживаемых терминалов: §f%s§7 +oc:tooltip.Server=Это сервер, который может быть улучшен компонентами, как системный блок. Включается размещением в стойку. oc:tooltip.Server.Components=Установленные компоненты: -oc:tooltip.ServerRack=Обеспечивает работу до четырёх серверов. Используйте беспроводной терминал для управления установленными серверами. +oc:tooltip.ServerRack=Обеспечивает работу до четырёх серверов. oc:tooltip.Switch=Позволяет соединять различные сети между собой. Передаются только сообщения, компоненты между сетями недоступны. Используйте его для разделения сетей с возможностью пересылать сообщения между ними. oc:tooltip.Tablet=ЭКСПЕРИМЕНТАЛЬНЫЙ - ТОЛЬКО ДЛЯ ТЕСТИРОВАНИЯ [nl] Это тестирование компьютеров-предметов. Он не может быть создан. Сообщайте о ошибках, если Вы тестируете его! -oc:tooltip.Terminal=Позволяет дистанционно управлять сервером, пока вы в радиусе его действия. Действует как портативный дисплей с клавиатурой.[nl] Shift+ПКМ по серверу в стойке для привязки к нему терминала. oc:tooltip.TooLong=Удерживайте [§f%s§7], чтобы отобразить описание. oc:tooltip.Transistor=Базовый элемент в других частях компьютера. Он немного деформирован, но отлично выполняет свою работу. oc:tooltip.UpgradeAngel=Позволяет роботам размещать блоки в воздухе, даже если отсутствует точка опоры. diff --git a/src/main/resources/assets/opencomputers/lang/zh_CN.lang b/src/main/resources/assets/opencomputers/lang/zh_CN.lang index f7980299d..ccf798d74 100644 --- a/src/main/resources/assets/opencomputers/lang/zh_CN.lang +++ b/src/main/resources/assets/opencomputers/lang/zh_CN.lang @@ -82,7 +82,6 @@ item.oc.Server2.name=超级服务器 item.oc.Server3.name=创造模式服务器 item.oc.Tablet.name=平板电脑 item.oc.TabletCase.name=平板电脑保护套 -item.oc.Terminal.name=远程终端 item.oc.Transistor.name=晶体管 item.oc.UpgradeAngel.name=天使方块升级 item.oc.UpgradeBattery0.name=基础电池升级 @@ -162,8 +161,6 @@ oc:gui.ServerRack.WirelessRange=范围 oc:gui.Switch.TransferRate=周期率 oc:gui.Switch.PacketsPerCycle=数据包 / 周期 oc:gui.Switch.QueueSize=队列长度 -oc:gui.Terminal.InvalidKey=无效键, 看上去另一个终端已绑定到这台服务器. -oc:gui.Terminal.OutOfRange=无信号. # Containers oc:container.AccessPoint=桥接器 @@ -242,12 +239,11 @@ oc:tooltip.Robot=和计算机不同, 机器人能够移动并且像玩家那样 oc:tooltip.Robot_Level=§f等级§7: §a%s§7. oc:tooltip.Robot_StoredEnergy=§f存储能量§7: §a%s§7. oc:tooltip.Screen=显示文本, 运作需要机箱中的显卡.[nl] 最高分辨率: §f%sx%s§7[nl] 最高色深: §f%s§7 -oc:tooltip.Server=这就是服务器, 它与许多其它的服务器拥有相似功能, 但这台服务器可以使用组件进行升级, 就像升级机箱一样. 它也可以放入服务器机架中运行.[nl] 支持终端的数量: §f%s§7 +oc:tooltip.Server=这就是服务器, 它与许多其它的服务器拥有相似功能, 但这台服务器可以使用组件进行升级, 就像升级机箱一样. 它也可以放入服务器机架中运行. oc:tooltip.Server.Components=已安装的组件: -oc:tooltip.ServerRack=它能装下四台服务器. 使用远程终端访问机架中的服务器. +oc:tooltip.ServerRack=它能装下四台服务器. oc:tooltip.Switch=允许设备相互连接不同的网络. 仅能传递网络信息, 并且组件不可见. 例如你可以通过这种方式来建立独立网络但仍允许其使用网卡通讯. oc:tooltip.Tablet=开发中 - 目前只能用于测试 [nl] 这是一个基于计算机的测试物品. 它还不能被合成. 如果在测试时遇到Bug请及时反馈给作者! -oc:tooltip.Terminal=可以远程控制服务器, 不过前提是你处于信号范围内. 使用方法相同于显示屏与键盘. Shift+右键一个机架中的服务器可以绑定对应的终端. oc:tooltip.Tier=§8等级 %s oc:tooltip.TooLong=按住 [§f%s§7] 显示详细物品信息. oc:tooltip.Transistor=大多数电脑组件中最基础的元素. 看上去有些扭曲, 但它是有用的. diff --git a/src/main/resources/assets/opencomputers/lang/zh_TW.lang b/src/main/resources/assets/opencomputers/lang/zh_TW.lang index 3d141486d..6567b79d5 100644 --- a/src/main/resources/assets/opencomputers/lang/zh_TW.lang +++ b/src/main/resources/assets/opencomputers/lang/zh_TW.lang @@ -82,7 +82,6 @@ item.oc.Server2.name=伺服器 (3級) item.oc.Server3.name=伺服器 (創造模式) item.oc.Tablet.name=平板電腦 item.oc.TabletCase.name=平板電腦保護套 -item.oc.Terminal.name=遠端終端機 item.oc.Transistor.name=電晶體 item.oc.UpgradeAngel.name=天使升級 item.oc.UpgradeBattery0.name=電池升級 (1級) @@ -162,8 +161,6 @@ oc:gui.ServerRack.WirelessRange=範圍 oc:gui.Switch.TransferRate=週期率 oc:gui.Switch.PacketsPerCycle=封包 / 週期 oc:gui.Switch.QueueSize=隊列大小 -oc:gui.Terminal.InvalidKey=按鍵無效時,最有可能另一端已經綁定到伺服器。 -oc:gui.Terminal.OutOfRange=沒訊號. # Containers oc:container.AccessPoint=存取點 @@ -239,12 +236,11 @@ oc:tooltip.Robot=和計算機不同,機器人能夠移動并且像玩家那些 oc:tooltip.Robot_Level=§f等級§7: §a%s§7. oc:tooltip.Robot_StoredEnergy=§f儲能§7: §a%s§7. oc:tooltip.Screen=由電腦機殼內的顯示卡控制來顯示文字.[nl]最高分辨率: §f%sx%s§7[nl] 最大色深: §f%s§7 -oc:tooltip.Server=這是一台伺服器, 他非常棒, 但是他可以使用元件去升級他功能就像電腦一樣. 他可以插入伺服器機架上執行.[nl] 支援終端機數量: §f%s§7 +oc:tooltip.Server=這是一台伺服器, 他非常棒, 但是他可以使用元件去升級他功能就像電腦一樣. 他可以插入伺服器機架上執行. oc:tooltip.Server.Components=安裝的元件: -oc:tooltip.ServerRack=提供安裝最多達四個伺服器。為每個伺服器提供了一個內置的虛擬鍵盤和螢幕元件,相當於一個遠程終端。 +oc:tooltip.ServerRack=提供安裝最多達四個伺服器。 oc:tooltip.Switch=允許設備相互連接不同的網絡.[nl]僅能傳遞網絡信息,通過路由器方式設備并不互相可見.[nl]例如可以通過這種方式來建立獨立網絡但仍允許其使用網卡通訊. oc:tooltip.Tablet=實驗 - 僅用於測試 [nl] 這是一個測試基礎電腦的物品,它不能製作,如果測試到BUG,請回報它。 -oc:tooltip.Terminal=允許遠程控制伺服器,只要你在它的範圍內。就像一個隨身型螢幕和鍵盤。按住Shift鍵並滑鼠右鍵單擊某個服務器的服務器機架終端綁定它。 oc:tooltip.Tier=§8等級 %s oc:tooltip.TooLong=按住潛行鍵([§f%s§7])以查看詳細提示信息. oc:tooltip.Transistor=在多數其他計算機的零件中都很基礎的元件.[nl]引腳有點彎了,但還能用。 diff --git a/src/main/resources/assets/opencomputers/models/item/terminal.json b/src/main/resources/assets/opencomputers/models/item/terminal.json deleted file mode 100644 index c8ac94acc..000000000 --- a/src/main/resources/assets/opencomputers/models/item/terminal.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "parent": "opencomputers:item/flat", - "textures": { - "layer0": "opencomputers:items/terminal" - } -} diff --git a/src/main/resources/assets/opencomputers/recipes/default.recipes b/src/main/resources/assets/opencomputers/recipes/default.recipes index 489a740c3..65878e827 100644 --- a/src/main/resources/assets/opencomputers/recipes/default.recipes +++ b/src/main/resources/assets/opencomputers/recipes/default.recipes @@ -26,11 +26,6 @@ microcontrollerCase2 { [blockRedstone, chest, blockRedstone] [nuggetGold, "oc:materialCircuitBoardPrinted", nuggetGold]] } -terminal { - input: [[nuggetIron, "oc:solarGeneratorUpgrade", nuggetIron] - ["oc:circuitChip3", "oc:screen2", "oc:wlanCard"] - [nuggetIron, "oc:keyboard", nuggetIron]] -} tabletCase { input: [[ingotGold, button, ingotGold] ["oc:componentBus1", "oc:screen2", "oc:circuitChip3"] diff --git a/src/main/resources/assets/opencomputers/recipes/hardmode.recipes b/src/main/resources/assets/opencomputers/recipes/hardmode.recipes index 3ded1a3be..66b7c8c42 100644 --- a/src/main/resources/assets/opencomputers/recipes/hardmode.recipes +++ b/src/main/resources/assets/opencomputers/recipes/hardmode.recipes @@ -8,11 +8,6 @@ analyzer { ["oc:materialTransistor", "oc:circuitChip1", nuggetGold] ["oc:materialTransistor", "oc:materialCircuitBoardPrinted", nuggetGold]] } -terminal { - input: [[nuggetIron, "oc:solarGeneratorUpgrade", nuggetIron] - ["oc:circuitChip3", "oc:screen2", "oc:wlanCard"] - [nuggetIron, "oc:keyboard", nuggetIron]] -} server1 { input: [["oc:circuitChip1", "oc:ram4", "oc:circuitChip1"] diff --git a/src/main/resources/assets/opencomputers/textures/gui/button_range.png b/src/main/resources/assets/opencomputers/textures/gui/button_range.png deleted file mode 100644 index 919f0b9ef8ef7c3896fd948189863e3f57cebf4d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 177 zcmeAS@N?(olHy`uVBq!ia0vp^0zj<7!2~4vt8{yTlw^r(L`iUdT1k0gQ7VIDN`6wR zf@f}GdTLN=VoGJ<$y6JlqF_%K$B>F!ZzgXPJYc|ah>ZQCP(5;1Y27jM%ImgG1#lXU~*B@G;K4|~| diff --git a/src/main/resources/assets/opencomputers/textures/gui/range.png b/src/main/resources/assets/opencomputers/textures/gui/range.png deleted file mode 100644 index 5f1b550c9aab63d5792fde0ac617dbee1351f9af..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 144 zcmeAS@N?(olHy`uVBq!ia0vp^azHG^!3-p;b>_VWQj#UE5hcO-X(i=}MX3yqDfvmM z3ZA)%>8U}fi7AzZCsS>JiZ}y&LR{0*(#*}x|NsAQdZeTUC@Aac;uunKD=Fa!yM#mo ohk1h3RJpuMJU%}d92yuI%IX<9wz3=)1}bFmboFyt=akR{0FoIgY5)KL diff --git a/src/main/resources/assets/opencomputers/textures/items/terminal.png b/src/main/resources/assets/opencomputers/textures/items/terminal.png deleted file mode 100644 index e5472c132c41312057be0ccf3e61357823af472d..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 294 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!63?wyl`GbL!WQl7;NpOBzNqJ&XDuZK6ep0G} zXKrG8YEWuoN@d~6R2!fo`v9L1R}L1Ti4!M^2*{e7n=f0o?EnA&oRX57;gRaWp&a7k zTrx7;^769YzC4PG(k^bQ{(*A-ffBa%GVY#Y=9WOkZ_mpu1sWw<666;QRDCMBQ)An%xCL_g1|JGj>;$OYp>gTq}1!e-PHhOU$)Z(12n)s44 zvT0Ki+r&Gc6ubgp2Y=bTwJ; U+uvR}K~-5dqnW6DOLRn=f0oj8jrlGdxl~IFv(NT-Mu{ zOGbuUUYzx1h{Z);}8XHe6+8aZ?7{;;tK(U02&<+F6z7 zl->BJ`2Aep%pbDL0uHseW*J4VzrhWR410Q5gW3MY9|D@s;OXk; Jvd$@?2>=*?Y7qbc diff --git a/src/main/resources/assets/opencomputers/textures/items/terminalOn.png b/src/main/resources/assets/opencomputers/textures/items/terminalOn.png deleted file mode 100644 index 46c8e2ac36f8c4652aff65db27be1b00266d3e0f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 306 zcmeAS@N?(olHy`uVBq!ia0vp^0zj<5!3-pI!a4o{DajJoh?3y^w370~qErUQl>DSr z1<%~X^wgl##FWaylc_d9MfL$cA+8)OLK7!W6cLa$H#c9lY?)?wB&VdLdT{9f|Nl9} z#ku9>Wxaj5WMowR19=n`rCr?Q`~zj&Jtb`I#mp^%YPu8+4gif3EeY}q268a~gZ9nZ zS3m_Bo-U3d6}PTjI4IO0AkzA<`9+Y{)!+8nOWIb?6np#YO`RFvH@1>%>Gzzyk0nnG zX%}GDHf9sh(tKdL=DdJa+F_LtORpIcT9!+sOYJumG<6=_X=tRLtt)r`|1S2x&F-An gmdKI;Vst0PFg3TmS$7 diff --git a/src/main/resources/assets/opencomputers/textures/items/terminalOn.png.mcmeta b/src/main/resources/assets/opencomputers/textures/items/terminalOn.png.mcmeta deleted file mode 100644 index 6274fbfe5..000000000 --- a/src/main/resources/assets/opencomputers/textures/items/terminalOn.png.mcmeta +++ /dev/null @@ -1,6 +0,0 @@ -{ - "animation": { - "frametime": 10, - "frames": [ 0, 1 ] - } -} \ No newline at end of file diff --git a/src/main/scala/li/cil/oc/Localization.scala b/src/main/scala/li/cil/oc/Localization.scala index 6c25f7538..97ca6f811 100644 --- a/src/main/scala/li/cil/oc/Localization.scala +++ b/src/main/scala/li/cil/oc/Localization.scala @@ -114,8 +114,6 @@ object Localization { def SwitchExternal = localizeImmediately("gui.ServerRack.SwitchExternal") def SwitchInternal = localizeImmediately("gui.ServerRack.SwitchInternal") - - def WirelessRange = localizeImmediately("gui.ServerRack.WirelessRange") } object Switch { @@ -126,12 +124,6 @@ object Localization { def QueueSize = localizeImmediately("gui.Switch.QueueSize") } - object Terminal { - def InvalidKey = localizeLater("gui.Terminal.InvalidKey") - - def OutOfRange = localizeLater("gui.Terminal.OutOfRange") - } - object Tooltip { def Materials = localizeImmediately("tooltip.Materials") diff --git a/src/main/scala/li/cil/oc/Settings.scala b/src/main/scala/li/cil/oc/Settings.scala index 9e41a44fb..c00f41c4d 100644 --- a/src/main/scala/li/cil/oc/Settings.scala +++ b/src/main/scala/li/cil/oc/Settings.scala @@ -272,13 +272,6 @@ class Settings(val config: Config) { val maxOpenPorts = config.getInt("misc.maxOpenPorts") max 0 val maxWirelessRange = config.getDouble("misc.maxWirelessRange") max 0 val rTreeMaxEntries = 10 - val terminalsPerTier = Array(config.getIntList("misc.terminalsPerTier"): _*) match { - case Array(tier1, tier2, tier3) => - Array(math.max(tier1, 1), math.max(tier2, 1), math.max(tier3, 1)) - case _ => - OpenComputers.log.warn("Bad number of Remote Terminal counts, ignoring.") - Array(2, 4, 8) - } val updateCheck = config.getBoolean("misc.updateCheck") val lootProbability = config.getInt("misc.lootProbability") val geolyzerRange = config.getInt("misc.geolyzerRange") diff --git a/src/main/scala/li/cil/oc/client/GuiHandler.scala b/src/main/scala/li/cil/oc/client/GuiHandler.scala index c11627fc3..3b1161d27 100644 --- a/src/main/scala/li/cil/oc/client/GuiHandler.scala +++ b/src/main/scala/li/cil/oc/client/GuiHandler.scala @@ -1,7 +1,5 @@ package li.cil.oc.client -import li.cil.oc.Localization -import li.cil.oc.Settings import li.cil.oc.api.component.TextBuffer import li.cil.oc.common.GuiType import li.cil.oc.common.entity @@ -14,7 +12,6 @@ import li.cil.oc.common.tileentity import li.cil.oc.common.{GuiHandler => CommonGuiHandler} import li.cil.oc.util.BlockPosition import li.cil.oc.util.ExtendedWorld._ -import net.minecraft.client.Minecraft import net.minecraft.entity.player.EntityPlayer import net.minecraft.world.World @@ -82,40 +79,6 @@ object GuiHandler extends CommonGuiHandler { } } null - case Some(terminal: item.Terminal) if id == GuiType.Terminal.id => - val stack = player.getCurrentEquippedItem - if (stack.hasTagCompound) { - val address = stack.getTagCompound.getString(Settings.namespace + "server") - val key = stack.getTagCompound.getString(Settings.namespace + "key") - if (key != null && !key.isEmpty && address != null && !address.isEmpty) { - tileentity.ServerRack.list.keys. - flatMap(_.terminals). - find(term => term.rack.isPresent(term.number) match { - case Some(value) => value == address - case _ => false - }) match { - case Some(term) => - def inRange = player.isEntityAlive && !term.rack.isInvalid && term.rack.getDistanceSq(player.posX, player.posY, player.posZ) < term.rack.range * term.rack.range - if (inRange) { - if (term.keys.contains(key)) return new gui.Screen(term.buffer, true, () => true, () => { - // Check if someone else bound a term to our server. - if (stack.getTagCompound.getString(Settings.namespace + "key") != key) { - Minecraft.getMinecraft.displayGuiScreen(null) - } - // Check whether we're still in range. - if (!inRange) { - Minecraft.getMinecraft.displayGuiScreen(null) - } - true - }) - else player.addChatMessage(Localization.Terminal.InvalidKey) - } - else player.addChatMessage(Localization.Terminal.OutOfRange) - case _ => player.addChatMessage(Localization.Terminal.OutOfRange) - } - } - } - null case _ => null } case _ => null diff --git a/src/main/scala/li/cil/oc/client/PacketHandler.scala b/src/main/scala/li/cil/oc/client/PacketHandler.scala index a29c1180f..1f18dc210 100644 --- a/src/main/scala/li/cil/oc/client/PacketHandler.scala +++ b/src/main/scala/li/cil/oc/client/PacketHandler.scala @@ -112,19 +112,8 @@ object PacketHandler extends CommonPacketHandler { case Some(t: Computer) => t.setRunning(p.readBoolean()) case Some(t: ServerRack) => val number = p.readInt() - if (number == -1) { - t.range = p.readInt() - } - else { - t.setRunning(number, p.readBoolean()) - t.sides(number) = p.readDirection() - val keyCount = p.readInt() - val keys = t.terminals(number).keys - keys.clear() - for (i <- 0 until keyCount) { - keys += p.readUTF() - } - } + t.setRunning(number, p.readBoolean()) + t.sides(number) = p.readDirection() case _ => // Invalid packet. } diff --git a/src/main/scala/li/cil/oc/client/PacketSender.scala b/src/main/scala/li/cil/oc/client/PacketSender.scala index 2af5e11f3..4e18b9378 100644 --- a/src/main/scala/li/cil/oc/client/PacketSender.scala +++ b/src/main/scala/li/cil/oc/client/PacketSender.scala @@ -152,15 +152,6 @@ object PacketSender { pb.sendToServer() } - def sendServerRange(t: ServerRack, range: Int) { - val pb = new SimplePacketBuilder(PacketType.ServerRange) - - pb.writeTileEntity(t) - pb.writeInt(range) - - pb.sendToServer() - } - def sendServerSide(t: ServerRack, number: Int, side: Option[EnumFacing]) { val pb = new SimplePacketBuilder(PacketType.ServerSide) diff --git a/src/main/scala/li/cil/oc/client/Textures.scala b/src/main/scala/li/cil/oc/client/Textures.scala index ba295d864..b1c1e3f98 100644 --- a/src/main/scala/li/cil/oc/client/Textures.scala +++ b/src/main/scala/li/cil/oc/client/Textures.scala @@ -28,7 +28,6 @@ object Textures { val Bar = L("bar") val Borders = L("borders") val ButtonPower = L("button_power") - val ButtonRange = L("button_range") val ButtonRun = L("button_run") val ButtonScroll = L("button_scroll") val ButtonSide = L("button_side") @@ -41,7 +40,6 @@ object Textures { val Drone = L("drone") val KeyboardMissing = L("keyboard_missing") val Raid = L("raid") - val Range = L("range") val Robot = L("robot") val RobotAssembler = L("robot_assembler") val RobotNoScreen = L("robot_noscreen") diff --git a/src/main/scala/li/cil/oc/client/gui/ServerRack.scala b/src/main/scala/li/cil/oc/client/gui/ServerRack.scala index 396bfc359..246b521e8 100644 --- a/src/main/scala/li/cil/oc/client/gui/ServerRack.scala +++ b/src/main/scala/li/cil/oc/client/gui/ServerRack.scala @@ -3,14 +3,11 @@ package li.cil.oc.client.gui import java.util import li.cil.oc.Localization -import li.cil.oc.Settings import li.cil.oc.client.Textures import li.cil.oc.client.{PacketSender => ClientPacketSender} import li.cil.oc.common.container import li.cil.oc.common.tileentity import net.minecraft.client.gui.GuiButton -import net.minecraft.client.gui.GuiScreen -import net.minecraft.client.renderer.Tessellator import net.minecraft.entity.player.InventoryPlayer import net.minecraft.util.EnumFacing import org.lwjgl.opengl.GL11 @@ -22,8 +19,6 @@ class ServerRack(playerInventory: InventoryPlayer, val rack: tileentity.ServerRa protected var sideButtons = new Array[GuiButton](4) - protected var rangeButtons = new Array[GuiButton](2) - def sideName(number: Int) = rack.sides(number) match { case Some(EnumFacing.UP) => Localization.ServerRack.Top case Some(EnumFacing.DOWN) => Localization.ServerRack.Bottom @@ -50,18 +45,6 @@ class ServerRack(playerInventory: InventoryPlayer, val rack: tileentity.ServerRa } ClientPacketSender.sendServerSide(rack, number, nextSide) } - if (button.id >= 8 && button.id <= 9) { - val step = - if (GuiScreen.isShiftKeyDown) 32 - else if (GuiScreen.isCtrlKeyDown) 1 - else 8 - val range = - if (button.id == 8) math.max(rack.range - step, 0) - else math.min(rack.range + step, Settings.get.maxWirelessRange.toInt) - if (range != rack.range) { - ClientPacketSender.sendServerRange(rack, range) - } - } if (button.id == 10) { ClientPacketSender.sendServerSwitchMode(rack, !rack.internalSwitch) } @@ -86,10 +69,6 @@ class ServerRack(playerInventory: InventoryPlayer, val rack: tileentity.ServerRa sideButtons(i) = new ImageButton(4 + i, guiLeft + 126, guiTop + 7 + i * 18, 42, 18, Textures.GUI.ButtonSide, sideName(i)) add(buttonList, sideButtons(i)) } - for (i <- 0 to 1) { - rangeButtons(i) = new ImageButton(8 + i, guiLeft + 8 + i * 48, guiTop + 50, 16, 18, Textures.GUI.ButtonRange, if (i == 0) "-" else "+") - add(buttonList, rangeButtons(i)) - } switchButton = new ImageButton(10, guiLeft + 8, guiTop + 17, 64, 18, Textures.GUI.ButtonSwitch, Localization.ServerRack.SwitchExternal, textIndent = 18) add(buttonList, switchButton) } @@ -102,33 +81,6 @@ class ServerRack(playerInventory: InventoryPlayer, val rack: tileentity.ServerRa Localization.localizeImmediately(rack.getName), 8, 6, 0x404040) - val rangeY = 39 - fontRendererObj.drawString(Localization.ServerRack.WirelessRange, 8, rangeY, 0x404040) - - { - // Background for range value. - val tx = 25 - val ty = 50 - val w = 30 - val h = 18 - val t = Tessellator.getInstance - val r = t.getWorldRenderer - mc.getTextureManager.bindTexture(Textures.GUI.Range) - GL11.glColor3f(1, 1, 1) - GL11.glDepthMask(false) - r.startDrawingQuads() - r.addVertexWithUV(tx, ty + h, zLevel, 0, 1) - r.addVertexWithUV(tx + w, ty + h, zLevel, 1, 1) - r.addVertexWithUV(tx + w, ty, zLevel, 1, 0) - r.addVertexWithUV(tx, ty, zLevel, 0, 0) - t.draw() - GL11.glDepthMask(true) - } - - drawCenteredString(fontRendererObj, - rack.range.toString, - 40, 56, 0xFFFFFF) - for (i <- 0 to 3 if powerButtons(i).isMouseOver) { val tooltip = new java.util.ArrayList[String] tooltip.add(if (rack.isRunning(i)) Localization.Computer.TurnOff else Localization.Computer.TurnOn) diff --git a/src/main/scala/li/cil/oc/common/GuiType.scala b/src/main/scala/li/cil/oc/common/GuiType.scala index f7c5ba4b2..2f2334787 100644 --- a/src/main/scala/li/cil/oc/common/GuiType.scala +++ b/src/main/scala/li/cil/oc/common/GuiType.scala @@ -8,90 +8,85 @@ object GuiType extends ScalaEnum { val Categories = mutable.Map.empty[Int, Category.Value] sealed trait EnumVal extends Value { - def id = ordinal + Categories += ordinal -> subType + + final val id = ordinal def subType: GuiType.Category.Value - - Categories += ordinal -> subType } val Adapter = new EnumVal { - def name = "Adapter"; + def name = "Adapter" def subType = GuiType.Category.Block } val Assembler = new EnumVal { - def name = "Assembler"; + def name = "Assembler" def subType = GuiType.Category.Block } val Case = new EnumVal { - def name = "Case"; + def name = "Case" def subType = GuiType.Category.Block } val Charger = new EnumVal { - def name = "Charger"; + def name = "Charger" def subType = GuiType.Category.Block } val Database = new EnumVal { - def name = "Database"; + def name = "Database" def subType = GuiType.Category.Item } val Disassembler = new EnumVal { - def name = "Disassembler"; + def name = "Disassembler" def subType = GuiType.Category.Block } val DiskDrive = new EnumVal { - def name = "DiskDrive"; + def name = "DiskDrive" def subType = GuiType.Category.Block } val Drone = new EnumVal { - def name = "Drone"; + def name = "Drone" def subType = GuiType.Category.Entity } val Rack = new EnumVal { - def name = "Rack"; + def name = "Rack" def subType = GuiType.Category.Block } val Raid = new EnumVal { - def name = "Raid"; + def name = "Raid" def subType = GuiType.Category.Block } val Robot = new EnumVal { - def name = "Robot"; + def name = "Robot" def subType = GuiType.Category.Block } val Screen = new EnumVal { - def name = "Screen"; + def name = "Screen" def subType = GuiType.Category.Block } val Server = new EnumVal { - def name = "Server"; + def name = "Server" def subType = GuiType.Category.Item } val Switch = new EnumVal { - def name = "Switch"; + def name = "Switch" def subType = GuiType.Category.Block } val Tablet = new EnumVal { - def name = "Tablet"; - - def subType = GuiType.Category.Item - } - val Terminal = new EnumVal { - def name = "Terminal"; + def name = "Tablet" def subType = GuiType.Category.Item } @@ -101,13 +96,13 @@ object GuiType extends ScalaEnum { sealed trait EnumVal extends Value val Block = new EnumVal { - def name = "Block" + final val name = "Block" } val Entity = new EnumVal { - def name = "Entity" + final val name = "Entity" } val Item = new EnumVal { - def name = "Item" + final val name = "Item" } } diff --git a/src/main/scala/li/cil/oc/common/PacketType.scala b/src/main/scala/li/cil/oc/common/PacketType.scala index f630ad09c..d4fee7d92 100644 --- a/src/main/scala/li/cil/oc/common/PacketType.scala +++ b/src/main/scala/li/cil/oc/common/PacketType.scala @@ -56,7 +56,6 @@ object PacketType extends Enumeration { MultiPartPlace, RobotAssemblerStart, RobotStateRequest, - ServerRange, ServerSide, ServerSwitchMode, diff --git a/src/main/scala/li/cil/oc/common/Proxy.scala b/src/main/scala/li/cil/oc/common/Proxy.scala index 2ef3a6320..4f3835f4b 100644 --- a/src/main/scala/li/cil/oc/common/Proxy.scala +++ b/src/main/scala/li/cil/oc/common/Proxy.scala @@ -37,7 +37,7 @@ class Proxy { registerExclusive("torchRedstoneActive", new ItemStack(net.minecraft.init.Blocks.redstone_torch)) registerExclusive("nuggetGold", new ItemStack(net.minecraft.init.Items.gold_nugget)) - val nuggetIron = api.Items.get("ironNugget").createItemStack(1) + val nuggetIron = Items.get("ironNugget").createItemStack(1) registerExclusive("nuggetIron", nuggetIron) Delegator.subItem(nuggetIron) match { diff --git a/src/main/scala/li/cil/oc/common/component/Terminal.scala b/src/main/scala/li/cil/oc/common/component/Terminal.scala deleted file mode 100644 index e2f812b64..000000000 --- a/src/main/scala/li/cil/oc/common/component/Terminal.scala +++ /dev/null @@ -1,90 +0,0 @@ -package li.cil.oc.common.component - -import li.cil.oc.Settings -import li.cil.oc.api -import li.cil.oc.api.component.Keyboard.UsabilityChecker -import li.cil.oc.api.network.Component -import li.cil.oc.api.network.Node -import li.cil.oc.api.network.Visibility -import li.cil.oc.common.item -import li.cil.oc.common.item.Delegator -import li.cil.oc.common.tileentity -import li.cil.oc.util.ExtendedNBT._ -import net.minecraft.entity.player.EntityPlayer -import net.minecraft.nbt.NBTTagCompound -import net.minecraft.nbt.NBTTagString -import net.minecraftforge.common.util.Constants.NBT -import net.minecraftforge.fml.relauncher.Side -import net.minecraftforge.fml.relauncher.SideOnly - -import scala.collection.mutable - -class Terminal(val rack: tileentity.ServerRack, val number: Int) { - val buffer = { - val screenItem = api.Items.get("screen1").createItemStack(1) - val buffer = api.Driver.driverFor(screenItem, rack.getClass).createEnvironment(screenItem, rack).asInstanceOf[api.component.TextBuffer] - val (maxWidth, maxHeight) = Settings.screenResolutionsByTier(1) - buffer.setMaximumResolution(maxWidth, maxHeight) - buffer.setMaximumColorDepth(Settings.screenDepthsByTier(1)) - buffer - } - - val keyboard = { - val keyboardItem = api.Items.get("keyboard").createItemStack(1) - val keyboard = api.Driver.driverFor(keyboardItem, rack.getClass).createEnvironment(keyboardItem, rack).asInstanceOf[api.component.Keyboard] - keyboard.setUsableOverride(new UsabilityChecker { - override def isUsableByPlayer(keyboard: api.component.Keyboard, player: EntityPlayer) = { - val stack = player.getCurrentEquippedItem - Delegator.subItem(stack) match { - case Some(t: item.Terminal) if stack.hasTagCompound => keys.contains(stack.getTagCompound.getString(Settings.namespace + "key")) - case _ => false - } - } - }) - keyboard - } - - if (buffer.node != null) { - buffer.node.asInstanceOf[Component].setVisibility(Visibility.Neighbors) - keyboard.node.asInstanceOf[Component].setVisibility(Visibility.Neighbors) - } - - val keys = mutable.ListBuffer.empty[String] - - def connect(node: Node) { - if (keys.size > 0) { - node.connect(buffer.node) - node.connect(keyboard.node) - buffer.node.connect(keyboard.node) - } - } - - // ----------------------------------------------------------------------- // - - def load(nbt: NBTTagCompound) { - buffer.load(nbt.getCompoundTag(Settings.namespace + "buffer")) - keyboard.load(nbt.getCompoundTag(Settings.namespace + "keyboard")) - // Compatibility for previous dev versions where there was only one term. - if (nbt.hasKey(Settings.namespace + "key")) { - keys += nbt.getString(Settings.namespace + "key") - } - nbt.getTagList(Settings.namespace + "keys", NBT.TAG_STRING).foreach((tag: NBTTagString) => keys += tag.getString) - } - - def save(nbt: NBTTagCompound) { - nbt.setNewCompoundTag(Settings.namespace + "buffer", buffer.save) - nbt.setNewCompoundTag(Settings.namespace + "keyboard", keyboard.save) - nbt.setNewTagList(Settings.namespace + "keys", keys) - } - - @SideOnly(Side.CLIENT) - def readFromNBTForClient(nbt: NBTTagCompound) { - buffer.load(nbt) - nbt.getTagList("keys", NBT.TAG_STRING).foreach((tag: NBTTagString) => keys += tag.getString) - } - - def writeToNBTForClient(nbt: NBTTagCompound) { - buffer.save(nbt) - nbt.setNewTagList("keys", keys) - } -} diff --git a/src/main/scala/li/cil/oc/common/init/Items.scala b/src/main/scala/li/cil/oc/common/init/Items.scala index 92668a914..acbce7edc 100644 --- a/src/main/scala/li/cil/oc/common/init/Items.scala +++ b/src/main/scala/li/cil/oc/common/init/Items.scala @@ -283,8 +283,6 @@ object Items extends ItemAPI { Recipes.addMultiItem(new item.Analyzer(components), "analyzer", "oc:analyzer") registerItem(new item.Debugger(components), "debugger") - Recipes.addMultiItem(new item.Terminal(multi), "terminal", "oc:terminal") - registerItem(new item.Tablet(multi), "tablet") registerItem(new item.Drone(multi), "drone") diff --git a/src/main/scala/li/cil/oc/common/item/Present.scala b/src/main/scala/li/cil/oc/common/item/Present.scala index bfae1bb9c..02c046ff8 100644 --- a/src/main/scala/li/cil/oc/common/item/Present.scala +++ b/src/main/scala/li/cil/oc/common/item/Present.scala @@ -96,7 +96,6 @@ object Present { add("ram3", 10) add("server1", 10) add("internetCard", 9) - add("terminal", 9) add("solarGeneratorUpgrade", 9) add("hdd2", 7) add("navigationUpgrade", 7) diff --git a/src/main/scala/li/cil/oc/common/item/Server.scala b/src/main/scala/li/cil/oc/common/item/Server.scala index 5c0c15c1d..a20616d12 100644 --- a/src/main/scala/li/cil/oc/common/item/Server.scala +++ b/src/main/scala/li/cil/oc/common/item/Server.scala @@ -20,8 +20,6 @@ class Server(val parent: Delegator, val tier: Int) extends Delegate { override protected def tooltipName = Option(super.unlocalizedName) - override protected def tooltipData = Seq(Settings.get.terminalsPerTier(math.min(Tier.Three, tier))) - override def rarity = Rarity.byTier(tier) override def maxStackSize = 1 diff --git a/src/main/scala/li/cil/oc/common/item/Terminal.scala b/src/main/scala/li/cil/oc/common/item/Terminal.scala deleted file mode 100644 index 8d8902926..000000000 --- a/src/main/scala/li/cil/oc/common/item/Terminal.scala +++ /dev/null @@ -1,105 +0,0 @@ -package li.cil.oc.common.item - -import java.util -import java.util.UUID - -import li.cil.oc.OpenComputers -import li.cil.oc.Settings -import li.cil.oc.common.GuiType -import li.cil.oc.common.Tier -import li.cil.oc.common.tileentity -import li.cil.oc.server.{PacketSender => ServerPacketSender} -import li.cil.oc.util.BlockPosition -import li.cil.oc.util.ExtendedWorld._ -import net.minecraft.entity.player.EntityPlayer -import net.minecraft.item.ItemStack -import net.minecraft.nbt.NBTTagCompound -import net.minecraft.util.EnumFacing -import net.minecraft.world.World -import net.minecraftforge.fml.relauncher.Side -import net.minecraftforge.fml.relauncher.SideOnly - -class Terminal(val parent: Delegator) extends Delegate { - override def maxStackSize = 1 - - def hasServer(stack: ItemStack) = stack.hasTagCompound && stack.getTagCompound.hasKey(Settings.namespace + "server") - - @SideOnly(Side.CLIENT) - override def tooltipLines(stack: ItemStack, player: EntityPlayer, tooltip: util.List[String], advanced: Boolean) { - super.tooltipLines(stack, player, tooltip, advanced) - if (hasServer(stack)) { - val server = stack.getTagCompound.getString(Settings.namespace + "server") - tooltip.add("§8" + server.substring(0, 13) + "...§7") - } - } - - // TODO remove - // private var iconOn: Option[Icon] = None - // private var iconOff: Option[Icon] = None - // - // // TODO check if server is in range and running - // // Unlike in the GUI handler the result should definitely be cached here. - // @SideOnly(Side.CLIENT) - // override def icon(stack: ItemStack, pass: Int) = if (hasServer(stack)) iconOn else iconOff - // - // override def registerIcons(iconRegister: IconRegister) = { - // super.getAtlasSprites(iconRegister) - // - // iconOn = Option(iconRegister.getAtlasSprite(Settings.resourceDomain + ":TerminalOn")) - // iconOff = Option(iconRegister.getAtlasSprite(Settings.resourceDomain + ":TerminalOff")) - // } - - override def onItemUse(stack: ItemStack, player: EntityPlayer, position: BlockPosition, side: EnumFacing, hitX: Float, hitY: Float, hitZ: Float) = { - val world = position.world.get - world.getTileEntity(position) match { - case rack: tileentity.ServerRack if side == rack.facing.ordinal() => - val l = 2 / 16.0 - val h = 14 / 16.0 - val slot = (((1 - hitY) - l) / (h - l) * 4).toInt - if (slot >= 0 && slot <= 3 && rack.items(slot).isDefined) { - if (!world.isRemote) { - rack.servers(slot) match { - case Some(server) => - val terminal = rack.terminals(slot) - val key = UUID.randomUUID().toString - val keys = terminal.keys - if (!stack.hasTagCompound) { - stack.setTagCompound(new NBTTagCompound()) - } - else { - keys -= stack.getTagCompound.getString(Settings.namespace + "key") - } - val maxSize = Settings.get.terminalsPerTier(math.min(Tier.Three, server.tier)) - while (keys.length >= maxSize) { - keys.remove(0) - } - keys += key - terminal.connect(server.machine.node) - ServerPacketSender.sendServerState(rack, slot) - stack.getTagCompound.setString(Settings.namespace + "key", key) - stack.getTagCompound.setString(Settings.namespace + "server", server.machine.node.address) - player.inventory.markDirty() - case _ => // Huh? - } - } - true - } - else false - case _ => super.onItemUse(stack, player, position, side, hitX, hitY, hitZ) - } - } - - override def onItemRightClick(stack: ItemStack, world: World, player: EntityPlayer) = { - if (!player.isSneaking && stack.hasTagCompound) { - val key = stack.getTagCompound.getString(Settings.namespace + "key") - val server = stack.getTagCompound.getString(Settings.namespace + "server") - if (key != null && !key.isEmpty && server != null && !server.isEmpty) { - if (world.isRemote) { - player.openGui(OpenComputers, GuiType.Terminal.id, world, 0, 0, 0) - } - player.swingItem() - } - } - super.onItemRightClick(stack, world, player) - } -} diff --git a/src/main/scala/li/cil/oc/common/tileentity/ServerRack.scala b/src/main/scala/li/cil/oc/common/tileentity/ServerRack.scala index 036f330a4..c47082375 100644 --- a/src/main/scala/li/cil/oc/common/tileentity/ServerRack.scala +++ b/src/main/scala/li/cil/oc/common/tileentity/ServerRack.scala @@ -31,10 +31,6 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB val sides = Seq(Option(EnumFacing.UP), Option(EnumFacing.EAST), Option(EnumFacing.WEST), Option(EnumFacing.DOWN)). padTo(servers.length, None).toArray - val terminals = (0 until servers.length).map(new common.component.Terminal(this, _)).toArray - - var range = 16 - // For client side, where we don't create the component. private val _isRunning = new Array[Boolean](getSizeInventory) @@ -216,26 +212,9 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB override def updateEntity() { super.updateEntity() if (isServer && isConnected) { - val shouldUpdatePower = world.getTotalWorldTime % Settings.get.tickFrequency == 0 - if (shouldUpdatePower && range > 0 && !Settings.get.ignorePower) { - val countRunning = servers.count { - case Some(server) => server.machine.isRunning - case _ => false - } - if (countRunning > 0) { - var cost = -(countRunning * range * Settings.get.wirelessCostPerRange * Settings.get.tickFrequency) - for (side <- EnumFacing.values if cost < 0) { - sidedNode(side) match { - case connector: Connector => cost = connector.changeBuffer(cost) - case _ => - } - } - } - } - servers collect { case Some(server) => - if (shouldUpdatePower && server.tier == Tier.Four) { + if (server.tier == Tier.Four && world.getTotalWorldTime % Settings.get.tickFrequency == 0) { server.machine.node.asInstanceOf[Connector].changeBuffer(Double.PositiveInfinity) } server.machine.update() @@ -258,7 +237,6 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB servers collect { case Some(server) => server.inventory.updateComponents() - terminals(server.slot).buffer.update() } } } @@ -304,15 +282,6 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB case _ => None } Array.copy(sidesNbt, 0, sides, 0, math.min(sidesNbt.length, sides.length)) - nbt.getTagList(Settings.namespace + "terminals", NBT.TAG_COMPOUND).toArray[NBTTagCompound]. - zipWithIndex.foreach { - case (tag, index) if index < terminals.length => - try terminals(index).load(tag) catch { - case t: Throwable => OpenComputers.log.warn("Failed restoring terminal state. Please report this!", t) - } - case _ => - } - range = nbt.getInteger(Settings.namespace + "range") internalSwitch = nbt.getBoolean(Settings.namespace + "internalSwitch") } @@ -331,14 +300,6 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB case Some(side) => side.ordinal.toByte case _ => -1: Byte }) - nbt.setNewTagList(Settings.namespace + "terminals", terminals.map(t => { - val terminalNbt = new NBTTagCompound() - try t.save(terminalNbt) catch { - case t: Throwable => OpenComputers.log.warn("Failed saving terminal state. Please report this!", t) - } - terminalNbt - })) - nbt.setInteger(Settings.namespace + "range", range) nbt.setBoolean(Settings.namespace + "internalSwitch", internalSwitch) } @@ -348,7 +309,7 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB val isRunningNbt = nbt.getByteArray("isServerRunning").map(_ == 1) Array.copy(isRunningNbt, 0, _isRunning, 0, math.min(isRunningNbt.length, _isRunning.length)) val isPresentNbt = nbt.getTagList("isPresent", NBT.TAG_STRING).map((tag: NBTTagString) => { - val value = tag.getString() + val value = tag.getString if (Strings.isNullOrEmpty(value)) None else Some(value) }).toArray Array.copy(isPresentNbt, 0, isPresent, 0, math.min(isPresentNbt.length, isPresent.length)) @@ -357,12 +318,6 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB case _ => None } Array.copy(sidesNbt, 0, sides, 0, math.min(sidesNbt.length, sides.length)) - nbt.getTagList("terminals", NBT.TAG_COMPOUND).toArray[NBTTagCompound]. - zipWithIndex.foreach { - case (tag, index) if index < terminals.length => terminals(index).readFromNBTForClient(tag) - case _ => - } - range = nbt.getInteger("range") if (anyRunning) Sound.startLoop(this, "computer_running", 1.5f, 1000 + world.rand.nextInt(2000)) } @@ -374,12 +329,6 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB case Some(side) => side.ordinal.toByte case _ => -1: Byte }) - nbt.setNewTagList("terminals", terminals.map(t => { - val terminalNbt = new NBTTagCompound() - t.writeToNBTForClient(terminalNbt) - terminalNbt - })) - nbt.setInteger("range", range) } // ----------------------------------------------------------------------- // @@ -392,7 +341,6 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB case Some(server) => if (serverSide == Option(plug.side)) plug.node.connect(server.machine.node) else api.Network.joinNewNetwork(server.machine.node) - terminals(number).connect(server.machine.node) case _ => } } @@ -410,7 +358,6 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB servers(slot) = Some(server) reconnectServer(slot, server) Network.joinNewNetwork(server.machine.node) - terminals(slot).connect(server.machine.node) } } @@ -426,7 +373,6 @@ class ServerRack extends traits.PowerAcceptor with traits.Hub with traits.PowerB case _ => } servers(slot) = None - terminals(slot).keys.clear() } } diff --git a/src/main/scala/li/cil/oc/server/PacketHandler.scala b/src/main/scala/li/cil/oc/server/PacketHandler.scala index bf3291295..60e38eca0 100644 --- a/src/main/scala/li/cil/oc/server/PacketHandler.scala +++ b/src/main/scala/li/cil/oc/server/PacketHandler.scala @@ -1,7 +1,6 @@ package li.cil.oc.server import li.cil.oc.Localization -import li.cil.oc.Settings import li.cil.oc.api import li.cil.oc.api.machine.Machine import li.cil.oc.common.PacketType @@ -49,7 +48,6 @@ object PacketHandler extends CommonPacketHandler { case PacketType.PetVisibility => onPetVisibility(p) case PacketType.RobotAssemblerStart => onRobotAssemblerStart(p) case PacketType.RobotStateRequest => onRobotStateRequest(p) - case PacketType.ServerRange => onServerRange(p) case PacketType.ServerSide => onServerSide(p) case PacketType.ServerSwitchMode => onServerSwitchMode(p) case PacketType.TextBufferInit => onTextBufferInit(p) @@ -190,17 +188,6 @@ object PacketHandler extends CommonPacketHandler { case _ => // Invalid packet. } - def onServerRange(p: PacketParser) = - p.readTileEntity[ServerRack]() match { - case Some(rack) => p.player match { - case player: EntityPlayerMP if rack.isUseableByPlayer(player) => - rack.range = math.min(math.max(0, p.readInt()), Settings.get.maxWirelessRange).toInt - PacketSender.sendServerState(rack) - case _ => - } - case _ => // Invalid packet. - } - def onServerSide(p: PacketParser) = p.readTileEntity[ServerRack]() match { case Some(rack) => p.player match { diff --git a/src/main/scala/li/cil/oc/server/PacketSender.scala b/src/main/scala/li/cil/oc/server/PacketSender.scala index 223942c23..588e8d30e 100644 --- a/src/main/scala/li/cil/oc/server/PacketSender.scala +++ b/src/main/scala/li/cil/oc/server/PacketSender.scala @@ -420,16 +420,6 @@ object PacketSender { pb.sendToPlayersNearTileEntity(t) } - def sendServerState(t: tileentity.ServerRack) { - val pb = new SimplePacketBuilder(PacketType.ComputerState) - - pb.writeTileEntity(t) - pb.writeInt(-1) - pb.writeInt(t.range) - - pb.sendToPlayersNearTileEntity(t) - } - def sendServerState(t: tileentity.ServerRack, number: Int, player: Option[EntityPlayerMP] = None) { val pb = new SimplePacketBuilder(PacketType.ComputerState) @@ -437,11 +427,6 @@ object PacketSender { pb.writeInt(number) pb.writeBoolean(t.isRunning(number)) pb.writeDirection(t.sides(number)) - val keys = t.terminals(number).keys - pb.writeInt(keys.length) - for (key <- keys) { - pb.writeUTF(key) - } player match { case Some(p) => pb.sendToPlayer(p)