简体   繁体   English

如何为游戏模块在线管理图像?

[英]How should I go about managing images online for a game mod?

I am working on a mod for a game. 我正在为游戏开发mod。 Currently, the mod checks to see if an image (the image is a texture for the 3d model) with the filename that is the username is online at a certain location (So currently, I'm using Dropbox to hold these images, so it checks with my public directory). 当前,mod会检查文件名为用户名的图像(该图像是3d模型的纹理)在某个位置是否在线(因此,目前,我正在使用Dropbox来保存这些图像,因此检查我的公共目录)。 If that image is online, it renders a model on the player and applies that image to the model. 如果该图像在线,它将在播放器上渲染一个模型并将该图像应用于该模型。

I can manually upload images (with the username as the filename) up to the website that holds the images, but I plan on making this mod public and obviously that won't work if hundreds of players want to use this mod. 我可以手动将图像(以用户名作为文件名)上传到保存图像的网站,但是我计划将此Mod公开,显然,如果成百上千的玩家想要使用此Mod,那将是行不通的。 What I need is when the user ticks or unticks the option to apply that model to their character, the image will become available or unavailable to the client, allowing the client to decide whether to render the object or not on the player. 我需要的是,当用户勾选或取消选中将模型应用于其角色的选项时,图像将对客户端可用或不可用,从而使客户端可以决定是否在播放器上渲染对象。

I don't know anything about databases or web design/coding and I only have a vague idea on how to go about this. 我对数据库或Web设计/编码一无所知,而我对此却只有一个模糊的想法。

I need some way to make the image available or not. 我需要一些使图像可用或不可用的方法。 Should I: 我是不是该:

  • Have the filename change? 文件名更改了吗? So something like from eegabooga.png to eegaboogaunused.png eegabooga.pngeegaboogaunused.png
  • Have a MySQL database that has the images and a boolean. 有一个包含图像和布尔值的MySQL数据库。 So true means it's a used image and false means it's unused? 那么true表示它是已使用的图像, false表示它未使用? (Sorry if that makes no sense, I have no knowledge about MySQL or any sort of databases). (对不起,如果没有意义,我不了解MySQL或任何种类的数据库)。
  • (Something you think would be better). (您认为这会更好)。

Sorry if this makes little sense. 抱歉,这没有什么意义。 I will try to explain anything in further detail if you need, just ask. 如果您需要,我会尝试进一步解释,只是问一下即可。 I appreciate the help! 感谢您的帮助!

So - I'm guessing the checkbox exists outside the mod? 所以-我猜该复选框存在于mod之外? Otherwise, the mod should handle the hide/show of the file. 否则,国防部应处理文件的隐藏/显示。

If the checkbox is on a website, then use that website to control access. 如果该复选框位于网站上,则使用该网站来控制访问。 Route all image requests through the website, and let the website redirect the request on to DropBox or Amazon S3 if access is permitted - otherwise, reject the request with a 404. 通过网站路由所有图像请求,如果允许访问,让网站将请求重定向到DropBox或Amazon S3-否则,使用404拒绝请求。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM