Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add http support to hercules (api-server) #3198

Merged
merged 301 commits into from Apr 13, 2023
Merged

Conversation

4144
Copy link
Contributor

@4144 4144 commented Apr 11, 2023

Pull Request Prelude

  • I have followed [proper Hercules code styling][code].
  • I have read and understood the [contribution guidelines][cont] before making this PR.
  • I am aware that this PR may be closed if the above-mentioned criteria are not fulfilled.

Changes Proposed

Add new server with name api-server for http requests from clients or other tools.

api-server listen by default on port 7121.
Visual studio projects can be incomplete.

for now supported this http features:

  • guild emblems
  • hotkeys
  • emotes
  • adventurer agency (without search)

More information see in https://board.herc.ws/topic/20151-http-support-in-hercules-funding/

4144 added 26 commits March 13, 2023 16:46
Also add constant for char server name size.
This allow call for some time api functions after player disconnected
from game.
Also add support for async data handlers for reply from char server.
Add api interface in char server.
This flag set if http request already parsed but not disconnected.
Also add macro GET_DATA for get data pointer in api data handlers.
@4144 4144 requested a review from MishimaHaruna April 11, 2023 13:58
4144 and others added 21 commits April 12, 2023 02:54
official clients sends this header and not handling it properly
causes the client to hold the payload for some time, making
the entire request take longer.

Signed-off-by: Guilherme G. Menaldo <guilherme.menaldo@outlook.com>
Signed-off-by: Guilherme G. Menaldo <guilherme.menaldo@outlook.com>
Signed-off-by: Guilherme G. Menaldo <guilherme.menaldo@outlook.com>
Signed-off-by: Guilherme G. Menaldo <guilherme.menaldo@outlook.com>
Providing an error code allows client some feedback to the user when the
emblem gets rejected or something goes wrong in the middle of the
process.

Signed-off-by: Guilherme G. Menaldo <guilherme.menaldo@outlook.com>
Not having data and a server error were both being handled as no data,
which would lead a query error to overwrite user configs with defaults.

We now send a proper error when it fails to load due to an application
error. This makes official clients inform user about the issue and not
override their configs.

Signed-off-by: Guilherme G. Menaldo <guilherme.menaldo@outlook.com>
providing a error status prevents clients from overriding their data
with bad one, and also show a proper error message to the user.

Signed-off-by: Guilherme G. Menaldo <guilherme.menaldo@outlook.com>
Signed-off-by: Haru <haru@dotalux.com>
Signed-off-by: Haru <haru@dotalux.com>
@MishimaHaruna MishimaHaruna added this to the Release v2023.04.12 milestone Apr 12, 2023
Note: This was done without the VS IDE and comes with no guarantee that
it'll work.

My personal thought is that these files shouldn't be in the repository
at all since the way they are is just unmaintainable unless one has
several versions of VS installed and the patience to replicate each
change to the project file in all the version. VS (and Xcode) project
files shouldn't be part of the repository at all and should be replaced
with definitions for a generator tool (i.e. CMake) that can generate
projects for different IDEs that people might want to use.

Signed-off-by: Haru <haru@dotalux.com>
@MishimaHaruna MishimaHaruna merged commit 360ff92 into HerculesWS:master Apr 13, 2023
3 of 254 checks passed
@4144 4144 deleted the apiserver branch April 13, 2023 20:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants