dragonbane

MW Design

Jul 19th, 2019 (edited)
263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 11.37 KB | None | 0 0
  1. SSL:
  2. -Implement server.setSecureContext everywhere after a 24h timeout to fix express SSL expiration (node js 11 required)
  3.  
  4. Ads:
  5. -use SEMRush to optimize keywords with gaming related ones. Best landing page is the generator and index. Figure out its keywords and apply them more to other pages
  6.  
  7.  
  8.  
  9. TODO GUI:
  10. -Move version text and social icons to new menu point About. Add text to the social icons, e.g. "wanna support us on patreon?" etc.
  11. -new popups use nativeWindowOpen (maybe). If normal window, show normal windows frame with the same size of the main window and show the toolbar html (back/forth/refresh button) and render the contents into the below WebView (maybe with tabs, maybe not)
  12. -add a top of page placeholder outside the app on a small black background part just below the wrapper, ensure it never gets removed while the app runs, to avoid new ad slots appearing/disappearing constantly
  13.  
  14. -test deployed GUI app on ootr.com with packaged electron dist and auth
  15. -maybe implement nebular analytics system
  16.  
  17.  
  18. After:
  19. -add process reader and expand it
  20.  
  21. -add server backend with socket io chat room list (in angular show infinitely scrolling list that you can filter)
  22. -if online mode use restricted mode and just display the active server/room list, socket io server allows to call that route without prior auth. Everything else is blocked and prompts with the app download in the online app (while socket io server returns an auth error)
  23.  
  24.  
  25.  
  26.  
  27. Either use TCP connection or hole punch an UDP port by first connecting via TCP which allows the server to connect to the client likewise via UDP, since the firewall/router has to allow incoming connections from this IP then
  28.  
  29. IOS9 : (no networking support)
  30. IOS12: 11.49 - 12.01 (no low delay sockets)
  31. IOS13: 12.27 - 13.82 (no low delay sockets)
  32. IOS17: 12.02 - 12.54 (no low delay sockets)
  33. IOS21: 24.00 - 12.01 (no low delay sockets)
  34. IOS22: 12.47 - 12.21 (no low delay sockets)
  35. IOS28: 11.54 - 10.90 (no low delay sockets)
  36.  
  37. IOS31: 7.52 - 7.12 (introduces low delay sockets)
  38. IOS37: 8.00 - 7.44 (used by WiiWare titles)
  39.  
  40. IOS53: 6.67 - 7.30 (introduces faster reset) (used by Super Mario Bros. Wii)
  41. IOS55: 7.35 - 9.79 (Need for Speed: Undercover and Wii Sports Resort)
  42. IOS56: 6.78 - 7.46 (used by Super Mario Galaxy 2)
  43.  
  44. IOS58: 7.40 - 7.17
  45. IOS61: 15.51 - 6.72
  46. IOS80: 6.92 - 11.80
  47.  
  48.  
  49. Prefs:
  50. IOS53 (used by Super Mario Bros. Wii)
  51. (change byte 0x18B in the metadata.tmd from 0x9 to 0x35)
  52.  
  53.  
  54. IP PC: 192.168.178.36
  55. port = 7332
  56.  
  57. Wii IP: 192.168.178.50
  58.  
  59. Bizhawk rupee counter: 0x11ACB4
  60. Dolphin WiiVC Rupee counter: 0x810CEDD4 (0x80FB4120 should be the root)
  61. Dolphin WiiVC Randomizer Rupee counter: 0x810CE724 (normal -0x6B0)
  62. Normal LinkY: 0x8118F438
  63. Rando LinkY: 0x8118EB78 (normal -0x8C0)
  64.  
  65.  
  66. Flow C++ app/console:
  67. Node sends twitch token, connection mode data, one time only Watchlist and permanent watch list to c++ app
  68. Handshake handled first, process reader or console confirms twitch token remotely depending on mode. Send token to server which checks if it belongs to our client ID and is valid, then creates the CRC32 hash from it, pads it with 6 random bytes before and 6 after, XORS it and sends it back, N-API confirms it by doing the same to the token (using a CRC32 lookup array table)
  69.  
  70. C++ app handles socket connection if console
  71. C++ gets one time only watch list results if the handshake passes and sends it back to node. Wii blocks and waits for an instruction after sending the one time data
  72. Angular GUI confirms the rom version and everything is correct. If not send close connection command. C++ destroys socket, closes process handle. Wii waits again.
  73.  
  74. If correct send start watching command to c++. C++ enters loop polling the process reader or blocks waiting for a socket answer. Catch socket errors and timeouts. Emit received watch list data in a Standard Format to node via Event which sends it back to the GUI. Also emit process handle and socket sudden errors/destructions, which forces a re-connect attempt.
  75.  
  76. Socket in c++ sends a request in each loop cycle. Request can be of type 1 (watch list get) or 2 (write data and get watch list). Wii answers with the watch data in mode 1 or 2 (at the end). In mode 2 first read the data length, addresses to write and values then execute it. C++ has a write queue where it only pushes one write per cycle. If something is in the queue use mode 2. Node pushes onto the queue async, but only if the user is safe for item gets and no item is queued still. If no answer comes in x ms retry. After 3 no answers terminate connection. Ensure resets and home menu are accounted for. Then try to re-connect.
  77.  
  78. Support bizhawk various versions (always mupen64-plus)
  79. Support dolphin globally via socket (android too??). Allow user to specify a remote address for Dolphin as well as console. Implement auto which searches for the ip and open port or the Wii/wiiu network device. Try localhost first. Maybe can draw IP to screen too.
  80. Support retroarch mupen64-plus and parallel (not mupen64-plus-next). Mupen64-plus needs to be downloaded manually. Look into Retro's build in UDP API
  81.  
  82. TWW:
  83. 0x80000000 - 0x817fffff
  84. 0x80003100 - 0x803F03FF (code and data)
  85. 0x81200000 - 0xXX (loader and other OS stuff, can not put text sections here)
  86.  
  87. OSInit:
  88. 804024a0 Lo
  89. 804004a0 Lo
  90. 817f25c0 Hi
  91.  
  92. Init Arena:
  93. 817f25c0 Lo
  94. 817f25c0 Hi
  95.  
  96.  
  97.  
  98. MEM1:
  99. 0x80000000-0x817FFFFF 24 MB
  100.  
  101. WiiVC:
  102. 0x80000000-0x80004000 (reserved for system use)
  103. 0x80004000-0x8025F0B7 (code and data)
  104. 0x81330000 (area used for loader data)
  105. 0x81370500 (WiiVC loader data roughly ends)
  106.  
  107. OSInit:
  108. 0x802710c0 OSSetMEM1ArenaLo
  109. 0x8179d500 OSSetMEM1ArenaHi (400 KB left over until 817FFFFF!)
  110. 0x90000800 OSSetMEM2ArenaLo
  111. 0x93ae0000 OSSetMEM2ArenaHi (5 MB left over until end!)
  112.  
  113. Init Arena:
  114. 0x8179d500 OSSetMEM1ArenaLo
  115. 0x93ae0000 OSSetMEM2ArenaLo
  116.  
  117. Arena needs to be 32 bytes aligned
  118.  
  119. MEM2:
  120. 0x90000000-0x93FFFFFF 64 MB
  121.  
  122. WiiVC:
  123. 0x90000000-xxx (reserved for IOS)
  124.  
  125.  
  126. VC:
  127. -Send twitch token to wiivc
  128. -Wiivc uses numbers only (no strings!)
  129. -connect to ip of zsr netcup big
  130. -send twitch token for validation
  131. -only then grant access
  132.  
  133. https://pokeacer.xyz/wii/pdf/OS.pdf
  134. https://pokeacer.xyz/wii/pdf/RVL-HardwareTransitionGuide.pdf
  135.  
  136. Bonus:
  137. -Allow users to open an associated seed page with a MW match/race in a new electron window (with ads enabled)
  138.  
  139. ADS:
  140. -Test with: https://percentagecalculator.net/
  141. -Delivered via window.open(url) = open new electron window with same size as the prior one if no preference is set
  142. -Delivered via href _blank (new tab or window) or _self (same page)
  143. -Electron app should have normal Windows title bar, below the NodeCG tab system which is hidden if there is only one tab (also no manual new tab option, just a closing option if not the first tab) and below that a small toolbar with back, forward, reload and home
  144. -Deliver Angular app via SSR (no shadow root)
  145. -If the website URL is accessed directly, display just the active match list and a click opens the desktop app via a browser file opening link (or prompt the app download)
  146. -Make electron app fake a Chrome user agent string
  147.  
  148.  
  149. General:
  150. -Memory reader from emu/serial interface is a C++ node-gyp pre-compiled module (Windows, macOS, Linux) and then bundled with the electron packaged release for that OS
  151. -Packaged electron has an utils folder where maybe the lua script is stored electron can run with a lua parser (and handle the socket functions appropriately)
  152. -Main Repo contains electron source, package.json and utils folder so TR and co. can commit to it (node module C source isnt exposed - only dist available, maybe via NPM site, can perhaps install OS dependent package with a post setup npm script)
  153. -Make a dist github release with exe for Windows/Linux/macOS on each change
  154. -Electron immediately connects and opens the GUI from a remote route on ootr.com (online only). We store only the compiled prod Angular GUI build there. Have a server script which compiles it from source and puts the dist into the public folder
  155. -Remote GUI talks to client via electron API and to our server via express or socket IO API
  156. -Angular source gets current OS day-of-month via new Date() on init and sends it to the server (which init route only accepts connections from ip addresses that connected to the angular gui route 0-30 seconds ago, otherwise send invalid data error code. Could also inject the key into Angular via server side rendering. Server encrypts the date with a private key and returns it, Angular sends it via post to electron to pass as "fastInit: bool = true" to the C++ node_module with no further comment or naming that clues one in. Node module triggers fail if type is actually bool. If not then decrypt message with public key and check whether the current os day-of-month matches the decrypted day (+ 1 allowed due day change). On fail enter "special" mode where it will still work but return spotty data from the emu randomly on reads and manipulate the write addresses to cause crashes
  157. -Electron ideally runs the lua script for MW and implements Bizhawks functions (like read/write RAM) while replacing the socket code with calls to our server instead (which now does the hosting)
  158. -Electron implements generic RAM write/read and the server sends all the addresses to manipulate (for CC), so they arent all exposed/stored in the app
  159.  
  160.  
  161. Fingerprinting:
  162. -For each platform query and set the current up-to-date Chrome user agent string
  163. -Valid Chrome user agents here: https://developers.whatismybrowser.com/useragents/explore/software_name/chrome/
  164. -Verify user agent on socket.io server upon connection as added protection
  165. -Ensure all generic fingerprinting methods are within reasonable range for Chrome:
  166. https://amiunique.org/fp
  167. https://panopticlick.eff.org
  168. -Ensure Cookie Consent screen works on EU electron app. Don't include AdSense ad code on angular app, only analytics tag
  169.  
  170. Auth:
  171. -If a twitch auth token and refresh token fails that is needed to perform remote control actions, kick user back to auth screen asap
  172. -Have separate node script that connects to the firebase project and flags the user with his UID in the firestore entry to mod or admin = true manually. If true socket io sends mod = true back during auth which alters the GUI to include mod actions such as banning users. socket io flags this socket as mod enabled which allows these actions to go through, e.g. disabling user accounts aka banning them
  173. -Use broadcaster_type; can be used to ensure that the user can start a remote control session, e.g. only allowed if affiliate or partner
  174.  
  175. Disconnects:
  176. -Game saves a full item history in save RAM. Static size per entry. Outgoing address just specifies the ID in the table. Can do ID * entrySize to find ptr to the table entry
  177. -table entry has a server acknowledgement byte the handler flags to 1 once the server confirms it received the item
  178. -Periodically check the entire table for 0 flags (if item could not be delivered) and try to re-send them
  179. -Ensure the PC client shows if the console got disconnected, so the user can fix it
  180. -Ensure server only accepts each item once
  181. -Incoming table is separate from outgoing table
  182. -Incoming address makes the game rando code write to the incoming table
  183. -Periodically the server sends the correct incoming table for this player and the client verifies it against the stored table, if any items are missing, deliver them in sequence
  184. -Game ensures it doesn't add any items to either outgoing or incoming table that are already there and have been received properly
Add Comment
Please, Sign In to add comment