verdie-g / crpg Goto Github PK
View Code? Open in Web Editor NEWMultiplayer mod for Mount & Blade II: Bannerlord
Home Page: https://c-rpg.eu
License: GNU General Public License v3.0
Multiplayer mod for Mount & Blade II: Bannerlord
Home Page: https://c-rpg.eu
License: GNU General Public License v3.0
To have some observability on the servers:
Divide character experience by two to reset stats
Take simple player character skills filter out non-combat ones. Here is what I've seen:
ExperienceTable.cs uses an experience table taken from https://mountandblade.fandom.com/wiki/Experience. Replace it by the one used by the old cRPG.
https://github.com/verdie-g/cRPG/blob/1675b517d8db6f25273a785ad97806c3d78ff741/src/Domain/Entities/Ban.cs#L9
A ban is bound to an user id. The banned user could recreate their account to get unbanned for the price of loosing everything. It can still be annoying in case of spam bots.
At level 31, user could retire and:
https://github.com/verdie-g/cRPG/blob/fa262148df8528f35a48eeb3ca1480c29f806153/src/DumpItemsMod/DumpItemsSubModule.cs#L43-L46
For now shields and hand armors are filtered out before generating thumbnails because it makes the program crashes. Fix that.
Game servers will communicate with the API using a dedicated JWT. If the latter get stolen, the attacker can give gold and experience to anyone. To avoid that, a game JWT should contain a custom claim with the IP address of the server. On each request, this address should be checked.
Go straight to level 30 and earn 10,000 gold but block experience.
Add a new endpoint /users/self/character/:id/items/:id/repair to repair an item. Depends on #36
https://github.com/verdie-g/cRPG/blob/0638fa33a0bb694f8be95c23bd2cb6f8fba6c889/src/Web/Startup.cs#L59-L63
For now the API accepts cross-origin requests from any website. We might want to restrict that to cRPG UI instead.
When an user logs in on a server, the latter needs to make a call to the api to get or create the user with his character. First, we need to investigate if we can get the Steam ID of the connected user.
This new command update would handle:
and in the future maybe:
Split item entity in:
Use Owned Entity Types to do that with Entity Framework.
GET /items return all items. Add filters to the query:
Like the following but when a user deletes their account
https://github.com/verdie-g/cRPG/blob/2cecf045861843b48d69e5ed036d2937377713f9/src/Application/Games/Commands/UpsertGameUserCommand.cs#L138-L139
Retiring gives you a looming point but it cannot be spent
Actual Steam authentication returns to the client with a ?token=eyfaefaefafjwt in the query parameters. That means that anyone with a valid jwt can be someone else sign into his account by sending http://{client_url}?jwt=his_jwt. See aspnet-contrib/AspNet.Security.OpenId.Providers#50 for more info and how to fix it using openiddict.
For now, items are imported using the ItemObject.Deserialize method from MountAndBlade dlls. It's working well but it doesn't have the item icons. To generate them you need to call TableauCacheManager.BeginCreateItemTexture but it has a dependency on the engine. Add a "Dump Items" entry in the game main menu that would call both ItemObject.Deserialize and TableauCacheManager.BeginCreateItemTexture to write a file containing everything needed.
https://github.com/verdie-g/cRPG/blob/2cecf045861843b48d69e5ed036d2937377713f9/src/WebApi/Program.cs#L42
Here IsDevelopment is passed in the request but an ApplicationEnvironment service should exist that would contain an IHostEnvironment
.
List of item stats (damage, armor, ...) is used in Shop.vue but also several times in the select item modal in Characters.vue. It needs to be extracted in a component so it can be reused.
characters-service.ts contains big switch on ItemSlot. This need to be replaced by a dictionary ItemSlot -> ItemSlotInfo where ItemSlotInfo contains:
Items are taken from the game, the import script is in the Cli project. The lowest value is 69 (nice) but the highest one is 189399. Find a scaling factor so all values are right. After a quick look, it seems like only crafted items are extremely expensive so a different factor could be used for them.
User can access /characters when not signed in
To know if the user is signed in in a template we use this trick.
https://github.com/verdie-g/cRPG/blob/3ad65f9079ebb2b09d581281c57d6837eb87aca2/src/Web/Client/src/App.vue#L82-L84
But that will be true only once the user information was fetched. This is why the steam button can appear for a fraction of section on the home page.
This should be replaced with a boolean in the user module.
For each exception the message is directly sent to the client.
https://github.com/verdie-g/cRPG/blob/3ad65f9079ebb2b09d581281c57d6837eb87aca2/src/Web/Common/CustomExceptionHandlerMiddleware.cs#L27-L54
Instead, have a similar schema for all:
{
"title": "Invalid arguments",
"errors": {
"name": "blablabla",
"otherField": "blabla"
}
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.