Git Product home page Git Product logo

outrun's Introduction

outrun

Summary

Outrun is a custom server for Sonic Runners, reverse engineered from the Sonic Runners Revival (Now uses Outrun) project.

Goals

  • Implement all non debug endpoints as fulfilled by the original server
  • Maintain speed throughout runtime
  • Consume little resources for conservative deployment

Current functionality

Notable:

  • Timed Mode
  • Story Mode
  • Ring/Red Star Ring keeping
  • Functional shop
  • Character/Chao equipping
  • Character leveling and progression
  • Item/Chao roulette functionality
  • Events
  • Basic ranking

Functional:

  • Android and iOS support
  • High score keeping
  • In game notices
  • Deep configuration options
  • Powerful RPC control functions
  • Ticker notices
  • Small database size and memory footprint
  • Low CPU usage
  • Analytics support

Building

  1. Download and install Go 1.15.8 (NOTE: Go 1.16+ currently break the ability to build some or all of Outrun, such as RPC programs. A fix should hopefully be coming soon!)
  2. Download and install Git (for go get)
  3. Set your GOPATH environment variable
  4. Open a terminal/command prompt
  5. Use cd (Windows, Linux/macOS) to navigate to a directory of choice
  6. Run go get github.com/fluofoxxo/outrun and wait until the command line returns
  7. Run go build github.com/fluofoxxo/outrun and wait until the build is complete
  8. Run the produced executable (outrun.exe on Windows, outrun on Linux/macOS)

Binary releases can be found in the releases tab.

Modifying an APK to connect to your instance (from Windows)

  1. Install dnSpy (dnSpy-netcore-win64.zip)
  2. Install 7-Zip
  3. Install ZipSigner on an Android device or emulator
  4. Open a Sonic Runners v2.0.3 APK file with 7-Zip
  5. Navigate to assets/bin/Data/Managed and extract all the DLL files to their own folder
  6. Open Assembly-CSharp.dll in dnSpy
  7. Open the class NetBaseUtil, and find the variable mActionServerUrlTable
  8. Edit every string in the mActionServerUrlTable array to http://<IP>:<PORT>/ where <IP> is replaced by the IP for your instance and <PORT> is replaced by the port for your instance (Default: 9001)
  9. Repeat step 7 for mSecureActionServerUrlTable
  10. If you have an assets server, use its IP and port to replace the values in mAssetURLTable and mInformationURLTable to http://<IP>:<PORT>/assets/ and http://<IP>:<PORT>/information/ respectively
  11. Click File -> Save Module... and save the DLL file
  12. Drag the newly saved Assembly-CSharp.dll back into assets/bin/Data/Managed in 7-Zip, confirming to overwrite if asked
  13. Transfer the APK to an Android device and use ZipSigner to sign it
  14. Install the APK

Misc.

Any pull requests deemed code improvements are strongly encouraged. Refactors may be merged into a different branch.

Palmbound (Public Development Server)

As of 1 September, 2019, an instance of this server named Palmbound is currently publicly accessible. App file downloads can be acquired by joining the Palmbound Download Discord server: https://discord.gg/eeQAe8R

Credits

