GithubHelp home page GithubHelp logo

wiilink24 / wfc-server Goto Github PK

View Code? Open in Web Editor NEW
64.0 6.0 13.0 898 KB

WiiLink Wi-Fi Connection aims to be an open source server replacement for Nintendo Wi-Fi Connection.

License: GNU Affero General Public License v3.0

Go 100.00%

wfc-server's Introduction

wwfc

WiiLink Wi-Fi Connection aims to be an open source server replacement for Nintendo Wi-Fi Connection. Currently, a work in progress

Current Support

  • Matchmaking (No server sorting yet)
  • Adding Friends

Setup

You will need:

  • PostgreSQL
  1. Create a PostgreSQL database. Note the database name, username, and password.
  2. Use the schema.sql found in the root of this repo and import it into your PostgreSQL database.
  3. Copy config-example.xml to config.xml and insert all the correct data.
  4. Run go build. The resulting executable wwfc is the executable of the server.

wfc-server's People

Contributors

mkwcat avatar noahpistilli avatar mikeisastar avatar itsnicecraft avatar dependabot[bot] avatar vmfunc avatar maritoguionyo avatar umbreonisreal avatar

Stargazers

Ilir Lazoja avatar Skye avatar  avatar Mikhail Serebryakov avatar Jesse Keskelä avatar ppeb avatar Pancakes avatar ... avatar David Girón avatar Matheus Lopes avatar eros71 avatar Bad Wolf avatar Matthew Toro avatar Julia avatar FiSTWHO avatar Arves100 avatar  avatar Andre Morgan avatar Julius avatar Landon & Emma avatar  avatar archichaos (codexll) avatar Egor Kosaretskiy avatar Araeden avatar  avatar Michael Wagner avatar  avatar Kevin avatar Curtis Alexander avatar Benjamin Funke avatar Davide avatar Phoenix avatar Sam avatar Renge avatar Sissel avatar Joshua Peisach avatar Laura Kirsch avatar Seeky avatar Kat21 avatar Manuel Quarneti avatar JakobDev avatar Seb3thehacker avatar  avatar bb010g avatar Brendan (Drendos) avatar  avatar Simo avatar Michael avatar Raúl Negrón avatar Defit avatar  avatar  avatar  avatar Lilia  avatar  avatar Larson T. avatar bperris avatar Simone avatar  avatar thepikachugamer avatar nami1 avatar NecroNova avatar  avatar  avatar

Watchers

 avatar  avatar  avatar Landon & Emma avatar  avatar nami1 avatar

wfc-server's Issues

Only one friend receives final auth message

Applies to Mario Kart Wii
It seems when two players add each other, only the side that added the friend second seems to receive some kind of finalization, requiring the other player to log out and log back in to see the friend. This seems to specifically affect the game in that it won't attempt to search for the other player's friend info record in SAKE, but if the two players end up in a match together then it would work fine from there.
This could be a client side issue, but I'm not sure

GPCM: Optimize adding friends

Instead of sending messages back and forth, authadd could be ignored, with the server just sending both bm 2 and 4 to each client once the friends are mutual

Additional documentation for the server

Hello,

is it possible to add additonal infos for setting up the server?

  • I setup the postgres db
  • changed the config

i did the steps from the readme and the server is up and runnging

2024/07/18 11:45:30 N[FRONTEND]: Listening on myserverip:29998
2024/07/18 11:45:30 N[FRONTEND]: Listening on myserverip:29920 for gamestats
2024/07/18 11:45:30 N[FRONTEND]: Listening on myserverip:29901 for gpsp
2024/07/18 11:45:30 N[FRONTEND]: Listening on myserverip:28910 for serverbrowser
2024/07/18 11:45:30 I[FRONTEND]: Running from /home/blacky25/wiilink/wfc-server/wwfc
2024/07/18 11:45:30 N[FRONTEND]: Listening on myserverip:29900 for gpcm
2024/07/18 11:45:30 N[NAS]: Starting HTTP server on myserverip:80
2024/07/18 11:45:30 N[QR2]: Listening on myserverip:27900
2024/07/18 11:45:30 N[NATNEG]: Listening on myserverip:27901
2024/07/18 11:45:30 N[BACKEND]: Listening on myserverip:29999
2024/07/18 11:45:30 N[FRONTEND]: Connected to backend

