• There is NO official Otland's Discord server and NO official Otland's server list. The Otland's Staff does not manage any Discord server or server list. Moderators or administrator of any Discord server or server lists have NO connection to the Otland's Staff. Do not get scammed!

Compiling How to compile OT Client and Server on Docker and WSL 2

randal923

New Member
Joined
Sep 4, 2009
Messages
19
Reaction score
0
Hey guys, I have been trying to compile TFS for a long time now with no success.

I first tried to compile the optimized_forgottenserver with the regular visual studio way but I ran into a ton of issues. I fixed almost all them but there was one I couldn't fix: cannot open input 'mpir.lib'. I downloaded this lib but I don't know how to compile it.

Then I tried to compile the regular tfs server, for this one I actually went with docker because the visual studio way was giving me a lua.hpp issue and I was tired of trying to fix the local environment. I was able to build the Docker image but when I run it, it says it couldn't connect to MySQL server. I would like the database to also be included in the image, how would I go about that?

Also, I am using WSL 2 and building the image in the ubuntu side of things. I believe my client would be able to access the port opened by the image without an issue? Since it's localhost.
 
OP
OP
R

randal923

New Member
Joined
Sep 4, 2009
Messages
19
Reaction score
0
I was able to write a docker-compose file based on the example on Github.

Code:
version: "3.8"
services:
  server:
    build:
      context: ./server
    restart: always
    container_name: server
    ports:
      - "7171:7171"
      - "7172:7172"
    depends_on:
      - db
    networks:
      - db-network
  db:
    image: mysql
    restart: always
    container_name: db
    cap_add:
      - SYS_NICE
    environment:
      MYSQL_ROOT_PASSWORD: password
      MYSQL_USER: forgottenserver
      MYSQL_PASSWORD: password
      # Automatically creates a database
      MYSQL_DATABASE: forgottenserver
    volumes:
      # Saves all the data in ./db directory
      - ./server/db:/var/lib/mysql
      # Automatically executes schema.sql on startup
      - ./server/schema.sql:/docker-entrypoint-initdb.d/schema.sql
    networks:
      - db-network
  db-adminer:
    image: adminer
    container_name: db_adm
    restart: always
    ports:
      - 8080:8080
    networks:
      - db-network
networks:
  db-network:

Now I am trying to build the OTclient but I am not sure how to write the dock-compose for it. I am getting this error: xhost: unable to open display "" when building the Dockerfile.

I will post more updates as I figure these out. Any help would be awesome.
 
OP
OP
R

randal923

New Member
Joined
Sep 4, 2009
Messages
19
Reaction score
0
I am hard stuck on this. " xhost +" returns
Code:
xhost:  unable to open display ""

If I try to just run docker I get this

Code:
docker: Error response from daemon: error gathering device information while adding custom device "/dev/dri": no such file or directory.

Any help?
 
Top