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

When Connecting to with the mod Lsky Pro, all config options fail on image upload, No API Key can be found. #4

Open
House-Kitty-Mew opened this issue Mar 3, 2024 · 12 comments

Comments

@House-Kitty-Mew
Copy link

I set up everything as it should however I cannot for the life of me find where the API key I use for the mod is located after setting up and hosting Lsky Pro cloud photo album, Where do I find the API key and if it's not needed how do I format the config to just allow uploads from the mod?

@House-Kitty-Mew
Copy link
Author

I found a way to generate my token but it still dose not work with the config
configerror
Uploading configerror.png…

@zbx1425
Copy link
Owner

zbx1425 commented Mar 4, 2024

There's an error in the tutorial, I forgot to update that
The config for LSKY should be like this instead:
lsky: <API URL>?<API Key>;
And the API Key should not include "Bearer" in it.

@House-Kitty-Mew
Copy link
Author

House-Kitty-Mew commented Mar 4, 2024

Ah, that explains why none of my attempts were successful. I also noticed you mentioned not knowing how to save locally yet. Why not consider using SQLite? It would be a straightforward solution to store the information along with a base64 representation of the file data. Then, you can easily reverse the process when retrieving the data. Moreover, all the necessary functions are already available in your framework.

@zbx1425
Copy link
Owner

zbx1425 commented Mar 4, 2024

Bandwidth's the main concern here, I was afraid that occupying the server to client network bandwidth (which can be quite limited esp. for hosting at home and accessing from somewhere far away, or for some budget hosting providers) with image transfers would increase latency of the more important gameplay packets.
So to avoid affecting gameplay network I went with enabling serving images from a separate server.

@House-Kitty-Mew
Copy link
Author

I recommend steering clear of using the game's networking infrastructure. Given that you already have the file data, there's no need to package it and transmit it to a server or over the network stack. Instead, opt for converting the data to base64 and securely storing it in a database. Consequently, when the comment reopens, it can effortlessly retrieve the data from the database on the client side without the necessity of sending it elsewhere or using the networking stack.

@zbx1425
Copy link
Owner

zbx1425 commented Mar 4, 2024

Well for a multiplayer session, the image has to go over the network one way or another, to appear on the other player's computer, isn't it
P2P isn't an option since NAT, so you either have it sent over the server running the Minecraft server, or over another server running something else
The former has the bandwidth issue I mentioned before, and the later is the current setup.
I dunno what kind of database you're talking about? If you're talking about some third-party online database services, using that isn't much different than using an image hosting website as how it's currently implemented.

@House-Kitty-Mew
Copy link
Author

Transform the textual data encoded in base64 effortlessly by dispatching it to a web server through a straightforward URL invocation. No need for intricate peer-to-peer connections or sophisticated socket configurations; a classic web server will suffice. Establish a streamlined framework for periodic check-ins to receive any gameplay updates, and effortlessly retrieve data as required through a straightforward webpage pull. Convert the response from base64 into its original data format, and voila, network concerns elegantly resolved.

@House-Kitty-Mew
Copy link
Author

Untitled

@zbx1425
Copy link
Owner

zbx1425 commented Mar 4, 2024

Ah sorry for that, this was sorta more like a personal project at that time and I did it badly
It should be like lsky: http://....../api/v1/upload?1|......;
I have updated the document on this

@zbx1425
Copy link
Owner

zbx1425 commented Mar 4, 2024

No need for intricate peer-to-peer connections or sophisticated socket configurations; a classic web server will suffice.
I see your point

You mean instead of the current "comment texts still via Minecraft, but images via separate web server", just put everything on a separate web server instead, nothing gets stored in the Minecraft savefile, and get the data going through HTTP requests and store everything in a proper database?
That makes sense, but might be a bit difficult to set up for some casual players just wanting to check the function out. Also getting the comment data stored together with the Minecraft world would be easier to manage and move around. Plus, I live in PRC where setting up a web server is, let's say, a not so trivial thing to do.

@House-Kitty-Mew
Copy link
Author

Ah sorry for that, this was sorta more like a personal project at that time and I did it badly It should be like lsky: http://....../api/v1/upload?1|......; I have updated the document on this

Wow, it's finally working! I can't express how relieved I am right now—I actually shed a few tears. I dedicated a solid 36 hours trying to troubleshoot it solo, and I only reached out to you after hitting a wall. 😅

In terms of storing the data, I came across this mod on https://modrinth.com/mod/cesium that aligns perfectly with my initial suggestion. They're tackling the storage issue for entire world files. Have you considered integrating a hook into this? It could potentially resolve all your storage concerns. As for a decentralized, non-webserver-based data linking solution, you might explore implementing a main networking stack to transmit concise connection setup configurations upon joining. Then, each client could run a smaller server on a separate socket, facilitating communication within your networking stack. A nimble, event-based system could handle the data exchange between the mini-server and the main thread loop seamlessly.

@House-Kitty-Mew
Copy link
Author

So I was able to hack together support for local, theirs really only 2 ways to do it,

Run another scripting mod inside the client (I used Minescript for python) and just create a complete and custom solution *best option

Use the main networking stack but base64 for image, split it into much smaller packets of data then stagger send them over a longer period with plenty of time padding so as not to impact the main stack, this makes it MUCH slower but the trade off is that the network isn't impacted greatly anymore.

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