mirror of
https://github.com/GTNewHorizons/Opis.git
synced 2026-11-19 19:59:37 +00:00
Fixed upload/download display.
This commit is contained in:
1 parent
da4d3f5a12
commit
aa554fc9f6
2 files changed
+7
-4
No files matched your search
@@ -25,8 +25,7 @@ public class DataPacket250 implements ISerializable{
|
||||
this.amount = new DataAmountRate(0, 5);
|
||||
}
|
||||
|
||||
public DataPacket250 fill(FMLProxyPacket packet){
|
||||
int pktsize = packet.payload().readableBytes();//packet.payload().array().length;
|
||||
public DataPacket250 fill(FMLProxyPacket packet, int pktsize){
|
||||
this.size.size += pktsize;
|
||||
this.rate.size += pktsize;
|
||||
this.amount.size += 1;
|
||||
|
||||
@@ -38,6 +38,8 @@ public class ProfilerPacket extends ProfilerAbstract {
|
||||
if (!(msg instanceof FMLProxyPacket)){
|
||||
Packet pkt = (Packet) msg;
|
||||
|
||||
dataAmount += (Integer)size;
|
||||
|
||||
try{
|
||||
data.get(msg.getClass().getSimpleName()).fill(pkt, (Integer)size);
|
||||
} catch (Exception e){
|
||||
@@ -54,12 +56,14 @@ public class ProfilerPacket extends ProfilerAbstract {
|
||||
if (msg instanceof FMLProxyPacket){
|
||||
FMLProxyPacket pkt = (FMLProxyPacket) msg;
|
||||
String channel = pkt.channel();
|
||||
int pktsize = pkt.payload().capacity();
|
||||
dataAmount += pktsize;
|
||||
|
||||
try{
|
||||
data250.get(channel).fill(pkt);
|
||||
data250.get(channel).fill(pkt, pktsize);
|
||||
} catch (Exception e){
|
||||
data250.put(channel, new DataPacket250(channel));
|
||||
data250.get(channel).fill(pkt);
|
||||
data250.get(channel).fill(pkt, pktsize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user