mirror of
https://github.com/collinsmith/riiablo.git
synced 2025-02-09 10:28:25 +07:00
Fixed GroundToCursor code to use client-side entity id and pass along server-side entity id
This commit is contained in:
parent
ae00373f8a
commit
d6e973f2f2
@ -83,7 +83,6 @@ public class ClientNetworkReceiver extends IntervalSystem {
|
||||
private static final boolean DEBUG_PACKET = DEBUG && !true;
|
||||
private static final boolean DEBUG_SYNC = DEBUG && !true;
|
||||
|
||||
// protected ComponentMapper<Networked> mNetworked;
|
||||
protected ComponentMapper<CofReference> mCofReference;
|
||||
protected ComponentMapper<CofComponents> mCofComponents;
|
||||
protected ComponentMapper<CofTransforms> mCofTransforms;
|
||||
@ -422,7 +421,8 @@ public class ClientNetworkReceiver extends IntervalSystem {
|
||||
|
||||
private void GroundToCursor(D2GS packet) {
|
||||
GroundToCursor groundToCursor = (GroundToCursor) packet.data(new GroundToCursor());
|
||||
items.groundToCursor(Riiablo.game.player, groundToCursor.itemId());
|
||||
int entityId = syncIds.get(groundToCursor.itemId());
|
||||
items.groundToCursor(Riiablo.game.player, entityId);
|
||||
}
|
||||
|
||||
private void CursorToGround(D2GS packet) {
|
||||
|
@ -2,9 +2,11 @@ package com.riiablo.engine.client;
|
||||
|
||||
import com.google.flatbuffers.FlatBufferBuilder;
|
||||
|
||||
import com.artemis.ComponentMapper;
|
||||
import com.artemis.annotations.Wire;
|
||||
import com.badlogic.gdx.Gdx;
|
||||
import com.badlogic.gdx.net.Socket;
|
||||
import com.riiablo.engine.server.component.Networked;
|
||||
import com.riiablo.item.BodyLoc;
|
||||
import com.riiablo.item.StoreLoc;
|
||||
import com.riiablo.net.packet.d2gs.BeltToCursor;
|
||||
@ -28,6 +30,8 @@ import java.nio.channels.WritableByteChannel;
|
||||
public class NetworkedClientItemManager extends ClientItemManager {
|
||||
private static final String TAG = "NetworkedClientItemManager";
|
||||
|
||||
protected ComponentMapper<Networked> mNetworked;
|
||||
|
||||
@Wire(name = "client.socket")
|
||||
protected Socket socket;
|
||||
|
||||
@ -50,8 +54,9 @@ public class NetworkedClientItemManager extends ClientItemManager {
|
||||
|
||||
@Override
|
||||
public void groundToCursor(int entityId) {
|
||||
int serverId = mNetworked.get(entityId).serverId;
|
||||
FlatBufferBuilder builder = obtainBuilder();
|
||||
int dataOffset = GroundToCursor.createGroundToCursor(builder, entityId);
|
||||
int dataOffset = GroundToCursor.createGroundToCursor(builder, serverId);
|
||||
wrapAndSend(builder, D2GSData.GroundToCursor, dataOffset);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user