fix inventory message for undefined id on client
This commit is contained in:
parent
ad1f65aca6
commit
ef724d3832
@ -1,3 +1,3 @@
|
||||
#maven.buildNumber.plugin properties file
|
||||
#Sun Oct 20 12:03:26 EDT 2024
|
||||
buildNumber=361
|
||||
#Mon Oct 21 09:29:02 EDT 2024
|
||||
buildNumber=362
|
||||
|
||||
@ -877,6 +877,8 @@ Fix ui scaling on abnormal monitors
|
||||
- This is literally just a function of the settings file not being updated for different resolutions
|
||||
Fix inventory null pointer check on virtualaudiomanager
|
||||
|
||||
(10/21/2024)
|
||||
Fix inventory message for undefined id on client
|
||||
|
||||
|
||||
# TODO
|
||||
|
||||
@ -1,5 +1,7 @@
|
||||
package electrosphere.entity.state.inventory;
|
||||
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
|
||||
import electrosphere.client.ui.menu.WindowUtils;
|
||||
@ -35,6 +37,7 @@ public class ClientInventoryState implements BehaviorTree {
|
||||
|
||||
@Override
|
||||
public void simulate(float deltaTime) {
|
||||
List<InventoryMessage> bouncedMessages = new LinkedList<InventoryMessage>();
|
||||
for(InventoryMessage message : networkMessageQueue){
|
||||
networkMessageQueue.remove(message);
|
||||
switch(message.getMessageSubtype()){
|
||||
@ -153,10 +156,10 @@ public class ClientInventoryState implements BehaviorTree {
|
||||
//translate id
|
||||
Globals.clientSceneWrapper.mapIdToId(inWorldEntity.getId(), message.getentityId());
|
||||
switch(message.getcontainerType()){
|
||||
case electrosphere.net.server.protocol.InventoryProtocol.INVENTORY_TYPE_NATURAL: {
|
||||
case InventoryProtocol.INVENTORY_TYPE_NATURAL: {
|
||||
throw new UnsupportedOperationException("unsupported!");
|
||||
}
|
||||
case electrosphere.net.server.protocol.InventoryProtocol.INVENTORY_TYPE_EQUIP: {
|
||||
case InventoryProtocol.INVENTORY_TYPE_EQUIP: {
|
||||
//grab equip state
|
||||
ClientEquipState equipState = ClientEquipState.getEquipState(equipper);
|
||||
//create entity from template in message
|
||||
@ -165,16 +168,17 @@ public class ClientInventoryState implements BehaviorTree {
|
||||
EquipPoint equipPoint = equipState.getEquipPoint(equipPointName);
|
||||
//attach
|
||||
equipState.attemptEquip(inWorldEntity, equipPoint);
|
||||
}
|
||||
case electrosphere.net.server.protocol.InventoryProtocol.INVENTORY_TYPE_TOOLBAR: {
|
||||
} break;
|
||||
case InventoryProtocol.INVENTORY_TYPE_TOOLBAR: {
|
||||
//grab toolbar state
|
||||
ClientToolbarState toolbarState = ClientToolbarState.getClientToolbarState(equipper);
|
||||
//attach
|
||||
toolbarState.attemptEquip(inWorldEntity);
|
||||
}
|
||||
} break;
|
||||
}
|
||||
} else {
|
||||
throw new UnsupportedOperationException("todo");
|
||||
bouncedMessages.add(message);
|
||||
// throw new UnsupportedOperationException("TODO: in world item is null");
|
||||
}
|
||||
} break;
|
||||
case CLIENTUPDATETOOLBAR:
|
||||
@ -186,6 +190,7 @@ public class ClientInventoryState implements BehaviorTree {
|
||||
break;
|
||||
}
|
||||
}
|
||||
this.networkMessageQueue.addAll(bouncedMessages);
|
||||
}
|
||||
|
||||
public void addNetworkMessage(InventoryMessage networkMessage) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user