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

Content Not Loading - Master Version #119

Open
alanmvarela opened this issue Oct 15, 2019 · 4 comments
Open

Content Not Loading - Master Version #119

alanmvarela opened this issue Oct 15, 2019 · 4 comments

Comments

@alanmvarela
Copy link

Hi I'm having an issue similar to the previously reported on All content not loading #18
I followed the procedure to set up the Master version on an Apache Server, cloning git repository, and i build everything in English and index and maze in all languages using:

make en;
make index;
make maze;

The application index works fine, but when entering any of the games i get the game directory content instead of the game itself.
I tried the offline version and it works just fine, but as i need to use the storage.js implementation of the master version to get the status of the games in local-storage is of no use for me.

Can you help me figure out why the master version if not working for me?
Please let me know if you need any further information on this.

Best Regards

@NeilFraser
Copy link
Contributor

Oh, try going to maze.html instead of maze/

@alanmvarela
Copy link
Author

Hi Neil, after changing the url to /maze.html it loads the game just fine.
Any idea on what i'm missing on the index to map to correct URL?

@NeilFraser
Copy link
Contributor

NeilFraser commented Oct 15, 2019

If you were using App Engine instead of Apache, then the app.yaml file would tell the server to redirect /maze to maze.html. For Apache, there are two approaches:

  1. Translate the directives in app.yaml to Apache's configuration.
  2. Edit js/lib-games.js and set BlocklyGames.IS_HTML = true; (then rebuild)

However, if you want storage to work, then you'll also need to rewrite storage.py to be some sort of CGI script that Apache can run, backed by some form of database. Currently it is designed to run under App Engine. Fortunately it's not a very complicated system: you give it code, it stores it and returns a key -- you give it a key, it returns the previously stored code.

@alanmvarela
Copy link
Author

I modified js/lib-games.js and set BlocklyGames.IS_HTML = true; after this i rebuild index and maze as indicated and everything is working fine now.

Regarding storage.py, i understand that i should modify below methods on /appengine/common/storage.js file right? My intention is to have the code and key saved to a local database instead of creating a request to the cloud.

/**
 * Save blocks or JavaScript to database and return a link containing the key.
 */
BlocklyStorage.link = function() {
  var code = BlocklyInterface.getCode();
  BlocklyStorage.makeRequest_('/storage', 'xml', code);
};

/**
 * Retrieve XML text from database using given key.
 * @param {string} key Key to XML, obtained from href.
 */
BlocklyStorage.retrieveXml = function(key) {
  BlocklyStorage.makeRequest_('/storage', 'key', key);
}; 

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