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

Fix RuntimeException while restoring a saved game #11

Closed
wants to merge 6 commits into from
Closed

Fix RuntimeException while restoring a saved game #11

wants to merge 6 commits into from

Conversation

allyourcodearebelongtous
Copy link

@allyourcodearebelongtous allyourcodearebelongtous commented Apr 11, 2020

As suggested by mateijcik EventTable.java does not call callEvent() while deserializing. Savegame.java actually wasn't changed (it got caught in this PR because I made some changes and reverted them with this commit).
Corresponding Issue is #8

…ents defined (onSetComplete, onSetActive, ...)
…ents defined (onSetComplete, onSetActive, ...)
# Conflicts:
#	OpenWIGLibrary/src/cz/matejcik/openwig/formats/Savegame.java
…ents defined (onSetComplete, onSetActive, ...)
…ents defined (onSetComplete, onSetActive, ...)
Copy link
Collaborator

Codacy Here is an overview of what got changed by this pull request:

Issues
======
- Added 8
           

See the complete overview on Codacy

public ZonePoint position = null;
protected boolean visible = false;

public Media media, icon;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//setTable(table);
}

public String name, description;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

package cz.matejcik.openwig;

import se.krka.kahlua.stdlib.BaseLib;
import se.krka.kahlua.vm.*;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

public ZonePoint position = null;
protected boolean visible = false;

public Media media, icon;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

//setTable(table);
}

public String name, description;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Engine.log("PROP: " + toString() + "." + key + " is set to " + (value == null ? "nil" : value.toString()), Engine.LOG_PROP);
}

public void setMetatable (LuaTable metatable) { }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


public String name, description;
public ZonePoint position = null;
protected boolean visible = false;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

}

public String name, description;
public ZonePoint position = null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@bekuno bekuno added the Do not merge / WIP Not for merging and/or work still in progress label Apr 11, 2020
@bekuno
Copy link
Member

bekuno commented Apr 11, 2020

@allyourcodearebelongtous
Thanks for your work.

Please ignore for now the Codacy review. If you want to change some of the points of them the please create an other PR.

Some hints for you.
It is not necessary to close and reopen a PR, if it is not ready yet. You can name it "WIP" in the title. I set the state now as label.

You can reopen a PR, if necessary. You need not to create a new one.

Please use a dedicated branch for a PR. Then you can left master and release acording to the master/release at upstream. You have an instruction at https://github.com/cgeo/cgeo/wiki/git-beginners and cgeo/WhereYouGo#45 (comment).

@allyourcodearebelongtous
Copy link
Author

allyourcodearebelongtous commented Apr 12, 2020 via email

@allyourcodearebelongtous
Copy link
Author

allyourcodearebelongtous commented Apr 12, 2020

I created a branch "restorefix" in my fork of openWIG for testing. In this branch I implemented the " slightly better fix" from matejcik, released it as v0.0.1-alpha and changed build.gradle to

    // openwig with extentions
    implementation 'com.github.allyourcodearebelongtous:openwig:v0.0.1-alpha'

So I understand there is no need to build a jar file from cgeo:openWIG which is quite nice.

The Crash.urwigo example cartrige from issue #8 does run fine now when restoring a saved game.

I think this PR should be considered a working fix for the problem and not WIP any more.

What to do now? Keep this PR and merge it into master after approval by some other testers? Switch from this PR to the changes in branch "restorefix"?

I'd say keep it simple and merge from here if all is fine. I'll use "restorefix" for the "actual correct" fix (implement deserialize() in all subclasses of EventTable.java and use Engine.instance.savegame.restoreValue(in, table); in EventTable.java). But this could take a while, 'm afraid.

@bekuno
What do you suggest? Removing WIP from this PR or close this PR and create a (identical) PR in the "restorefix" branch?

@bekuno
Copy link
Member

bekuno commented Apr 12, 2020

implementation 'com.github.allyourcodearebelongtous:openwig:v0.0.1-alpha'

You can refer to the sort commit number, here implementation 'com.github.allyourcodearebelongtous:openwig:65ed320
No need for a release.

I would suggest (if possible) to use a dedicated branch. But it is not necessary.
Other advantage could be that you can in this way squash your changes to one commit.

The PR wants to change the complete content for both files.
Maybe the line ending format is changed?

Before merging your PR I want to solve Issue #3 first.
Therefore I let the WIP label for now.

@allyourcodearebelongtous
Copy link
Author

Agreed, no need to be hasty.

@allyourcodearebelongtous
Copy link
Author

allyourcodearebelongtous commented Feb 16, 2022

@bekuno Maybe it's time to merge the PR now? @Lineflyer posted an issue (cgeo/WhereYouGo#367) in WhereYouGo that could be solved with this workaround.

@bekuno
Copy link
Member

bekuno commented Feb 19, 2022

@allyourcodearebelongtous

The big problem with analysing your changes is that your PR tries to replace the entire content of the two files.
This is not good and should be improved.

I checked your changes in my branch and in the second file (savegame.java) I only found changes in the formatting. This does not belong in this PR.

An easy way would be to create a new branch, copy your changes to the file(s) from GitHub to your local files and create a new PR.

@allyourcodearebelongtous
Copy link
Author

Never mind. It's been a while and therefor I'll close this PR. After forking a new branch I'll test again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Do not merge / WIP Not for merging and/or work still in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants