Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with values not updating #3

Open
bgilbert6 opened this issue Nov 7, 2016 · 3 comments
Open

Problem with values not updating #3

bgilbert6 opened this issue Nov 7, 2016 · 3 comments

Comments

@bgilbert6
Copy link

bgilbert6 commented Nov 7, 2016

I'm trying to use this library, since it looks pretty simple. But the Vector3f positions aren't updating inside an array? Here's what my Game State Message looks like:

public class GameWorldState {

public int tick = -1;
public HashMap<Integer, PlayerGameState> players = new HashMap<Integer, PlayerGameState>();

}

public class PlayerGameState {

//equal to connection ID
public int controlledBy = -1;
public int clientTick = -1;
public Vector3f position = new Vector3f();
public Vector3f viewDirection = new Vector3f();
public float eyeHeight = 0;


//0 to 1 of current primed arrow power
public float arrowPower = 0;

}

I've verified right before the diffHandler is called to send it that the position is indeed updating. On the receiving end it just stays the first value forever.

@Namek
Copy link

Namek commented Nov 7, 2016

Long time ago I have optimized this library (due to garbage collection) and ported to kryonet lib under the hood. Also made some tests: https://github.com/Namek/quakemonkey/blob/master/test/net/namekdev/quakemonkey/diff/SerializationTests.java - maybe this will help you with verifying whether it's your usage code or library.

@bgilbert6
Copy link
Author

Will this test work in the original code? I wouldn't want to convert everything to kryonet :(

It is weird because I verified the original client/server test worked and the values were correct.

@Namek
Copy link

Namek commented Nov 7, 2016

Will this test work in the original code? I wouldn't want to convert everything to kryonet :(

You should try and answer it on your own because I don't remember. Commits on my fork repo seem to be rather clear about provided changes.

I believe you can just copy-paste (+ maybe fix until it compiles) the test and verify original lib. Due to lack of interest, can't help you more.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants