Giter VIP home page Giter VIP logo

room-server's Introduction

room-server

Build

Wiki

What is this?

room-server provides a server usable with Wii no Ma.

Running

Refer to this page for instructions on Self Hosting.

Contributing

We strongly appreciate all contributions, no matter how big or small! Thank you for your interest in our work!

Please make sure you follow these guidelines when contributing:

  • Run the Black formatting tool on your changes.
  • Please add comments if you believe it may be unclear on why something was done. (For example, a limit on a string, or a workaround.)

License

room-server is available under the MIT License.

room-server's People

Contributors

dhtdht020 avatar larsenv avatar noahpistilli avatar oscie57 avatar spotlightishere avatar termofficial avatar toffee-makes-things avatar zurgeg 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

Watchers

 avatar  avatar  avatar  avatar  avatar

room-server's Issues

Investigate pay intro information

(This issue is inspired by 1fe1250.)

For whatever reason, the linkid (category ID) specified within a pay intro always falls back to listing the contents of a normal category. We should investigate this behavior, as something else may be going on.

Finish Popular section in Videos

As of ba68333, we are now able to write the user's voting data to a database. This allows for us to make a proper popular section. In it's current state, the popular section returns a blank screen. This will need to be fixed in order for us to make the section read from our db.

Screenshot 2021-07-06 185352

Handle Mii management from web panel

We already have bare-bones functionality to add and import Miis, but it does not match how tables are defined for newer revisions. It should be updated for full completion.

Handle intro types

We currently hardcode one intro type. This should eventually be more customizable.
We'll probably want similar with how we do with posters currently DB-wise.

There are a few types that still need investigation before implementation:

  • What possible cnttypes are there? As it stands from validation, there appears to be 0 (named UNK for our purposes) and 1 (referenced as CAT within strings).
  • What possible linktypes are there? There appears to be from 0 to 5, but what do they do?

As it stands, we have a very specific arrangement for introinfo:

<introinfo>
  <seq>1</seq>
  <cntid>1</cntid>
  <cnttype>1</cnttype>
  <dispsec>5</dispsec>
  <dimg>1</dimg>
  <random>0</random>
  <linktype>0</linktype>
</introinfo>

This is mandated by the validation function for the first sequence. Seeing as type 1 loads an image, it is most likely an image - this needs verification that other things cannot be passed within a second sequence.

Here is a quick list of validation constraints that will hopefully prove to be useful later:

  • If we have a content type of UNK, we must have dispsec set to true. For CAT, we must not have it.
  • Similarly if we have a content type of UNK, we must have dimg set to true. For CAT, we must not have it.
  • If we have a link ID type of 0, we must have a linkid specified.
  • If we have a link ID type of 2 or 5, we must have a catname. (However, for type 5, the catname is eventually discarded. TODO: figure out why)
  • If we have a type of UNK and a catname, it must have... something set. TODO: figure out what this something is

TODO: figure out what happens to types such as 1, 3 and 4 as they are not referenced at all by this code.

As follows is an edited version of the validation code that this issue is based off of.

Validation code
int ValidateEventIntroInfo
        (/* unused arguments */ EventIntroInfo *introInfo) {

        if (introInfo->seq == 1) {
                if (introInfo->random == 1) {
                        XMLError(param_2,0x2f);
                        return 0;
                }
                if (introInfo->cnttype != CAT) {
                        XMLError(param_2,0x34);
                        return 0;
                }
                if (introInfo->linktype != TYPE_ZERO) {
                        XMLError(param_2,0x35);
                        return 0;
                }
                if (introInfo->dimg < 1) {
                        XMLError(param_2,0x4c);
                        return 0;
                }
        }

        CNTTypes cnttype = introInfo->cnttype;
        if (((cnttype == UNK) && (introInfo->hasDispsec != false)) ||
            ((cnttype == CAT && (introInfo->hasDispsec == false)))) {
                XMLError(param_2,0x30);
                return 0;
        }

        if (((cnttype == UNK) && (introInfo->hasDimg != false)) ||
            ((cnttype == CAT && (introInfo->hasDimg == false)))) {
                XMLError(param_2,0x31);
                return 0;
        }

        LinkTypes linkType = introInfo->linktype;
        if (((linkType == TYPE_ZERO) && (introInfo->hasLinkId != false)) ||
            ((linkType != TYPE_ZERO && (introInfo->hasLinkId == false)))) {
                XMLError(param_2,0x32);
                return 0;
        }

        bool needsCatname = false;
        if ((linkType == TYPE_TWO) || (linkType == TYPE_FIVE)) {
                needsCatname = true;
        }

        if (needsCatname == introInfo->hasCatname) {
                if ((cnttype == UNK) && (introInfo->hasSomething == false)) {
                        XMLError(param_2,0x3f);
                        return 0;
                } else {
                        if (linkType == TYPE_FIVE) {
                                introInfo->hasCatname = false;
                        }
                        return 1;
                }
        } else {
                XMLError(param_2,0x33);
                return 0;
        }
}

