Hucaru / Valhalla

A Golang MapleStory (v28) server
MIT License
275 stars 71 forks source link

Unable to get running - db out of sync? #6

Closed zees-dev closed 4 years ago

zees-dev commented 4 years ago

Cant seem to get past character selection screen - takes me back to login screen.

It seems like the DB SQL is out of sync from the codebase (channelID does not exist in DB SQL - while code assumes its existence). Additionally the code references "miniGameWins, miniGameDraw, miniGameLoss" columns of the characters db table - these do not exist either.

Hucaru commented 4 years ago

Thanks for letting me know, I will update the database sql. Have you made sure to the ip addresses and ports are configured correctly in the config_* toml files? Specifically the ClientConnectionAddress property.

Hucaru commented 4 years ago

I have updated the sql. See if that makes a difference.

Commit: https://github.com/Hucaru/Valhalla/commit/66f897c39817f8f6b4cfd8d23c00bdc3b46cf286

zees-dev commented 4 years ago

Ok DB is now is sync; so i don't need to manually patch it now, thanks :)

However i am unable to get past character selection screen. Creating character works; but fail to select character and get into channel - get taken back to login screen.

Additionally no errors are thrown on the backend either.

Notes:

Hucaru commented 4 years ago

Are the servers running on the same machine as each other and is the game client also running on the same machine? Can you also paste your configuration file settings? I have tested this on multiple machines/OS and works fine.

zees-dev commented 4 years ago

config_login.toml

[database]
address = "127.0.0.1"
port = "3306"
user = "root"
password = "password"
database = "maplestory"

[login]
clientListenAddress = "0.0.0.0"
clientListenPort = "8484"
serverListenAddress = "0.0.0.0"
serverListenPort = "8485"
packetQueueSize = 512

config_world.toml

[database]
address = "127.0.0.1"
port = "3306"
user = "root"
password = "password"
database = "maplestory"

[world]
message = "message"
ribbon = 2
loginAddress = "127.0.0.1"
loginPort = "8485"
listenAddress = "0.0.0.0"
listenPort = "8584"
packetQueueSize = 512

config_channel_1.toml

[database]
address = "127.0.0.1"
port = "3306"
user = "root"
password = "password"
database = "maplestory"

[channel]
worldAddress = "127.0.0.1"
worldPort = "8584"
listenAddress = "0.0.0.0"
listenPort = "8685"
ClientConnectionAddress = "127.0.0.1"
packetQueueSize = 512
MaxPop = 250

database (docker-compose.yml used for this): docker-compose.yml

version: '3.1'

services:
    db:
        image: mysql:5.7
        restart: unless-stopped
        volumes:
            - db-data:/var/lib/mysql
            - ./sql:/docker-entrypoint-initdb.d
        environment:
            MYSQL_ROOT_PASSWORD: password
            MYSQL_DATABASE: maplestory
            MYSQL_USER: root
        ports:
            - 3306:3306

    adminer:
        image: adminer
        restart: unless-stopped
        environment:
            ADMINER_DEFAULT_DB_DRIVER: mysql
            ADMINER_DEFAULT_DB_HOST: db
            ADMINER_DEFAULT_DB_NAME: maplestory
            ADMINER_DESIGN: nette
        ports:
            - 8080:8080
        depends_on:
            - db

volumes:
    db-data:

How i run the solution (On Mac):

  1. Spin up database docker-compose up
  2. Start login server -> ./Valhalla -type login -config ./config_login.toml
  3. Start world server -> ./Valhalla -type world -config ./config_world.toml
  4. Start channel server -> ./Valhalla -type channel -config ./config_channel_1.toml
  5. Start up Maplestory on Windows (Parallels Desktop) - on the same machine
    • i've modified the maple v28 client to point to my Mac Host IP address (this has allowed me to log in)

Note: The Data.nx file was converted from the clean v28 Data.wz file (obtained from v28 setup) - via NoLifeNx

Please do let me know if something is out of the ordinary or whether you see any issues with the current setup :)

zees-dev commented 4 years ago

Ok issue resolved.

The problem was in my config_channel_1.toml The value for the ClientConnectionAddress needed to be set the the static IP of my Mac (host machine)

Note: hostname does not work for the value - it needs to be static IP

Hucaru commented 4 years ago

In order for the hostname to work there would need to be some kind of resolver in place DNS or otherwise.