View Single Post
DJEarthQuake
Veteran Member
Join Date: Jan 2014
Location: Astral planes
Old 01-17-2021 , 10:00   Re: City Temperature on join | Updated 10/04/2020
Reply With Quote #37

Gave plugin a queue. It cuts down on socket turbulence. Socket is set to busy with a boolean and the queue runs every so often to assure all the players' temps have been read and not duplicated. The socket function independently makes itself busy when being used and later reschedules other calls for temp readings on other players if pinged when in use. If in debugging mode, the sockets are a lot more descriptive in console with what player is using the socket and what point through the process are they.


new cvars
temp_long 0|1 is for acquiring temperature off longitude and latitude instead of city. Amxx182 cannot do that with GeoIP+ module so it is set to city by default.
temp_debug 0|1 Debugging is at the convenience of a CVAR instead of the nuisance of recompiling.

Old news but worth mentioning in case it is new to you.
  • Chinese translation
  • Speaks the temp (updated to handle sub zero)
  • Dynamically switches units Celsius or Fahrenheit on a per player basis as they connect instead of CVAR.


Developer footnote.
Next version. Stream-lining player by steamID like this. Instead of PLAYER_INDEX+CONSTANT_INTEGER. Minimizes data meshing. Sometimes Amxx never closes the socket right and the netstat will show CLOSE_WAIT indefinitely until process is killed not restarted. kILLeD!

Spoiler
__________________

Last edited by DJEarthQuake; 01-17-2021 at 10:11.
DJEarthQuake is offline