Handle account management from web panel

There is currently no way to create a user beyond manual insertion of a hash. We should allow password reset for users who have been manually inserted.

Additionally, we should most likely investigate permission levels on creation.

Permissions system

Currently, the Underground only has one type of user. This allows anyone with access to add users and modify everything on the panel.

A basic permissions system would allow accounts to be made for partners, and for more specific things.

It can go one of two ways:

  • Role-like system, where each user has a specific role with permissions
  • Value-like system, where every user has a value that grants specific permissions

Some examples of permissions may be:

  • Ability to add users
  • Ability to add parade rooms
  • Ability to upload/modify videos

An example of this system could be that a partner would like to make and manage a room on the service. Instead of having someone else doing it and playing telephone, access could be granted specifically for room creation (and maybe access to only certain rooms could be possible, if the rooms were linked to company roles themselves (for example, Sudomemo role, allowing access to make/modify other rooms under the Sudomemo role))

Fix special paths

Leaving these here so I know to come back to them.

GET /special/0/page.xml
GET /special/0/img/g1234.img

Handle poster management from web panel

Now that we have a working listing of movies, we can more easily associate a movie ID. Additionally, we can properly resize uploaded posters to a format acceptable for the Wii.

Flask run problem

flask run --host :: --port 80
Traceback (most recent call last):
File "", line 198, in _run_module_as_main
File "", line 88, in run_code
File "C:\Program Files\Python311\Scripts\flask.exe_main
.py", line 7, in
File "C:\Program Files\Python311\Lib\site-packages\flask\cli.py", line 1063, in main
cli.main()
File "C:\Program Files\Python311\Lib\site-packages\click\core.py", line 1055, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\click\core.py", line 1657, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\click\core.py", line 1404, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\click\decorators.py", line 84, in new_func
return ctx.invoke(f, obj, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\click\core.py", line 760, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\flask\cli.py", line 911, in run_command
raise e from None
File "C:\Program Files\Python311\Lib\site-packages\flask\cli.py", line 897, in run_command
app = info.load_app()
^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\flask\cli.py", line 308, in load_app
app = locate_app(import_name, name)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Program Files\Python311\Lib\site-packages\flask\cli.py", line 218, in locate_app
import(module_name)
File "C:\room-server-master\room.py", line 40, in
@app.before_first_request
^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'Flask' object has no attribute 'before_first_request'. Did you mean: '_got_first_request'?

Handle parade management from web panel

As parades directly link to rooms, we additionally need to:

  • allow management of Miis within the parade
  • allow association of Miis (perhaps have each room have one Mii it uses?)
  • allow management of signs held by Miis

Implementations I've been thinking of, and hopeful fix of path traversal bugs?

So firstly, I am going to be selling parts of my software on the WIi No Ma store, or pre-compiled versions for that matter. iOS jailbreaks are the main thing.
Also, some of the other things I am putting on the store are My Aquarium tanks, mystery randomly generated ones. This is why my scripts pre-support these two things.
Speaking of which though, the scripts have a lot of path traversal bugs, including mine. I am hoping we can fix these.

"GET / HTTP/1.1" 404 and "GET /favicon.ico HTTP/1.1" 404 (Flask Localhost Failure + 404)

CMD:

* Serving Flask app 'room.py'
 * Debug mode: on
WARNING: This is a development server. Do not use it in a production deployment. Use a production WSGI server instead.
 * Running on http://localhost:80
Press CTRL+C to quit
 * Restarting with stat
 * Debugger is active!
 * Debugger PIN: 714-994-209
127.0.0.1 - - [24/Sep/2023 09:42:54] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [24/Sep/2023 09:42:54] "GET /favicon.ico HTTP/1.1" 404 -
127.0.0.1 - - [24/Sep/2023 10:07:32] "GET / HTTP/1.1" 404 -
127.0.0.1 - - [24/Sep/2023 10:42:40] "GET / HTTP/1.1" 404 -

When I typed in "localhost" in my browser, the results are:

Not Found The requested URL was not found on the server. If you entered the URL manually please check your spelling and try again.

This is supposed to be a self hosting for a project I'm doing. The requirements are: Python PostgresSQL

I can't share my db_url though, but from my config Python file, but I have my username, password, localhost, and database.

This development server is supposed to serve for room.py.

I was expecting the localhost to be a success run but failed and I got 404 errors from the CMD.

https://i.stack.imgur.com/YLteT.png

autoincrement at pay categories

header.xml gives an error at img 0 when a img isn't beginning to 1 or 20000 on pay categories.
i'm not sure about that but snoot tell me that it could be a bug.

question?

can you use Mysql too or is it limited to
postgresql?

and also if only postgresql works then which version does work?

Error on wii no ma launch

I keep getting error 354163 when launching wii no ma after setting up the server
I uploaded all the necessary content on the admin panel, do you know what the error means?
image
this is everything it downloads from the server, all of them return 200 OK
image

How can I add new translations?

The Wii Room patches localiztion file puts the language code to the User agent so I thought that all the text would be here but I don't know where.

It would be nice to know if it is possible to add new translations, and if possible, how.

Thanks!

Parade image updates silently failing

Parade image updates are silently failing once edited within The Underground. It's unknown why this isn't changing - editing is broken in several others. This issue will hopefully evolve to cover other editing-related errors.

flask run gives out, “ importerror:cannot import name BaseQuery“

so i tried this command, (flask run :: —port 80) and this is what i get:

\cli.py", line 219, in locate_app
import(module_name)
File "C:\room-server-master\room.py", line 7, in
from models import db, login
File "C:\room-server-master\models.py", line 3, in
from flask_sqlalchemy import BaseQuery, SQLAlchemy
ImportError: cannot import name 'BaseQuery' from 'flask_sqlalchemy' (\AppData\Local\Programs\Python\Python312\Lib\site-packages\flask_sqlalchemy_init_.py)

Maintenance Problem

When I get past the intro I get error code: 354608, and a message saying that "We apologize, Wii Room is currently undergoing maintenance. Please check again later" Did I do something wrong? Or is it actually going under maintenance?

Handle room management from web panel

We currently hardcode all rooms to be the same one. This should be changed.
We need to:

  • restructure room code to read from a defined table
  • allow movie association for rooms
  • have panel functionality to create and destroy rooms

Room offering types must be implemented:

  • smp (possibly an external website?)
  • enq (enquete, possibly voting?)
  • mov (shows a movie)
  • coup (shows a coupon)
  • link (opens the Internet Channel)
  • pic (shows(?) a picture)

Can we figure out what's wrong with ratings?

So my current progress on this is that noping 80054c50 I get 354116, @spotlightishere What does this error mean?
Anyway, by noping that address, I effectively removed the if statement on line 23 which says:

if (iVar == 0){
    SetNodeMissing(param3,somethingsomethingsomething);
}

Which makes me think that we have a missing node. Can anyone take a look at this?

Handle user time

It's been discussed to use the user's time within Wii no Ma.
For reference, currently we obtain the current time in UTC:

<RegionInfo>
  <ver>399</ver>
  <sdt>2021-01-23T16:35:21</sdt>
  <cdt>2021-01-23T16:35:21</cdt>
  <limited>0</limited>
</RegionInfo>

sdt is server time, and cdt is the time parsed to present to the user on startup and for environmental usage. (Presumably server time would be UTC and cdt would permanently be JST.)

Theoretically, we could obtain the user's time somehow and present this back to them. This may involve modding our next distribution to send the console's current time, or doing GeoIP wizardry.

This leaves a few questions:

  • Is cdt guaranteed to only be what's presented?
  • Which method is most accurate? Are there alternatives?

and lastly, stemming from the above:

  • If we were to patch and send the client's time, how?
  • If we were to do GeoIP, how?

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.