Much thanks to:

  • YPwn, whose closest point of online social contact I do not know, for creating and running the Sonic Runners Revival server upon which this project bases much of its code upon.
  • @Sazpaimon for finding the encryption key I so desparately looked for but could not on my own.
  • nacabaro (nacabaro#2138 on Discord) for traffic logging and the discovery of DaGuAr's asset archive.

Additional assistance

  • Story Mode items
    • lukaafx (Discord @Kalu04#3243)
    • TemmieFlakes
    • SuperSonic893YT

outrun's People

Contributors

f121live avatar fluofoxxo avatar mtbcooler avatar ramen2x 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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

outrun's Issues

Character IDs are improper

The character IDs as listed in game code go from 300000 to 300028, however the game only expects 300000 to 300020. This makes sense when looking in game, but these IDs compare improperly to what is found in game code. In addition, the game seems to want to look for the full 29 characters, but throws index related exceptions when there are more than 21 characters.

Either find the correct IDs from the code or use deduction to find the correct IDs. Event character IDs will likely not be found until the events are sent. I am in the dark on how an index error is occurring for these characters.

This needs an urgent fix because it makes readability for these sections absolutely brutal.

Roulette occasionally doesn't appear

This is an extremely rare bug, as I've only encountered it once, and external reports are sparse.
At least for accounts that are reset using RPC commands, or perhaps new accounts, the game doesn't load the Chao roulette (Sprites, items, only the back button works) until the item roulette has been entered. Outrun does appear to be sending the correct data, so it may be a caching issue on the side of the game.

Fix character prices

Characters should have proper prices as listed in obj/constobjs/character.go, with NumRedRings and PriceRedRings.

Maxing out characters/Chao on Chao roulette

When an entire rarity (1+2 Chao, 100 Character) has been upgraded to its maximum as defined by Player.GetAllNonMaxedCharacters and Player.GetAllNonMaxedChao, the search for a rarity of a Chao continues indefinitely, hanging the server and allocating lots of memory and ramping the CPU usage to its highest.

Game corruption

After about an hour of idling in the 'Your Characters' menu, I attempted to change character using the newly pushed handler in rewrite-1, and the game flipped the button text to Japanese and seized up. This may have been the lack of a valid session ID (needing to request a new one) combined with the lack of a /Chao/equipChao handler.

Alternatively, this may have been the work of the native library's DegradeAppInSubtleWays exported method. More research must be done to conclude this.

Not all Chao unlocked

With the push of c546bd4, it seems that not all Chao are unlocked in game. I haven't done any investigation into this, but it may have to do with the 'dealing' flag.

Run stress tests on database

It's currently unknown what the limits of the bbolt database in relation to this project are. Investigate this through automated insertion of dummy player data.

#2 should be solved and closed before testing the database can begin for the sake of being able to have numerical metrics on performance.

Root Folder


I would suggest using a /Source/ folder to
reduce the humongous amounts of folders.


Roulette rejecting ticket counts & presence of 'phantom' tickets

When committing a wheel spin, error -30401 is responded to the player, even if they have free spins left.

Originally, I believed that it was due to a lack of tickets, but the phenomenon has been observed with at least one ticket remaining.

'Phantom' tickets have been reported by players, but I am still unsure of the specific meaning. I'll test tonight and try to reproduce, though I suspect the core of the issue may be with the database, specifically the values for Player.RouletteInfo and Player.PlayerState.NumRouletteTicket.

Upgrading character without sufficient rings causes error

Without sufficient rings, the game will show the status code sent by the server rather than catch that the user does not have enough rings and not sending the request. Before the implementation of upgradeCharacter (a10085d), the game would catch not having enough rings first. I'm not sure why this happens, but it would be nice to fix for any tagged release, since it's technically incomplete.

Remove old session IDs after given time

Currently session IDs are cluttering up the database and leaving security flaws. Patch these using a session ID timed clearing.

The game expects the session ID to be cleared after an hour.

I cannot get the client to work

Using a 2.0.3 client (2.0.3t) and an asset server, the client connects and seems to download assets, but then gets stuck at loading the actual game at 3%, no matter what I do.

No errors on the game server or asset servers.

Anyone have any insight into this?
Thanks in advance

Config RPC missing game config functions

This is not to make it to Tag 1.0.
The Config struct is missing a ReloadGameConfig function and config reloading within ReloadAllConfigs. This isn't terribly consequential, but should be remedied.

Remove options/ directory, or find a use for it

There's really no reason for it to exist, since it's more than likely going to be superseded by configuration options. Consider whether or not this directory and contained files should be kept.

Lack of JSON templates

Could someone provide me with templates for the game's JSON files? I'm new to this and if anyone has a template (or knows how to generate them) please let me know.

Migrate Helper.Out to use formatting

Some helper.Out calls rely on fmt.Sprintf or type conversions in order to display information. With aeca995, Helper.Out now supports formatting with fmt.Sprintf. These prints should be converted to use this.

Campaign items are incorrectly gained

They appear to be offset, but more research needs to be done. The current implementation is almost certainly incorrect, but all items are gained by the end anyways.

Problematic depletion of exp. from character for upgrades

When the experience of a character goes into the negatives as a result of upgrading, it breaks the "play character's" experience when completing a level. Experience would be gained based on distance or score, and a level up if earned in this level. The experience going into the negatives is clearly not how the price should be increased.

Characters can be leveled past 100 with purchases

The game seems to ignore the fact that a character is at level 100 and allows them to be leveled with a Ring purchase even at level 100. This may be due to the fact that the characters do not have their status set to enums. CharacterStatusMaxLevel when being leveled to max.

Properly handle invalid ID being sent/keys not present

The server currently panics when an ID that is not in the database is sent, due to the key not being found, which panics the server. Find a way to handle this so that the server does not shut down due to a deleted ID.

Find best way to handle reconnect

When the session expires, the game will attempt to reconnect. Make sure that this is not a problem for the server.

This can be forced by going to an endpoint that has not been implemented yet (i.e. Roulette) and kicking yourself back to the main menu by denying to continue connection.

Find high speed, low storage database

bbolt, while somewhat OK with accessibility, has significant performance issues, with the main bottleneck being write operations consuming anywhere from 50ms to 100ms on each handler. Read operations seem to be faster, but not to any significant degree consistently.

Hook into AESCrypt

Current point of interest is mission IDs. These are stored locally, but dnSpy is unable to tell me where. Hooking into AESCrypt will allow us to find these IDs, among other data.

Experiment with single character

It's a bit difficult to find substantial documentation on a new player in 2.0.X, but it's almost certain that having two characters, a main character and a sub character, was not intended to be accessed so early in gameplay, as hinted by campaign dialogue.

This may be influenced by the fact that characters are earned easier in Outrun than the vanilla game.

Custom error codes for dead endpoints

Currently the error ID displayed by the game is set to 0 on any dead endpoint. I believe that this is due to the lack of an error code from the server, and uses the default in its code. Can we use this for specific error codes telling the player what's wrong specifically?

Allow insecure requests

Insecure requests are sent at least by /Battle/ requests. Sate the ability to utilize the data sent by these requests.

Notes:

  • secure = 0 when the request is insecure.
  • param is URL escaped when insecure.
  • key = nothing when insecure.

False player data after completing campaign points

If a reward was gained from playing through Story Mode, those rewards will only show up correctly after all of the dialogs are completed.
The game may be subtracting the amount of items just gained from the current player state just for aesthetic purposes. There must be more research on the effects of this.

Find what makes the game "lag"

There's a core difference right after the start screen loading bar in rewrite-1: the screen stays black for around 30 seconds. What makes this happen? What is different that causes this to happen?

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.