Added Packet Logging
Added Crafting Logging
This commit is contained in:
@@ -70,4 +70,13 @@ public class AELog
|
|||||||
info( aeBaseTile.getClass().getName() + " @ " + xCoord + ", " + yCoord + ", " + zCoord );
|
info( aeBaseTile.getClass().getName() + " @ " + xCoord + ", " + yCoord + ", " + zCoord );
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void crafting(String format, Object... data)
|
||||||
|
{
|
||||||
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.CraftingLog ) )
|
||||||
|
{
|
||||||
|
log( Level.INFO, format, data );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -52,7 +52,7 @@ public enum AEFeature
|
|||||||
|
|
||||||
enableFacadeCrafting("Crafting"), inWorldSingularity("Crafting"), inWorldFluix("Crafting"), inWorldPurification("Crafting"), UpdateLogging("Misc", false),
|
enableFacadeCrafting("Crafting"), inWorldSingularity("Crafting"), inWorldFluix("Crafting"), inWorldPurification("Crafting"), UpdateLogging("Misc", false),
|
||||||
|
|
||||||
AlphaPass("Rendering"), PaintBalls("Tools");
|
AlphaPass("Rendering"), PaintBalls("Tools"), PacketLogging("Misc", false), CraftingLog("Misc", false);
|
||||||
|
|
||||||
String Category;
|
String Category;
|
||||||
boolean visible = true;
|
boolean visible = true;
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package appeng.core.sync;
|
|||||||
|
|
||||||
import io.netty.buffer.ByteBuf;
|
import io.netty.buffer.ByteBuf;
|
||||||
import net.minecraft.entity.player.EntityPlayer;
|
import net.minecraft.entity.player.EntityPlayer;
|
||||||
|
import appeng.core.AEConfig;
|
||||||
|
import appeng.core.AELog;
|
||||||
|
import appeng.core.features.AEFeature;
|
||||||
import appeng.core.sync.network.INetworkInfo;
|
import appeng.core.sync.network.INetworkInfo;
|
||||||
import appeng.core.sync.network.NetworkHandler;
|
import appeng.core.sync.network.NetworkHandler;
|
||||||
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
import cpw.mods.fml.common.network.internal.FMLProxyPacket;
|
||||||
@@ -39,7 +42,12 @@ public abstract class AppEngPacket
|
|||||||
if ( p.array().length > 2 * 1024 * 1024 ) // 2k walking room :)
|
if ( p.array().length > 2 * 1024 * 1024 ) // 2k walking room :)
|
||||||
throw new IllegalArgumentException( "Sorry AE2 made a " + p.array().length + " byte packet by accident!" );
|
throw new IllegalArgumentException( "Sorry AE2 made a " + p.array().length + " byte packet by accident!" );
|
||||||
|
|
||||||
return new FMLProxyPacket( p, NetworkHandler.instance.getChannel() );
|
FMLProxyPacket pp = new FMLProxyPacket( p, NetworkHandler.instance.getChannel() );
|
||||||
|
|
||||||
|
if ( AEConfig.instance.isFeatureEnabled( AEFeature.PacketLogging ) )
|
||||||
|
AELog.info( getClass().getName() + " : " + pp.payload().readableBytes() );
|
||||||
|
|
||||||
|
return pp;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -158,10 +158,10 @@ public class CraftingJob implements Runnable, ICraftingJob
|
|||||||
for (String s : opsAndMultiplier.keySet())
|
for (String s : opsAndMultiplier.keySet())
|
||||||
{
|
{
|
||||||
twoIntegers ti = opsAndMultiplier.get( s );
|
twoIntegers ti = opsAndMultiplier.get( s );
|
||||||
AELog.info( s + " * " + ti.times + " = " + (ti.perOp * ti.times) );
|
AELog.crafting( s + " * " + ti.times + " = " + (ti.perOp * ti.times) );
|
||||||
}
|
}
|
||||||
|
|
||||||
AELog.info( "------------- " + getByteTotal() + "b real" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" );
|
AELog.crafting( "------------- " + getByteTotal() + "b real" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" );
|
||||||
// if ( mode == Actionable.MODULATE )
|
// if ( mode == Actionable.MODULATE )
|
||||||
// meci.moveItemsToStorage( storage );
|
// meci.moveItemsToStorage( storage );
|
||||||
}
|
}
|
||||||
@@ -182,10 +182,10 @@ public class CraftingJob implements Runnable, ICraftingJob
|
|||||||
for (String s : opsAndMultiplier.keySet())
|
for (String s : opsAndMultiplier.keySet())
|
||||||
{
|
{
|
||||||
twoIntegers ti = opsAndMultiplier.get( s );
|
twoIntegers ti = opsAndMultiplier.get( s );
|
||||||
AELog.info( s + " * " + ti.times + " = " + (ti.perOp * ti.times) );
|
AELog.crafting( s + " * " + ti.times + " = " + (ti.perOp * ti.times) );
|
||||||
}
|
}
|
||||||
|
|
||||||
AELog.info( "------------- " + getByteTotal() + "b simulate" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" );
|
AELog.crafting( "------------- " + getByteTotal() + "b simulate" + timer.elapsed( TimeUnit.MILLISECONDS ) + "ms" );
|
||||||
}
|
}
|
||||||
catch (CraftBranchFailure e1)
|
catch (CraftBranchFailure e1)
|
||||||
{
|
{
|
||||||
@@ -197,7 +197,7 @@ public class CraftingJob implements Runnable, ICraftingJob
|
|||||||
}
|
}
|
||||||
catch (InterruptedException e1)
|
catch (InterruptedException e1)
|
||||||
{
|
{
|
||||||
AELog.info( "Crafting calculation canceled." );
|
AELog.crafting( "Crafting calculation canceled." );
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -208,7 +208,7 @@ public class CraftingJob implements Runnable, ICraftingJob
|
|||||||
}
|
}
|
||||||
catch (InterruptedException e1)
|
catch (InterruptedException e1)
|
||||||
{
|
{
|
||||||
AELog.info( "Crafting calculation canceled." );
|
AELog.crafting( "Crafting calculation canceled." );
|
||||||
finish();
|
finish();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -336,7 +336,7 @@ public class CraftingJob implements Runnable, ICraftingJob
|
|||||||
|
|
||||||
private void log(String string)
|
private void log(String string)
|
||||||
{
|
{
|
||||||
// AELog.info( string );
|
// AELog.crafting( string );
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addBytes(long crafts)
|
public void addBytes(long crafts)
|
||||||
|
|||||||
@@ -94,8 +94,6 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
|||||||
if ( input == null )
|
if ( input == null )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// AELog.info( mode.toString() + "Inject: " + input.toString() );
|
|
||||||
|
|
||||||
if ( mode == Actionable.MODULATE )
|
if ( mode == Actionable.MODULATE )
|
||||||
{
|
{
|
||||||
if ( logInjections )
|
if ( logInjections )
|
||||||
@@ -112,8 +110,6 @@ public class MECraftingInventory implements IMEInventory<IAEItemStack>
|
|||||||
if ( request == null )
|
if ( request == null )
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
// AELog.info( mode.toString() + "Extract: " + request.toString() );
|
|
||||||
|
|
||||||
IAEItemStack list = localCache.findPrecise( request );
|
IAEItemStack list = localCache.findPrecise( request );
|
||||||
if ( list == null || list.getStackSize() == 0 )
|
if ( list == null || list.getStackSize() == 0 )
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user