Take into account string length in client snapshots

This commit is contained in:
Anuken
2021-11-05 08:51:59 -04:00
parent 189604474c
commit 24ca434bae

View File

@@ -576,11 +576,14 @@ public class NetClient implements ApplicationListener{
for(int i = 0; i < usedRequests; i++){
BuildPlan plan = player.unit().plans().get(i);
if(plan.config instanceof byte[] b){
int length = b.length;
totalLength += length;
totalLength += b.length;
}
if(totalLength > 1024){
if(plan.config instanceof String b){
totalLength += b.length();
}
if(totalLength > 500){
usedRequests = i + 1;
break;
}