Jump to content

Elfo

Legendary Member
  • Posts

    2,009
  • Credits

  • Joined

  • Last visited

  • Days Won

    53
  • Feedback

    0%

Everything posted by Elfo

  1. How does it work and how to contribute First and foremost let me make something clear. This is a project under GPLv2. ANY changes or modifications you make to the software need to be made public under the same license for everyone to see. The main reason i made this opensource is so people can jump in and help out in exchange of using it for free. An example would be the follow: If you adapt the code for l2j high five, you MUST by law make it public. Any violations will be reported and offenders will need to deal with the legal issues. Now that i have that out of the way let me talk you through the workflow. This is what a full request from the user looks like The user does an action on the site. The request is send to the website and it is being validated for authenticity. If it is valid then the website is sending an encrypted request to the server api. The server api is validating the request and does the action. It then replies to the website and the site outputs the action result to the user. Website side The requests are in the Requests folder in the web project. Every request extends the L2Request abstract class. Here is what this class looks like: See here that the requests have an API key (which you will need to change) and a request id. The request id is used by the server api to figure out how it should process the request. Any extra properties should be added to the extended class. In order to create a new request you need to extend L2Request and give it a request id. Here is an example. As you can see the buy item request has some properies as well as a request id which can be seen in the base(9). This is all you need to do to create a website request for the server. Now if this request needs to return something more that a confirmation message (ie some data) then you also have to create a response class that extends L2Response. BuyItemRequest doesn't need a special response so it just answers with a L2Response. This is what the response model looks like: I only have two response codes for now. 200 for status ok and 500 for any error (planning to extend that) When the request is send from the website to the server it is being serialized to a json string and encrypted with AES256. Because the encryption is symmetric it is very important that you change any encryption keys provided by default. In order to send the request to the server you need to create a method signature in the IRequestService interface. It must look like this: All requests MUST return Task<L2Reponse> in the interface signature. If it needs to return something that extends response then we cast it. Here you can see the implementation of the request functionality: Requests have an extension method named SendPostRequest<T>. T is generic and is replaced by extended responses if needed. The extension method will serialize he model send the request and return the gameserver response object. Notice here that the method need to be async as we will await it. Async programming offers better performance in C# if done right. Here is how the buy item endpoint looks like on the site. Some key things: The HttpPost attribute shows that this endpoint accepts post requests. The Route attribute shows the url path of the request. async Task allows for asynchronous handling of the request. [FromBody] means that the framework will map the Form Body to a model automatically. return Content returns a string. However i am currently replacing them with return Json to return an object for flexible responses. The rest is pretty straightforward. This is how the jquery code looks like for this request: Server API side The server is accepting requests from the site. The requests are registered in the L2ACPRequests enum on the com.elfocrash.l2acp package. Here it is: They are being turned into an array and using the request id we map them and kick off the processing process. All the requests in the server api extend L2ACPRequests (name inconsistency i know) Overriding the setContent method allows for getting values from the json object. Here is how: Note here that if it is a string, a int or a whatever you need to get it accordingly. Also note here that you NEED to have the same pascal case then you do get.("Something") as the model was serialized on the website. Responses extend the L2ACPResponse model class. You only need to extend it and now send it as it is if you need to return data other than a success message. Here is what an extended response looks like: Note the property naming. They MUST be pascal case as they will be mapped to a website model dynamically and C# is using pascal case. This is the main idea around how L2ACP works. If you have any more questions please let me know. Keep in mind i was prototyping a lot making this so many things are not final but the workflow is. Star and fork the projects on GitHub. https://github.com/Elfocrash/L2ACP-Web https://github.com/Elfocrash/L2ACP-api Thanks.
  2. There is none as this wasn't designed to be shared. You have to fork the projects open them on the IDE you use and modify-build them. I will however add configurations for both projects today. (Too busy yesterday.) Guys, if you like it, don't forget to give it a Star on Github. It really means a lot. Web project Server API Project
  3. Jesus mate, none of my business. Go to freelancer.com and find someone to do it for you.
  4. I'd rather have people to engage with Github and not mxc or maybe make a little forum for this. I will post a full guide over the weekend on how the system works and how to contribute and get it running.
  5. The project is opensource. Everyone is free to fork it and contribute to it. I accept pull requests so everyone is welcome.
  6. Even for free i highly doubt people would use it, because of the data protection concerns. I'm totally ok with anyone using it. I will actually provide even more details if needed.
  7. I made it as a prototype because it was a cool idea. I knew people wouldn't spend on it because of the model so i chose to make it opensource. I also don't need the money. An extra reason is that i see many people selling similar stuff but way way more expensive. Now people have a free choice. At the end of the day, developers wanna see that their software is being used.
  8. Added instructions at the readme files of the projects.
  9. You will need to adapt the API and remove the item and npc id range limitation from the webproject, but it shouldn't be hard,
  10. I will be updating the projects' Readme.rd very soon. Any installation instructions will go there. If you still have issues after that i will provide a skype.
  11. Hello and welcome to L2ACP L2ACP is both an Account control panel but also an Admin control panel. Every action in the system is INSTANT. No more "you have to logout first" messages and such non-sense. How does it work? The gameserver will now also run a lightweight restful API which will handle the site requests. The website which is hosted on my end handles and processes the user's actions and if they are valid it sends them to the server for further processing. This enables use of the native l2j method calls and the use of the existing infrastructure. This also enhances security as there are no database exposure anymore. Reasons for sharing To get a solid acp out there which is free for everyone To see if people are interested in contributing Nobody would buy this if i just hosted it myself To show the competition that opensource projects can offer value Feature list For Players Register l2 account Change ingame password Check player stats/info/inventory Buy ingame items with donate points Buy services with donate points (Change name, set nobless, reset pks, change sex) Statistics (Top PVP, Top Pk, Top Online) Donate with Paypal for Donate points For Admins Set the items sold in the store Give items to players Punish players (acc ban, char ban, jail, chat ban, kick) Announce test Live map of the players The ability to spawn monsters anywhere in the map The ACP is in active development and way more features are coming. The site is fully responsive giving the user a great tablet or mobile experience. L2ACP Preview Lucky Wheel addition Private stores Server with private stores showcase a server set up with a great economy system However it can be really hectic when a server is populated. Players tend to look forever to find the item whey want. Well the new L2ACP feature solves all that. The user is able to buy and sell items from the ACP no matter if he is online or not. You can also use the search functionality to search for the item that you want. Here is a video preview: Security L2ACP uses symmetric encryption for the payloads and an api key validation. As long as they are changed you will have no problem with security. If you want to be 100% secure, make the server accept requests only from the ip that the site is hosted. If you want to be 101% secure, then host them together and don't expose the api port. License Both L2ACP projects are licensed under GPLv2. Here is a tldr of what that means. Github repositories - (Please star the projects if you like them, it means a lot) Gameserver Api written for aCis - https://github.com/Elfocrash/L2ACP-api Website - https://github.com/Elfocrash/L2ACP-Web Test erver - http://test.l2acp.com Contributions I don't claim to be an expert java developer, not even close. The api side of things has definitely many things to be improved. Pull requests are always welcome. I will update this with more info soon. Thanks Guides How to build L2ACP API: Already published 1677ad687d5ad5f6eb7ef421213d5276cf5f18e1 version: http://www.mediafire.com/file/gahbhk5o7b84hzd/L2ACPPublished.rar How to host .NET Core project on IIS: https://docs.microsoft.com/en-us/aspnet/core/publishing/iis How to host .NET Core project on Linux with Nginix: https://docs.microsoft.com/en-us/aspnet/core/publishing/linuxproduction How to host .NET Core project on Linux with Apache: https://docs.microsoft.com/en-us/aspnet/core/publishing/apache-proxy
  12. Thank you. It's almost weekend again so there will be more updates coming. Features that will be added over the weekend: Change clan name Change ally name Clear karma Buy clan skills (probably) Card flip minigame where players will be able to pay in order to pick a card out of three. Rewards are configurable with pecentagesPreview: Disclaimer: This feature is an idea from hypixel.net
  13. UPDATE - NEW FEATURE Private stores Server with private stores showcase a server set up with a great economy system However it can be really hectic when a server is populated. Players tend to look forever to find the item whey want. Well the new L2ACP feature solves all that. The user is able to buy and sell items from the ACP no matter if he is online or not. You can also use the search functionality to search for the item that you want. Here is a video preview: Thanks
  14. UPDATE Added Live Raid Boss Map. Players can track location, movement and current HP of the raid bosses. Latest codebase is deployed on http://test.l2acp.com If you need admin access just ask. Thanks
×
×
  • Create New...