[REL] rFactor2 Weather Tool

Discussion in 'Other' started by Gerald Jacobson, Mar 30, 2013.

  1. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Hello,
    1) If you take a developper key, as it is free, you can choose the Anvil Plan. No need for history add-on. For project and project website, put whatever you want.

    2) What do you means by section ? (if it is the number weather condition - 5 by default in rF2, yes you can set any needed number of sections)
     
  2. Steffen_M

    Steffen_M Registered

    Joined:
    Nov 11, 2011
    Messages:
    130
    Likes Received:
    3
    Thank you. You answered all my questions the way i need. :)
     
  3. dgreen2298

    dgreen2298 Registered

    Joined:
    Jun 24, 2014
    Messages:
    7
    Likes Received:
    0
    Guys can you still update the xml file ive got a few to add to it where is it stored if not here they are theres a zip too and they are in alphabetical order cheers

    WeatherConfig

    <Location name="Bahrain" inProfiles="1">
    <Providers>
    <Provider id="1">
    <Parameters>
    <Parameter name="Location" value="BAXX0083"/>
    </Parameters>
    </Provider>
    <Provider id="2">
    <Parameters>
    <Parameter name="Longitude" value="50.512899999999945"/>
    <Parameter name="Latitude" value="26.0316"/>
    </Parameters>
    </Provider>
    </Providers>
    <Directories>
    <Directory path="Bahrain_Endurance"/>
    <Directory path="Bahrain_Gp"/>
    <Directory path="Bahrain_Inner"/>
    <Directory path="Bahrain_Outer"/>
    <Directory path="Bahrain_Paddock"/>
    </Directories>
    </Location>

    <Location name="Bathurst/Mount Pana" inProfiles="1">
    <Providers>
    <Provider id="1">
    <Parameters>
    <Parameter name="Location" value="ASXX0411"/>
    </Parameters>
    </Provider>
    <Provider id="2">
    <Parameters>
    <Parameter name="Longitude" value="149.56246376037598"/>
    <Parameter name="Latitude" value="33.438424943346"/>
    </Parameters>
    </Provider>
    </Providers>
    <Directories>
    <Directory path="Bathurst"/>
    </Directories>
    </Location>

    <Location name="Shanghai International Circuit" inProfiles="1">
    <Providers>
    <Provider id="1">
    <Parameters>
    <Parameter name="Location" value="CHXX0116"/>
    </Parameters>
    </Provider>
    <Provider id="2">
    <Parameters>
    <Parameter name="Longitude" value="121.22397120000005"/>
    <Parameter name="Latitude" value="31.3372209"/>
    </Parameters>
    </Provider>
    </Providers>
    <Directories>
    <Directory path="Chinese_Gp"/>
    </Directories>
    </Location>

    <Location name="Indianapolis" inProfiles="1">
    <Providers>
    <Provider id="1">
    <Parameters>
    <Parameter name="Location" value="USIN0305"/>
    </Parameters>
    </Provider>
    <Provider id="2">
    <Parameters>
    <Parameter name="Longitude" value="-86.158068"/>
    <Parameter name="Latitude" value="39.768403"/>
    </Parameters>
    </Provider>
    </Providers>
    <Directories>
    <Directory path="Indianapolis"/>
    <Directory path="Indianapolis500"/>
    <Directory path="Indianapolis2007Gp"/>
    <Directory path="Indianapolis2013Gp"/>
    <Directory path="Indianapolis2014Gp"/>
    </Directories>
    </Location>
     
  4. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Thanks, those locations have been added.
     
  5. Gerald, a big thank you for both this and the tv plugin tool. Our league use both now and it made the whole race experience a whole lot better.

    A request, while we are prepping a new season and hopefully will have a dedicated broadcast PC. We really like the radar thing, can this be as a widget on a website? Perhaps just take this info from the broadcast or race server where realtime weather is used?
    Sorry couldn't really decide in which thread I should post this :)
     
  6. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    For now the radar is only collected from the tv console. The server does not have the radar info. I can add a possibility to retrieve the radar by the server (allowing to use a specific api key) and open a lite http server to provide a http widget.
     
  7. Rich Goodwin

    Rich Goodwin Registered

    Joined:
    May 3, 2012
    Messages:
    1,219
    Likes Received:
    9
    ^^ that would be awesome for me, too.

    Sent from my Nexus 5 using Tapatalk
     
  8. argo0

    argo0 Registered

    Joined:
    Jan 22, 2012
    Messages:
    624
    Likes Received:
    8
    Thanks for this. Its great. Anyone know why it doesn't seem to know exactly which tracks I have installed? And why doesn't the most up to date xml have the Indy configurations in it, or Aintree for example? Just trying to understand how it all works.
     
  9. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    I update WeatherConfig.xml only when user post new info here (i do not have enough time to track each time a new track or track version is released) -> it is why i created an XML file, so you can add any missing info and inform me here. The static tool only propose to you track defined in the XML file (no parsing of your rF2 installed track)

    Weather Control Plugin v2.1 & Weather Server 2.2.0.0 available
    - Allow access via HTTP to the server mainly to provide a weather widget (By starting a self made tiny webserver)
    http://weatherServerIP:httpPort/ -> display the summary list of managed plugins
    http://weatherServerIP:httpPort/WeatherWidget.csp?plugin=<id> -> display the weather widget based on collected Realtime data (condition and radar)
    http://weatherServerIP:httpPort/WeatherWidgetFromRF2.csp?plugin=<id> -> display the weather widget based on current RF2 data (Not all data are accurate - rF2 bugs for now - not really usable now)

    Ex: http://localhost:8081/WeatherWidget.csp?plugin=12345
    View attachment 13584

    NOTES:
    - The Web HMI is awfull. I don't want to spent time on that, so if someone want to enhance the web HMI, i will be very happy.
    - I created a C# Server Page (CSP) inspired from Java Server Page (JSP). So i use it to build html/json page using C#. It use "<#" instead of "<%". All C# code is executed at server side. (the CSP engine will parse file with ".csp" and ".json" extension)
    ... <# string str = ""; #> // a C# code line
    ... <#=str#> // echo str to the output stream

    Example of plugin summary list (The README.txt details available info)
    Code:
    <table border="1">
    <tr><td>Plugin Port</td><td>State</td><td>Version</td><td>Profile</td><td>Last Sync</td><td>Session</td><td>Elapsed</td><td>Profile path</td></tr>
    <# foreach (KeyValuePair<int, Plugin> pair in Program.configuration.pluginTracker.clientByPort) {
    	Plugin p = pair.Value;#>
    	<tr>
    	<td><#="" + p.port#></td>
    	<td><#=p.getState()#></td>
    	<td><#=p.version#></td>
    	<td><#=p.profile#></td>
    	<td><#=p.lastSyncAsText#></td>
    	<# if (p.sessionType == -1) { #>
    		<td></td>
    		<td></td>
    	<# } else { #>
    		<td><#=p.getSessionType()#></td>
    		<td><#=p.getElapsed()#></td>
    	<# } #>
    	<td><#=p.profilePath#></td>
    	</tr>
    <# } #>
    </table>
    
     
  10. argo0

    argo0 Registered

    Joined:
    Jan 22, 2012
    Messages:
    624
    Likes Received:
    8
    Thanks Gerald, I understand now
     
  11. The code looks like it will work locally if the webserver files are located on the race server (i could be wrong tho).
    However my webhost is not located on the actual race server. Which i dont think is the case of any league, again i could be wrong :p but i dont really see how it will retrieve any info from the actual race server?

    Nevermind, i should have read through it hehe.. i think i will try it before i post next time hehe
     
  12. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    The static tool is used to update rF2 wet files, so you need a file access to them.

    I don't why you speak about a webserver. The WeatherConfig.xml file on the net is only here as a collaborative file so you can download it and put it into your static hmi installation
     
  13. OK - what i asked was a widget that could be posted on a website. I meant some kinda code that would be shown on a forum, like we currently have - but the code is from weatherunderground. That is why i said webserver.
     
  14. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    You can, and you can design it as you want, what i provide is only a sample.

    WeatherServer is hosted wathever you want, when you active the HTTP, the weather server open an http and listen for incomming http call. So design your web page as you want (in the web directory of the weather server), and call it from anywhere (your forum). You can even create a page returning JSON format if you want to create your own widget in php in your forum for example.

    I do not see any limitation, but i can have missed something
     
  15. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    Plugin v2.2 and Weather Server v2.2.1 available
    I have managed to collect some broken data in other place, so now you can use the "WeatherWidgetFromRF2.csp" who display the current weather comming from the game and not the weather server (so "real" weather)
    - only the Cloud Coverage is not correct (i twicked it to have the same value as the rain intensity, because rF2 always provide "0" as Cloud coverage)

    Additionnally, "WeatherWidgetFromRF2.csp" display the radar image, if the weather server is in "RealTime" mode for the displayed plugin info.

    View attachment 13618
     
  16. Tirex

    Tirex Registered

    Joined:
    Dec 7, 2013
    Messages:
    37
    Likes Received:
    0
    Hi Gerald
    our update B798 was successful...even the dediserver
    but the weathertool, working well with B770, does not start any more

    which files are to switch in which directory?
    Server is 32bit
     
  17. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    DLLs must be moved under <rf2>/bin32/plugins for the 32bit dll and under <rf2>/bin64/plugins for the 64bit dll.
     
  18. Tirex

    Tirex Registered

    Joined:
    Dec 7, 2013
    Messages:
    37
    Likes Received:
    0
    exact what we did..
    the other files were not moved (.ini etc.)
    core path. c/rfactor2

    weather server: no function
     
  19. Gerald Jacobson

    Gerald Jacobson Registered

    Joined:
    Jan 26, 2013
    Messages:
    827
    Likes Received:
    18
    What is exactly your issue, please ?
     
  20. Tirex

    Tirex Registered

    Joined:
    Dec 7, 2013
    Messages:
    37
    Likes Received:
    0
    we seperated the 32 and 64 dlls in each plugin folder, as u said
    the weatherserver.ini and weatherserver.exe are still in the core path: c:\rfactor2
    when i click the icon, i got the msg. : Weatherserver could not be started
     

Share This Page