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
Code:
netstat -toadp |grep hlds_linux
See it closes on the 3rd party end just fine.
Quote:
Originally Posted by DJEarthQuake
I like how OpenWeatherMap.org has current wind condition.
$~telnet api.openweathermap.org 80
Trying 162.243.53.59...
Connected to api.openweathermap.org.
Escape character is '^]'.
[
Code:
GET /data/2.5/weather?id=4887398&units=imperial&APPID=register-for-a-openweathermap&u=c HTTP/1.0
...PRESS ENTER TWICE...
HTTP/1.1 200 OK
Server: openresty
Date: Sun, 02 Apr 2017 00:57:51 GMT
Content-Type: application/json; charset=utf-8
Content-Length: 438
Connection: close
X-Cache-Key: /data/2.5/weather?APPID=register-for-a-openweathermap=4887398&u=c&units=imperial
Access-Control-Allow-Origin: *
Access-Control-Allow-Credentials: true
Access-Control-Allow-Methods: GET, POST
{"coord":{"lon":-87.65,"lat":41.85},"weather":[{"id":800,"main":"Clear","description":"cl ear sky","icon":"01n"}],"base":"stations","main":{"temp":50,"pressur e":1022,"humidity":46,"temp_min":46.4,"temp_m ax":53.6},"visibility":16093,"wind":{"speed":6.93,"deg" :110},"clouds":{"all":1},"dt":1491093300,"sys":{" type":1,"id":1007,"message":0.1218,"country": "US","sunrise":1491132670,"sunset":1491178654 },"id":4887398,"name":"Chicago","cod":200}
Connection closed by foreign host.
|
__________________