AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   New Plugin Submissions (https://forums.alliedmods.net/forumdisplay.php?f=26)
-   -   City Temperature on join | Updated Nov 26th 2022 (https://forums.alliedmods.net/showthread.php?t=314896)

DJEarthQuake 11-02-2019 09:09

Re: City Temperature on join. | Updated ML (11/02/2019)
 
Remade a bunch of stuff. Most notably the plugin won't crash if it is installed without the databases or other files.

Napoleon_be 04-07-2020 12:21

Re: City Temperature on join. | Updated ML (Sat 04/04/2020)
 
Add measure units such as Farenheit or Celsius. 15° farenheit is pretty cold, as 15° Celcius is a whole lot warmer.

DJEarthQuake 04-09-2020 11:47

Re: City Temperature on join. | Updated ML (Sat 04/04/2020)
 
Quote:

Originally Posted by Napoleon_be (Post 2691494)
Add measure units such as Farenheit or Celsius. 15° farenheit is pretty cold, as 15° Celcius is a whole lot warmer.

Have you looked at the script? Both already exist.
Code:
92     g_cvar_units = register_cvar("sv_units", "imperial"); 254     get_pcvar_string(g_cvar_units, buf, charsmax(buf)); 255     if (containi(buf, "imperial") > -1 ) 256     { 257     iRED_TEMP = 70; 258     iBLU_TEMP = 45; 259     iGRN_HI = 69; 260     iGRN_LO = 46; 261     } 262     else if (containi(buf, "metric") > -1 ) 263     { 264     iRED_TEMP = 15; 265     iBLU_TEMP = -15; 266     iGRN_HI  = 14; 267     iGRN_LO = -14; 268     }

Napoleon_be 04-10-2020 04:50

Re: City Temperature on join. | Updated ML (Sat 04/04/2020)
 
Add it to your description or screenshot.

DJEarthQuake 04-10-2020 06:47

Re: City Temperature on join. | Updated ML (Sat 04/04/2020)
 
Taken care of. What else?

Napoleon_be 04-10-2020 06:50

Re: City Temperature on join. | Updated ML (Sat 04/04/2020)
 
Quote:

Originally Posted by DJEarthQuake (Post 2692146)
Taken care of. What else?

That was all :p

DJEarthQuake 01-17-2021 10:00

Re: City Temperature on join | Updated 10/04/2020
 
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

DJEarthQuake 06-23-2021 23:50

Re: City Temperature on join | Updated 06/20/2021
 
Found a socket related crash bug even with a queue locking down the socket so no other players can get their temp simultaneous. The timing needed advanced. Posting much needed update. Feel free to PM me.


All times are GMT -4. The time now is 23:55.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.