Which additional steps do i need to do on dolphin to tell the game to connect to the server? I already tried a few different things without any success. I created a support thread on the discord already but i think not many people are hosting their own instance.

I would be more than lucky to run my own server and hope you can give me tips :)

Importing DB doesnt work on PSQL

Here's the logs:
postgres@randomyaps:~$ psql -U postgres wfc < /home/random/wfc-server/schema.sql
SET
SET
SET
SET
SET
set_config

(1 row)

SET
SET
SET
SET
SET
SET
CREATE TABLE
ERROR: syntax error at or near "ALTER"
LINE 11: ALTER TABLE public.users OWNER TO wiilink;
^
CREATE SEQUENCE
ALTER TABLE
ERROR: sequence must have same owner as table it is linked to
ALTER TABLE
ERROR: relation "users_profile_id_seq" does not exist
ALTER TABLE

I still dont know.

Add console ban system

Console bans should be done with the device ID (aka NG ID), which cannot be spoofed due to the signature in the wwfc_sig field

NATNEG: Delete old sessions

Currently no sessions are ever deleted at all, which is obviously not good on memory. The solution is probably as simple as a thread that loops and deletes sessions that haven't been touched in like 3 minutes

ServerBrowser: Implement LIKE operator

From Pro Evolution Soccer 2013:
dwc_mver = 90 and dwc_pid != 73 and maxplayers = 1 and numplayers < 1 and dwc_mtype = 0 and dwc_suspend = 0 and (dwc_hoststate = 0 or dwc_hoststate = 2) and (mc4='w13usr' AND al=88 AND ar=90 AND tv=88 AND (cnt LIKE'_F_FS' AND fltr LIKE'U___S'))

QR2: Allow switching group match type

Not sure if any games do this, but CTGP has a feature to start worldwide rooms from friend rooms, but our group system will still insist it's a private room. The host's dwc_mtype field can be checked regularly to address this

Gamestats server

Need to look into how this works. Fortune Street tries to connect to gamestats.gs.nintendowifi.net:29920

Panic in database UpdateProfile if firstname or lastname does not exist

This error occurs in NiGHTS: Journey of Dreams (testing R7EPD00)

2023/11/29 03:29:12 N[GPCM:257/0343-5973-8625]: Command: updatepro
panic: can't scan into dest[5]: cannot scan null into *string

goroutine 40 [running]:
wwfc/database.UpdateProfile(0x12?, {0x8a00d0, 0xb265a0}, 0x101, 0x203a6d305b1b5d73?)
        /home/mkwcat/wwfc/wfc-server/database/user.go:57 +0x3ec
wwfc/gpcm.(*GameSpySession).updateProfile(...)
        /home/mkwcat/wwfc/wfc-server/gpcm/profile.go:64
wwfc/gpcm.(*GameSpySession).handleCommand(0xc000264200, {0x803356, 0x9}, {0xc0002b9310?, 0x2, 0x0?}, 0xc0000fbd18)
        /home/mkwcat/wwfc/wfc-server/gpcm/main.go:191 +0x37b
wwfc/gpcm.handleRequest({0x8a17b8?, 0xc00020a000})
        /home/mkwcat/wwfc/wfc-server/gpcm/main.go:167 +0x71f
created by wwfc/gpcm.StartServer in goroutine 7
        /home/mkwcat/wwfc/wfc-server/gpcm/main.go:72 +0x2e8

QR2: Allow sending messages to clients that haven't set dwc_pid

Based on the logs I believe the bug goes something like:

  1. Client A creates a QR2 session with publicip, publicport, etc. first without extra things like dwc_pid
  2. Client A searches and finds Client B via ServerBrowser, sends a message
  3. Client B attempts to reply to Client A's message via ServerBrowser, but is denied by QR2 due to Client A's dwc_pid not being set yet
  4. Eventually Client A sends a QR2 heartbeat and dwc_pid is set, allowing the connection to continue

Store and validate device ID in login

The device ID (also referred to as NG ID) is included in the wwfc_sig field. This should be stored on first login and checked to be the same on every subsequent login to prevent impersonation

ServerBrowser: Handle server list filters

Atm there is just regex matching and manually handling of the DWC filters (at least the ones observed in mario kart wii), but anything game-specific is just discarded.
Manual handling of mkw's request may be required if we want to bypass the game's limited VR search, which may prevent players from finding each other if we don't have many players online, and also we might want to forward regional/continental searching to worldwide to not further split the player count

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.