HerculesWS / Hercules

Hercules is a collaborative software development project revolving around the creation of a robust massively multiplayer online role playing game (MMORPG) server package. Written in C, the program is very versatile and provides NPCs, warps and modifications. The project is jointly managed by a group of volunteers located around the world as well as a tremendous community providing QA and support. Hercules is a continuation of the original Athena project.
http://herc.ws
GNU General Public License v3.0
903 stars 757 forks source link

Issue with API server and autotraders on restart #3306

Closed guilherme-gm closed 2 months ago

guilherme-gm commented 3 months ago

Creating an issue for tracking this message from Dastgir in #3304; I will look into it

 Probably unrelated to this PR, but there's one more issue wherein API server is called for autotraders on restart, and we get bunch of Account not online errors

Originally posted by @dastgirp in https://github.com/HerculesWS/Hercules/issues/3304#issuecomment-2199869256

Describe the bug If you have persistent autotraders and do have one or more autotraders during server startup, you get an error for each one:

[Error]: Cant set char online. Account not logged in: 2000003

To Reproduce Steps to reproduce the behavior:

  1. Setup a vending
  2. @autotrade
  3. Shutdown your server ( ./athena-start stop )
  4. Start the server again ( ./athena-start start )
  5. See error in console

Expected behavior Autotraders should not cause errors during startup.

Screenshots

System specs (please complete the following information):

Plugins used or source modifications None

Additional context From what I can tell so far, this comes from the fact that during autotrader loading (which happens in map-server), it will send to char which will then send to login, finally sending the list to API server which won't recognize it.

I believe we should either:

  1. Not send to API
  2. Create accounts in API if they are coming from autotrade