Code Monkey home page Code Monkey logo

sdv-summary's Introduction

SDV-Summary

A Flask webapp using Python Image Library to reconstruct and display a summary of the player and farm from a Stardew Valley save file. A deployed instance is hosted at upload.farm.

config.py

config.py goes in the sdv subfolder. The SDV_APP_SETTINGS environment variable is used in order to specify which Python object to load for configuration from config.py as per Flask's config.from_object. In that file the following settings can be used:

Mandatory Settings

UPLOAD_FOLDER where uploaded files are stored

SECRET_KEY for Flask's sessions etc.

MAX_CONTENT_LENGTH in bytes for uploads

PASSWORD_ATTEMPTS_LIMIT (currently unused)

PASSWORD_MIN_LENGTH used to determine minimum password length for registering users

IMGUR_CLIENTID for imgur integration

IMGUR_SECRET for imgur integration

IMGUR_DIRECT_UPLOAD to upload directly to imgur by sending file rather than by directing imgur to url (can't redirect imgur to localhost, for example, when testing)

RECAPTCHA_ENABLED for the ReCaptcha on the signup form

RECAPTCHA_SITE_KEY as above

RECAPTCHA_SECRET_KEY as above

ANALYTICS_ID to report interactions server-side to Google Analytics using google-measurement-protocol

DEBUG set to True for helpful debugging; never set to True in production environment

Database

USE_SQLITE NOTE: in testing we've moved to Postgres, so this probably doesn't work any more

SQLite

DB_SQLITE

PostgreSQL

DB_NAME

DB_USER

DB_PASSWORD

Flask-mail

As per flask-mail docs and your email server

Initialization

Install prerequisites using a tool like pip (pip3 if you're using Python 3) by running the following command from the root directory:

pip install -r requirements.txt

You need PostgreSQL installed and running. Then create a database:

createdb sdv_summary_development

To create a config file for SDV-Summary:

cp sdv/config.py.sample sdv/config.py

Modify sdv/config.py to specify the user name and password for the PostgreSQL database you created.

Once the config file has been written, run createadmin.py and createdb.py and follow the prompts to create the database structure:

SDV_APP_SETTINGS=development python sdv/createadmin.py
SDV_APP_SETTINGS=development python sdv/createdb.py

To run, the templating engine jinja2 needs sdv\templates\analytics.html to exist.

Run the app using Flask:

FLASK_APP=runserver.py flask run

Assets for image generation go in sdv\assets\[subfolder]. Assets used as-is go in sdv\static\assets\[subfolder].

Code Style

In order to keep the code style consistent, this project is formatted using Black. However, to avoid hiding previous changes in git blame the file .git-blame-ignore-revs has been introduced. This file can be used with the flag --ignore-revs-file for by adding it to the git config with:

git config blame.ignoreRevsFile .git-blame-ignore-revs

Acknowledgements

Thank you to our translators, specifically:

sdv-summary's People

Contributors

cheshire137 avatar klusark avatar laukei avatar sketchy502 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

sdv-summary's Issues

29th day of season is shown

Saves for the first day of the season are displayed as the 29th of the previous season rather than the 1st of the new season. Here's an example. These were uploaded with the auto uploader, but I'm guessing that doesn't change the server-side processing.

Looking at some of my backed up saves, I guess the game stores them this way. Is it possible to display the 1st of the proper season somehow? I looked through the code but I'm not a python expert; I don't know if any of the other save functionality would be affected by that.

Invalid save file?

I tried uploading my save file at https://upload.farm/
But it says "Error: Not valid save file - did you select file 'SaveGameInfo' instead of 'playername_number'?". However, I uploaded the file named lilac_174497281.
Is it incompatible with Stardew Valley 1.2.6400.27469?

Would you please check the problem with my save file?
lilac_174497281.zip
Thanks.

Mac OS X Save File Location

For Mac OS X players, Stardew Valley save files are located in a hidden folder in the user's home directory, not in the same location as the app data:

~/.config/StardewValley/Saves/<PlayerName_#>/<PlayerName_#>

It's a minor note, but I spent a bit of time trying to figure this out, so I'm hoping this might save someone else the effort.

Achievements

Would be cool to be able to show the achievements you've earned in the game. Optionally, would also be cool to show which items you've shipped, the fish you've caught, etc.

Config problem running locally

Similar to the error in #46, I'm getting the following when I try to run createadmin.py from the sdv directory:

% python createadmin.py
Traceback (most recent call last):
  File "createadmin.py", line 2, in <module>
    from config import config
ImportError: cannot import name 'config'

I'm using Python 3.6.4 in macOS. My sdv/config.py file contains only this:

% cat sdv/config.py
#!/usr/bin/env python

502 Bad Gateway Confusion

I'm trying to upload my farm and connect my patreon to Upload.farm and I keep getting the 502 Bad gateway message, but I see other farms being posted. Also, I haven't been able to access the auto-uploader so I can record my day and continue playing. I'm guessing that's because i never connected to Patreon.

Bushes are not generated in the map.

the skinny 1x2 bushes and the 2x2 bushes that are created by the Paths layer of the map do not appear on the site's generated map after a Save File is uploaded.
Using a mod made by spacechase0, I created this shot of the Forest Farm:
mod-generated-farm
In the red boxes I made on it, are bushes that are generated by the Paths layer of the map file.
If you look in this image here, which was generated by upload.farm, those bushes are now missing:
upload_farm-generated-image

Collections and progress on culture achievements

It would also be nice to see progress on monoculture and polyculture achievements. This is probably easiest done by showing the collection status, and somehow highlighting the items which qualify for those achievements.

Server error when trying to log in

When trying to log in here I get a server error:

Internal Server Error

The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application.

It's worth noting that this only happens if an existent e-mail address is used, otherwise it just shows the error message: Error: Username not found!

Roborobin Update?

Will there be a robo robin update? I use it for giant multiplayer farms, and now when i try and use it it just crashes. I dont think it is working for the 1.4 update and the new farm.

Inconsistent indentation types

Sometimes the indentation uses tabs and sometimes it uses spaces. Could we choose one way and replace everything with that way?

Museum!

It would be very nice to show off the museum collection for our farms.

manage.py crashes

When running manage.py from the root folder I get the following traceback:

Traceback (most recent call last):
  File "./manage.py", line 5, in <module>
    from sdv import app
  File "<root folder>/sdv/__init__.py", line 46, in <module>
    from config import config
ModuleNotFoundError: No module named 'config'

Is it possible that you should import sdv.config instead of config?

UI elements broken on Firefox

Borders around buttons ("Player" / "Family" / "Skills") do not show, nor do the borders around the family picture frame.

See attached screenshot.

Ubuntu 14.04, Firefox 43.0.

Community Center

It would be great to see what bundles have been completed for a particular farm. Would be neat to see how quickly people have completed the Community Center (or JoJa even).

Unable to upload farm

I tried to upload my farm and received this error message.
Error: An error occurred whilst processing the save file.
I am currently using the beta version of stardew and i have no mods installed. I had mods installed before the beta but i uninstalled all of them as well as uninstalled smapi before the beta and backed up my farm then. I was able to upload the backup of my farm just fine but not the current version of it.

Deeper search options

Currently, search on the site only looks at farm name and farmer name. Adding support for searching by map type, spouse, or other meaningful criteria would be useful to a lot of people.

'Site not configured' over HTTP

The site at upload.farm is offline and shows this message:

Site not configured
If you are the owner of this website and weren’t expecting to see this message, here are some potential causes and solutions:

  • You recently created a new website record, but opened the URL before your changes were activated in the web server and DNS configuration. Wait a moment and refresh.
  • You created a new website record without the current subdomain (for example, www). Return to the control panel to add the current subdomain to the website record and refresh.
  • You added a new domain in the control panel but didn’t create a site record to link it with an application. Create a website record with the control panel and refresh.
  • Your website record is set for HTTPS, but you visited a HTTP URL (or vice-versa). Open the URL with the other protocol.
  • You tried to access your website by IP address. Access the website by domain name instead.
  • There is a problem with your account. Check the control panel for unresolved support tickets and check your email for recent messages from [email protected].

For more details, please see Error: Site not configured.

Error about asset not existing when it does

I'm getting an odd error when I try to run the app about how an asset file doesn't exist. The asset in question changes when I run the app (sometimes it's summer, sometimes winter, etc.), and it definitely exists. 🤔 Here's my backtrace:

% SDV_APP_SETTINGS=development FLASK_APP=runserver.py flask run
 * Serving Flask app "runserver.py"
 * Environment: production
   WARNING: Do not use the development server in a production environment.
   Use a production WSGI server instead.
 * Debug mode: off
2019-02-17 13:22:19,803 [INFO] UploadFarm.init - Creating flask app...
2019-02-17 13:22:19,804 [INFO] UploadFarm.init - Config name not supplied, searching environment
2019-02-17 13:22:19,804 [INFO] UploadFarm.init - Config name set to: development
2019-02-17 13:22:19,804 [INFO] UploadFarm.init - Initialising extensions
2019-02-17 13:22:19,817 [INFO] UploadFarm.init - Application set to use Postgres
Traceback (most recent call last):
  File "/usr/local/bin/flask", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 894, in main
    cli.main(args=args, prog_name=name)
  File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 557, in main
    return super(FlaskGroup, self).main(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 767, in run_command
    app = DispatchingApp(info.load_app, use_eager_loading=eager_loading)
  File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 293, in __init__
    self._load_unlocked()
  File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 317, in _load_unlocked
    self._app = rv = self.loader()
  File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 372, in load_app
    app = locate_app(self, import_name, name)
  File "/usr/local/lib/python3.7/site-packages/flask/cli.py", line 235, in locate_app
    __import__(module_name)
  File "/Users/cheshire137/code/Sketchy502/SDV-Summary/runserver.py", line 13, in <module>
    from sdv import app
  File "/Users/cheshire137/code/Sketchy502/SDV-Summary/sdv/__init__.py", line 156, in <module>
    import sdv.imageDrone  # noqa
  File "/Users/cheshire137/code/Sketchy502/SDV-Summary/sdv/imageDrone.py", line 14, in <module>
    from sdv.imagegeneration.avatar import generateAvatar
  File "/Users/cheshire137/code/Sketchy502/SDV-Summary/sdv/imagegeneration/avatar.py", line 5, in <module>
    from .assets import loadAvatarAssets
  File "/Users/cheshire137/code/Sketchy502/SDV-Summary/sdv/imagegeneration/assets.py", line 21, in <module>
    for season in SEASONS
  File "/Users/cheshire137/code/Sketchy502/SDV-Summary/sdv/imagegeneration/assets.py", line 21, in <dictcomp>
    for season in SEASONS
  File "/usr/local/lib/python3.7/site-packages/PIL/Image.py", line 2477, in open
    fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'sdv/assets/farm/summer_outdoorsTileSheet.png'

And here's the contents of that directory, showing that sdv/assets/farm/summer_outdoorsTileSheet.png does exist:

code/Sketchy502/SDV-Summary at wonderland (master ✗)
% ls sdv/assets/farm/
buildings                    spring_outdoorsTileSheet.png winter_outdoorsTileSheet.png
fall_outdoorsTileSheet.png   summer_outdoorsTileSheet.png
grass                        trees

The only thing I can think of is that I haven't put all the asset files in the sdv/assets/ directory yet, and maybe this error message is misleading in that it says the summer tile sheet isn't there, when really it's a different asset that isn't there that it expects. Any thoughts?

Tea Sapling rendered one tile further south than appropriate

The new Tea Sapling crop in 1.4 is rendered one tile south of their actual location.

You can see an example in this farm:
https://upload.farm/1Kzoae

The rendering error can be seen on the east side of the farm, there are 9 Tea Saplings positioned above each of the 4 Junimo Huts, surrounding the Deluxe Scarecrows.

Consider the following legend:

  • T : Tea Sapling
  • C: Deluxe Scarcrow
  • H: Junimo Hut
  • _: Stone Tile

The actual placement is like so:

 T T C T T
 T T T T T
 _ H H H _
 _ H H H _
 _ _ _ _ _

But the rendering appears like this:

     C 
 T T   T T
 T H H H T
 _ H H H _
 _ _ _ _ _

Exception when auto-uploader runs at startup on Windows

The auto-uploader runs perfectly when I open it manually, but the exception below is thrown when it tries to run automatically at startup. I'm able to click OK on the exception window then immediately open it manually and it works properly.

capture

Farmhand stats not shown correctly

Hey!

When uploading a savefile from a multiplayer farm, some stats of the farmhand are shown incorrectly, namely the steps taken (empty) and the time played (milliseconds not getting converted into hours). Also friendships and monster kills are farmwide, not individual per person, but I don't know if those stats are saved separately.

Example farm
Owner steps taken: <stepsTaken>60971</stepsTaken>
Farmhand steps taken: <stepsTaken>52651</stepsTaken>
Owner playtime: <millisecondsPlayed>26888448</millisecondsPlayed>
Farmhand playtime: <millisecondsPlayed>26858832</millisecondsPlayed>

Planner will implement fence with torches on it

Hi again!

So I have a plan to implement fence with torch into the planner and was wondering if you guys are also able to render it?
We can agree on the resource names here, current fences are named as "fence, wood-fence, stone-fence... etc" and I'd like to name the torched fences "torch-fence, torch-wood-fence, torch-stone-fence... etc"

Edit: It also appears that planner currently does not have wooden lamp posts "wood-lamp-post & iron-lamp-post" available, this is also something I'll add.

Edit2: These things went like, new objects are the following:
torch-fence torch-stone-fence torch-wood-fence torch-iron-fence torch-hardwood-fence wood-lamp-post iron-lamp-post

With best,
Henrik.

Failed Rendering on Farm Extended Layout

I keep getting a failed rendering message while using the Farm Extended layout. I've tried rendering with official layouts and there's no problem there.

Exact Text:
"stardew.info says
Upload.farm rendering failed. Please try again in a few minutes. If the problem persists, please contact us."

ba7c43de0953d41305fbe46d97652480

Did not receive email confirmation, unable to change password

I'm trying to change my password to make it more secure.

  1. There's no way to reset password after you are logged in.
  2. Using the reset password link while logged out, it says: "Email address not verified, please verify your account using the verification email sent when you registered before attempting to reset password!"
  3. Searched for email containing "upload.farm", none found. Perhaps my account was created before the confirmation was required, and if old_email_confirmation got sent out, I did not receive it (maybe it was marked and purged as spam).
  4. There's no way to resend confirmation email.

Integration with stardew.info

Hi!

I'm the author of stardew.info/planner @GitHub and I'm here to discuss possibilities to link these two tools.

Without going deeply into technical details yet, I'm just here seeking for your ideas & feelings on this idea and if we should discuss it further.

Few pros I would see from this:

  • As both of these tools are widely used in the community, bringing them closer together would definitely benefit the community as a whole.
  • As upload.farm is missing the "planning" functionality, integration with the planner would offer this.
  • As planner is missing the "render image" functionality, integration with upload.farm would offer this.
  • Users would have an easy way to start planning their farms with one click from upload.farm.

Few technical details:

  • Planner already supports importing your save game file into the planner. This is something upload.farm could use.
  • I would see this as "two separated tools linked" which means they would still both live on different domains and be managed by different people but would be connected via links from one to another.
  • They are both open source, managed by the community and don't run any ads, so in these areas they would fit well.

I'm open for all ideas & discussion on this topic.

Show that game is modded

Looking through the different farms makes me think of this as a leaderboard. Of course, if people augment the game, they can have higher numbers than is possible for those that do not use mods.

I don't know if it is possible to tell whether a game is modded from just the save file, but maybe talk to the SMAPI people to see if they put anything into it.

Summary Picture Issue

I uploaded my Summary a few days ago, on the page and i noticed that my second child is hidden from my cat.

image

[beta 1.3] Names Inaccurate

https://upload.farm/1FxA12 is my latest upload. It lists a rabbit with Asian (?) characters in the name, which is not the case for any of my animals. It lists the name of my cat as "mine", which is incorrect. You can view earlier gallery entries and it show my cat's name as "Spark", which is correct.

Not exactly sure which beta feature, if any, I used that caused problems. I've had the garden pot in previous uploads, but still haven't planted anything in it.

Unable to upload farms with beta cabins on them

The uploader will not accept uploads with the cabins on them. Understandable, as it's from an update, but I was hoping to use the uploader to show my buddies a half decent layout with the cabins on the map too.

Auto Upload Tool not updating

I'm sorry if this is the wrong place, but I'm having issues getting my farm to auto backup or upload those backups. I just got the tool today and am still trying to configure it. I have the two farms selexted that I want to be kept updated, but I played through several days after and it didn't save any of those days, or the last day I played either. Am I misunderstanding how this tool works, or did I do something wrong?
This is a screenshot of how the tool is configured on my screen, I can provide more info if necessary. I do use Smapi and mods, if that is causing an issue.

thank you!

image

Update tot support 1.4 farms

The new buildings in 1.4 farms are not rendered, if you have tea saplings in your 1.4 farm. Upload would fail.

Use of bootstrap theme?

Not an issue, a question to whoever made the brilliant layout; would you mind someone else using it, with proper attribution? I'm working on another Stardew helper app and have zero graphical skills, so would appreciate being able to use similar assets to yours to make it look better.

Thanks!

Show building interior

It would be great if SDV-Summary/upload.farm would also render the interior of the house, the greenhouse etc.!

Maybe show it via click/hover on the location on the big map?

Dates are one day ahead.

The dates displayed on the farm information are actually one day later than the actual image. For example a farm listed as 1st of Fall is actually shows the state of play at the end of the day on the 28th of summer. Also, it uses the sprites for the wrong season.

This is particularity obvious on the first of the month, where you can crops from the wrong month.

Here is an example: http://upload.farm/1BpC6G (Note the hops and tomato crops.)

This is probably caused by the date being one day ahead in the save file?

How to extract game assets?

I wanted to help contribute to the project and I got it running locally, however I get errors about missing assets. Do you have a script that I could use to extract the assets from the game into the directories you expect, or did you just do it manually?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.