mirror of
https://github.com/SquidDev-CC/CC-Tweaked
synced 2026-07-30 06:58:53 +00:00
Only send terminal state to interacting players
This splits the computer state (blinking, label, etc...) and terminal state into two separate packets. When a computer changes, the computer state is sent to all players and the terminal state is sent to players who are curerntly using the computer. This reduces network usage by a substantial amount.
This commit is contained in:
@@ -383,6 +383,7 @@ public class ComputerCraftProxyClient extends ComputerCraftProxyCommon
|
||||
switch( packet.m_packetType )
|
||||
{
|
||||
case ComputerCraftPacket.ComputerChanged:
|
||||
case ComputerCraftPacket.ComputerTerminalChanged:
|
||||
case ComputerCraftPacket.ComputerDeleted:
|
||||
{
|
||||
// Packet from Server to Client
|
||||
@@ -417,6 +418,7 @@ public class ComputerCraftProxyClient extends ComputerCraftProxyCommon
|
||||
// Packets from Server to Client //
|
||||
///////////////////////////////////
|
||||
case ComputerCraftPacket.ComputerChanged:
|
||||
case ComputerCraftPacket.ComputerTerminalChanged:
|
||||
{
|
||||
int instanceID = packet.m_dataInt[ 0 ];
|
||||
if( !ComputerCraft.clientComputerRegistry.contains( instanceID ) )
|
||||
|
||||
Reference in New Issue
Block a user