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