Take into account string length in client snapshots
This commit is contained in:
@@ -576,11 +576,14 @@ public class NetClient implements ApplicationListener{
|
|||||||
for(int i = 0; i < usedRequests; i++){
|
for(int i = 0; i < usedRequests; i++){
|
||||||
BuildPlan plan = player.unit().plans().get(i);
|
BuildPlan plan = player.unit().plans().get(i);
|
||||||
if(plan.config instanceof byte[] b){
|
if(plan.config instanceof byte[] b){
|
||||||
int length = b.length;
|
totalLength += b.length;
|
||||||
totalLength += length;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if(totalLength > 1024){
|
if(plan.config instanceof String b){
|
||||||
|
totalLength += b.length();
|
||||||
|
}
|
||||||
|
|
||||||
|
if(totalLength > 500){
|
||||||
usedRequests = i + 1;
|
usedRequests = i + 1;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user