Jump to content
Search In
  • More options...
Find results that contain...
Find results in...

Welcome, Guest!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

  1. sassaman

    sassaman

  • Recently Browsing   0 members

    No registered users viewing this page.

  • Similar Content

    • By Neijwiert
      Are you struggling with your everyday development in C++?
      Do you suck with memory management or just the general hassle to get third party libraries for your custom Dragonade plugin?

      Well, no more!
      Introducing RenSharp for Dragonade

      This framework I created lets you make plugins for your FDS in .NET 4.7.2. You're probably wondering: will this need a heavily modified scripts.dll? I hear you and that's why I made sure it is bootstrapped by a regular Dragonade plugin.

      "Are there any other limitations?", is probably your next question. Very few, here they are:

      - You can only create custom classes (i.e. specialization of classes) for the classes I made support for. However the reach of this support is the same as you'd use in any normal Dragonade plugin (event classes, console functions, player observer, object observer, etc).

      - I only made support for the template classes that are used throughout scripts.dll. Any customizations on this are not supported.

      - Even though I added in some more safety nets to check for nulls etc. You can still fuck this up and make it crash horribly. Although the checks in place will also throw a managed exception and if not catched and handled will gracefully shutdown the FDS.

      - Some design choices removed some support. For example there is no 'const' concept. But these choices shouldn't really limit your imagination.

      - That's about it of what I can come up with on top of my head right now.


      With any plugin interface there are a few 'gotchas' and for RenSharp those are:

      - Inheritance is pretty much the same as you would in Dragonade. Except static initialization (using macros to register stuff) will not work in C#. Further explanation how this is handled is discussed in the example plugin.

      - All managed classes are basically handles to their C++ variants. You can bind the C++ pointer using the appropiate constructor which takes an IntPtr as an argument. These handle classes are not inheriting from IDisposable and assume they are not in charge of cleaning up that handle. If one of these handle classes is wrapped around an IUmanagedContainer<T> class that means that you MUST dispose them when you're done with them. As these containers indicate that you are indeed in charge of cleanup. 

      - If you pass ownership of an unmanaged pointer to the C++ side (which does the memory management) you should make sure to release the pointer on the managed side. To make sure the garbage collector never disposes it. Likewise, when you keep ownership on the managed side, you should keep a reference to the object for as long as you want to keep it alive.

      - Don't call any methods or use properties of which you don't really know what they do. You can screw it up. Otherwise, if you consider yourself well versed in this stuff, go right ahead.

      - Any more gotchas or usage are pretty much discussed in the example plugin.


      How to get started?
      The only config this adds to da.ini is 'RenSharpPlugins'. You name managed plugin .dlls the same way as you would under 'Plugins'. To start RenSharp you also need to add 'da_RenSharp.dll' under 'Plugins'. Preferably on position 1. But that is up to you. Then follow one of the instructions below:

      The quickest way to get started is to just use any Visual Studio version that can handle .NET 4.7.2. (for VS2019 you can just use the Visual Studio Installer to install .NET 4.7.2.). Create a new .NET 4.7.2. C# class library and search for the NuGet package 'Neijwiert.RenSharp' (right-mouse click on your project and click Manage NuGet Packages...) and click Install. All Renegade stuff is placed under the RenSharp namespace. When the NuGet package is installed it shows a readme.txt on how to properly set your target platform. You then have to place YourPlugin.dll, da_RenSharp.dll, ManagedRenSharp.dll and ManagedScripts.dll in your FDS folder. You can find these .dlls in 'YourPlugin\packages\Neijwiert.RenSharp.1.0.0\content' and 'YourPlugin\packages\Neijwiert.RenSharp.1.0.0\lib'.

      The slow way is to compile it yourself. You can download the ZIP file with the source, or from GitHub. Compilation requires you to have C++/CLI build tools installed (use Visual Studio Installer) and .NET 4.7.2. (also use Visual Studio Installer). You can use a newer Visual Studio version as long as you have Visual Studio 2012 installed on your computer, with latest updates (whenever it prompts you to update the projects when you open the solution, you need to hit cancel). For the C++ stuff you need the same requirements as you would when you build Dragonade. Then you can just add a .NET 4.7.2. class library project and add a reference to 'ManagedScripts'. Make sure you configurate the class library to build as x86. Then you're ready to build and use everything. 


      I pretty much made all this without drawing out a plan. I made some design mistakes and I also couldn't test everything due to the size of it. If you find anything broken/not working or stupidly designed message met and I see if I can get it fixed. This also applies for new feature requests. The best way to approach me would be via GitHub probably or a PM here. This cost me a lot of time and effort to make and I hope you guys are going to enjoy it and hopefully open up modding to some more less experienced coders. Everything is licensed under the Apache 2.0 license, which means you can do everything, but you must mention my name and include a copy of the license. I'm wide open to responses to this negative and positive, feel free to reply to this post.

      GitHub: https://github.com/Neijwiert/RenSharp
      NuGet: https://www.nuget.org/packages/Neijwiert.RenSharp
    • By Unstoppable
      WARNING! This plugin only works with DA 1.98 and above!
      Download DA 1.98 from http://www.renegadeforums.com/index.php?t=tree&th=41243&start=0&
       
      This is the first and only Fund System plugin ever released in C&C Renegade forums. If a copy or redistributed type of this plugin spotted, the action will be taken.
       
      This plugin lets players fund their destroyed buildings with !fund command. Just put DLL to da.ini under [Plugins] section.
      You have to add the configuration which is at bottom to make this plugin work.
       
      To-Do List:
      - Fix ConstantFundAmount.
      - Make a command to take your fund from a building.
       
      This plugin made by MasterCan and I tested with my slave seifmagdi. If you find a bug, please find me on Discord "The Unstoppable (TR)#1000".
       
       
      CONFIGURATION: (You must add this to bottom of da.ini to make plugin work.)
      [Fund] ;Plugin made by MasterCan. ;This settings can be edited from game mode ini files as well. ;By default, these values will be used. ;Enable or disable funding system. EnableFund=1 ;Decide if the fund amounts of buildings are constant or increases when a player joins. ;Using values except 1 and 0 will automatically disables this option. ConstantFundAmount=0 ;If your constant fund amount is 0, you can determine how much price will be added when a player joins to fund cost. ;Max = 1.0, Min = 0.1, else multiplier will be set to 1. FundAddMultiplier=1.0 ; ---------------------------------- Building Fund Ticks ---------------------------------- ;If ConstantFundAmount is 1, specified amounts will be constant fund amount of buildings. ;If ConstantFundAmount is 0, building fund cost will be increased by specified amounts when player joins or changes team. ; ;Leaving fund enabled for a building and setting tick to 0 will cause plugin to misbehave. ; ----------------------------------------------------------------------------------------- Tick_PowerPlant=450 Tick_Refinery=500 Tick_VehicleFactory=600 Tick_SoldierFactory=550 Tick_Defense=575 Tick_ConYard=300 Tick_ComCenter=325 Tick_TibSilo=350 Tick_RepairPad=200 Tick_Shrine=175 ; -------------------------------- Building Fund Allowance -------------------------------- ; Specify the building funds you want to disable. ; Use 1, for enable funding. Use 0 for disabling. ; ; Using values except 1 and 0 automatically disables funding for that building. ; ----------------------------------------------------------------------------------------- Fund_PowerPlant=1 Fund_Refinery=1 Fund_VehicleFactory=1 Fund_SoldierFactory=1 Fund_Defense=1 Fund_ConYard=1 Fund_ComCenter=1 Fund_TibSilo=1 Fund_RepairPad=1 Fund_Shrine=1  
    • By Unstoppable
      WARNING! This plugin only works with DA 1.98 and above!
      Download DA 1.98 from http://www.renegadeforums.com/index.php?t=tree&th=41243&start=0&
       
      This is the first and only Building Warnings plugin ever released in C&C Renegade forums. If a copy or redistributed type of this plugin spotted, the action will be taken.
       
      Plugin reports building health percents ingame with EVA sounds like below. If you see bug, let me know in comments or find me in Discord "The Unstoppable (TR)#1000"
      [DA] The GDI Power Plant health at 75 percent
    • By Unstoppable
      A alternative and advanced version of RenList listing utility. This is a server listing utility which takes data from GSA feeds from GSA Master Server hosted by CnCIRC and lists server for user. The differences between RenList and MasterList and the reasons of why you should prefer MasterList is specified below.
      If you using my lister, thank you so much. Please always use the latest version of this
       
                     • MasterList is quicker than RenList for listing speed.
                     • MasterList is simplier and more advanced than RenList.
                     • Usage of MasterList is easier.
       
      The changes that planned and going to add: 
                     • Buddy system. Notices you when your buddy in a/any server.
                     • Favorites system. Notices you when a event that you want happens. Example, when the map you want starts.
                     • Some basic improvements for visual of UI.
                     • Some other improvements for backend.
       
      Some help?? Look below!
                     • Find "Theme" option from Menu>Options list to change your theme.
                     • Change your nickname or your Renegade Installation directory from the related options on Menu>Options.
                     • And be ready for other new features!
       
      Please report bugs and suggestions to me on here or Discord ( The Unstoppable (TR)#1065 ) or find me from MPF Discord Server at http://multiplayerforums.com/discord 
       
      Enjoy!
    • By Unstoppable
      Basic Renegade GSA API made by C# Language. Originally by Iran (if I don't remember wrong), but modified. Have 4 functions;

      GetAllRenServersIPByGSA() - Returns IPEndPoint[] : Gets all servers IP
      GetGSData(IPEndPoint server) - Returns Dictionary<string, string> : Gets server data by server IP.
       
      Here's a basic code for lazy.
      //Shorter version Dictionary<string, string> mpf_server_data = new Dictionary<string, string>(); IPEndPoint mpf_ip = new IPEndPoint(); foreach(IPEndPoint ip in GetAllRenServersIPByGSA()) { if(GetGSData(ip)["hostname"].Contains("MPF")) { mpf_server_data = GetGSData(ip); mpf_ip = ip; } } You can get all servers data with this code too.
       
      If you want shorter way, here's a basic code.
      Dictionary<string, string> mpf_server_data = GetServerDataByKeyValue("hostname", "MPF"); It returns the same mpf_server_data value as the top.
       
       
      For the IP, you can write this code.
      IPEndPoint mpf_ip = GetServerIPByKeyValue("hostname", "MPF"); It also returns the same mpf_ip value as the top.
       
      Comment bugs, glitches and ideas about new functions.
       
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and Privacy Policy.