1
0
mirror of synced 2024-11-27 23:40:48 +01:00
Arcade network service emulator for games that use SEGA's ALL.NET and related services.
Go to file
beerpsi 58a5177a30 use SQL's limit/offset pagination for nextIndex/maxCount requests (#185)
Instead of retrieving the entire list of items/characters/scores/etc. at once (and even store them in memory), use SQL's `LIMIT ... OFFSET ...` pagination so we only take what we need.

Currently only CHUNITHM uses this, but this will also affect maimai DX and O.N.G.E.K.I. once the PR is ready.

Also snuck in a fix for CHUNITHM/maimai DX's `GetUserRivalMusicApi` to respect the `userRivalMusicLevelList` sent by the client.

### How this works

Say we have a `GetUserCharacterApi` request:

```json
{
    "userId": 10000,
    "maxCount": 700,
    "nextIndex": 0
}
```

Instead of getting the entire character list from the database (which can be very large if the user force unlocked everything), add limit/offset to the query:

```python
select(character)
.where(character.c.user == user_id)
.order_by(character.c.id.asc())
.limit(max_count + 1)
.offset(next_index)
```

The query takes `maxCount + 1` items from the database to determine if there is more items than can be returned:

```python
rows = ...

if len(rows) > max_count:
    # return only max_count rows
    next_index += max_count
else:
    # return everything left
    next_index = -1
```

This has the benefit of not needing to load everything into memory (and also having to store server state, as seen in the [`SCORE_BUFFER` list](2274b42358/titles/chuni/base.py (L13)).)

Reviewed-on: https://gitea.tendokyu.moe/Hay1tsme/artemis/pulls/185
Co-authored-by: beerpsi <beerpsi@duck.com>
Co-committed-by: beerpsi <beerpsi@duck.com>
2024-11-16 19:10:29 +00:00
cert Begin the process of transitioning from megaime 2023-02-16 00:06:42 -05:00
core use SQL's limit/offset pagination for nextIndex/maxCount requests (#185) 2024-11-16 19:10:29 +00:00
docs core: pushing changes regarding MySQL ssl toggle that is now mandatory 2024-11-12 10:53:02 -05:00
example_config core: pushing changes regarding MySQL ssl toggle that is now mandatory 2024-11-12 10:53:02 -05:00
titles use SQL's limit/offset pagination for nextIndex/maxCount requests (#185) 2024-11-16 19:10:29 +00:00
.gitattributes add gitattributes to hopefully stop git from clowing our CSV, TXT and JSON data files 2023-11-25 00:43:48 -05:00
.gitignore ignore visual studio pro files 2024-11-03 08:46:12 -05:00
changelog.md update changelog 2024-08-11 02:22:10 -04:00
contributing.md update contributing instructions 2024-05-19 21:39:49 -04:00
dbutils.py use SQL's limit/offset pagination for nextIndex/maxCount requests (#185) 2024-11-16 19:10:29 +00:00
docker-compose.yml update pull request 2023-10-21 19:57:45 +02:00
Dockerfile delete "ADD config config" (#83) 2024-01-09 15:31:03 +00:00
entrypoint.sh re-add docker files for #19 2023-05-04 09:46:16 -04:00
index.py Fix --config option not being respected, fixes #172 2024-09-06 10:36:57 -04:00
LICENSE.txt add license 2024-01-29 02:06:59 -05:00
read.py fix: make database async 2024-11-14 12:36:22 +07:00
readme.md [mai2] add buddies plus support (#177) 2024-09-23 17:21:29 +00:00
requirements.txt oops forgot a dependency on aiomysql 2024-11-14 12:38:00 +07:00

ARTEMiS

A network service emulator for games running SEGA'S ALL.NET service, and similar.

Supported games

Games listed below have been tested and confirmed working. Only game versions older then the version currently active in arcades, or games versions that have not recieved a major update in over one year, are supported.

  • Card Maker

    • 1.30
    • 1.35
  • CHUNITHM INTL

    • SUPERSTAR
    • SUPERSTAR PLUS
    • NEW
    • NEW PLUS
    • SUN
    • SUN PLUS
  • CHUNITHM JP

    • AIR
    • AIR PLUS
    • AMAZON
    • AMAZON PLUS
    • CRYSTAL
    • CRYSTAL PLUS
    • PARADISE
    • PARADISE LOST
    • NEW
    • NEW PLUS
    • SUN
    • SUN PLUS
    • LUMINOUS
  • crossbeats REV.

    • Crossbeats REV.
    • Crossbeats REV. SUNRiSE S1
    • Crossbeats REV. SUNRiSE S2 + omnimix
  • Hatsune Miku: Project DIVA Arcade

    • Future Tone Arcade - All versions
  • Initial D THE ARCADE

    • Season 2
  • maimai DX

    • Splash
    • Splash Plus
    • UNiVERSE
    • UNiVERSE PLUS
    • FESTiVAL
    • FESTiVAL PLUS
    • BUDDiES
    • BUDDiES PLUS
  • O.N.G.E.K.I.

    • SUMMER
    • SUMMER PLUS
    • R.E.D.
    • R.E.D. PLUS
    • bright
    • bright MEMORY
  • POKKÉN TOURNAMENT

    • Final Online
  • Sword Art Online Arcade

    • Final (Single player only)
  • WACCA

    • Lily R
    • Reverse

Requirements

  • python 3 (tested working with 3.9 and 3.10, other versions YMMV)
  • pip
  • memcached (for non-windows platforms)
  • mysql/mariadb server

Setup guides

Follow the platform-specific guides for windows, linux (Debian 12 or Rasperry Pi OS recomended, but anything works) or docker to setup and run the server.

Game specific information

Read Games specific info for all supported games, importer settings, configuration option and database upgrades.

Production guide

See the production guide for running a production server.