q-wiki / q-wiki-server

Q-Wiki is a Wikidata based game (Unity front-end with ASP.NET Core back-end) developed by HTW Berlin students in cooperation with Wikimedia Germany.
GNU General Public License v3.0
2 stars 0 forks source link

Add parameters to POST /games to allow playing with the map parameters #28

Closed rrrnld closed 5 years ago

rrrnld commented 5 years ago

So I added query parameters to the POST /games endpoint and adjusted the models a bit. I tested game creation with and without custom parameters and I also checked whether the map is serialized correctly.

I don't know if we need to regenerate the swagger SDK because I don't know if adding query parameters changes the interface.

rrrnld commented 5 years ago

I'm also unsure about migrations; whenever I run dotnet migrate it tells me this:

$ dotnet migrate
No project.json file found in '/home/arne/dev/htw-wikidata-game'.
Migration failed.

I tried it in all the relevant sub folders as well and still got the same message.

maltegoetz commented 5 years ago

I'm also unsure about migrations; whenever I run dotnet migrate it tells me this:

$ dotnet migrate
No project.json file found in '/home/arne/dev/htw-wikidata-game'.
Migration failed.

I tried it in all the relevant sub folders as well and still got the same message.

dotnet migrate Migrates projects between different .NET versions from my understanding. dotnet ef migrations add {MigrationName} is probably what you are looking for. As migrations do not work well when working simultaneously eg. via git, it would be awesome if you could pull the most recent develop before creating the migration now.

maltegoetz commented 5 years ago

And yes, you are absolutely right about the api client, we need to trigger the auto generation for that. Let me know if you want to do that yourself, otherwise I can do that as well.

rrrnld commented 5 years ago

Hm, what about compatibility? Can the frontend team still use their old version and just miss out on the new features? Would be nice if we gave them a heads up before merging this if that's not the case.

maltegoetz commented 5 years ago

If you add defaults/make the parameters optional we should preserve downwards compatibility: CreateNewGame(int mapWidth = GameConstants.DefaultMapWidth, int mapHeight = GameConstants.DefaultMapHeight, int accessibleTilesCount = GameConstants.DefaultAccessibleTilesCount)

rrrnld commented 5 years ago

Nice, looks and reads much better like this as well

maltegoetz commented 5 years ago

Awesome! Just let me know if you want to generate the api client, otherwise I would add that before merging.

rrrnld commented 5 years ago

The command fails unfortunately. I'd suggest you generate it for now and we have a look at that on Tuesday.

maltegoetz commented 5 years ago

I just pushed the auto generated api client, if you wanna check that out... You can merge the branches if you like :)

rrrnld commented 5 years ago

🕺