ioprecord.blogg.se

Factorio multiplayer
Factorio multiplayer









factorio multiplayer
  1. #Factorio multiplayer how to
  2. #Factorio multiplayer code

In my opinion, this has been quite the learning experience. The project itself is not finished yet it has some things that need to be polished, and other things that I want to add (not necessarily before launch, but nevertheless I can do so now), such as the forementioned improvements in testing however, I feel successful that I put the project together. For this reason, I am in the process of implementing tests with Jest on the backend and will be making the tests on the wrapper work even without an API to connect to by simulating the output of fetches according to what the backend should do. I haven't however done them properly, as it requires the backend to complete the tests - it can't be tested alone, so it makes it extremely difficult to run in CI, as it requires the backend to already have the changes that you are developing against on it's master branch, which is error-prone, as changes on the backend can be faulty and you even haven't ran your tests. For this reason, I have already implemented tests with mocha for the API wrapper. Testing is also a large part of the development for any app that is meant to scale at all.

factorio multiplayer

#Factorio multiplayer code

It was completely worth it though, as now, I am able to code faster and make less mistakes such as mis-spelling variable names and other types of errors that TypeScript is able to detect. This was less fun to do, as I was just moving old code to new, better to work with code.

factorio multiplayer

This made me love the language.Īfter experiencing what TypeScript was and how powerful it made code, I decided that it was time to migrate the backend to it too. It became extra useful when I started working on other bots that used the same backend, as they performed the same or similar fetches. It made the development experience of the Discord bot much easier, as everything was typed and I knew what was what. This was the first moment that I started to play with TypeScript, which was a bit painful to learn, but I eventually pushed through. So I created another project, fagc-api-wrapper. The bot was painful to develop, as I was using node-fetch at the time, remembering the routes and parameters, or finding them out from the backend's source code.Īfter realizing that it was terrible to work with at that time, I decided that it would be much more pleasant to use something like TypeORM, but for my backend. Whilst making the backend, I was also working on a Discord bot that would accompany it, fagc-discord-bot - it seems that I am not very good at naming things. There are some peculiar things such as adding transpiling the default MongoDB ObjectID to something much more readable, which was actually pretty smart (in my opinion), as I take the first few digits, which are random, and then the incrementing number, put them together, and get them from hex to a string (the code for this is here).

#Factorio multiplayer how to

It was a nice time, I was creating CRUD methods, learning about API key authentication (since I didn't know how to and didn't want to implement OAuth, such as from Discord). Since this was written with koa, sql and I had no experience with that, I decided that I would create my own backend with express and mongodb, since express had a low learning curve and I already knew how to use mongoose (a JS wrapper for mongodb) from AwF-Bot, which I worked on before. The project itself is meant to make this easier to deal with, as it creates a banlist that can be shared between any amount of servers and can be filtered through with specifications of broken rules and who you want to trust.Īt the start of my journey, I wanted to add extra content to an existing repo that did a similar thing, but lacked some features that I wanted. Since there is multiplayer, there will be griefers, like in other videogames. The project itself is made for the videogame Factorio, which is a game where you build factories with an end goal to launch a rocket into space. The experience that I have gained over this time was new, as I learnt how to use TypeScript, played a bit with Deno, and even made my own npm package! I have created and contributed to other things (notably AwF-Bot). In the past few months, I have worked on my currently favorite project, FAGC.











Factorio multiplayer