Freelancer Community Network

Eagle Utopia Forum


Eagle Utopia
« Creating Plug-ins »

Welcome Guest. Please Login or Register.
Jan 6, 2010, 10:49am




Eagle Utopia :: FLAC .NET Development :: Reference :: Creating Plug-ins
   [Search This Thread][Send Topic To Friend] [Print]
 AuthorTopic: Creating Plug-ins (Read 412 times)
Eagle
Administrator
*****
member is offline

[avatar]

Black holes suck


[homepage]

Joined: Oct 2003
Gender: Male
Posts: 5,417
Location: Netherlands
 Creating Plug-ins
« Thread Started on Jun 13, 2008, 10:58am »

Its possible to add your own class library (.NET assembly) to FLAC which can recieve server notifications and is able to send its own events. Which notifications and events are available can be found in the documentation found in this section. These help pages are updated automatically when new features become available.

I've created an example project to demonstrate how you can receive notifications and send your own events. Binaries required to build your own assembly are included in this project, latest versions can be downloaded from the binaries thread.

PlugIn example project

The way this project is setup will allow you to use the resulting assembly not only in the current version of FLAC, but all builds after that. No need to rebuild your own plugins with each release, which will make distribution to others interrested in the plugin functionality a viable option.

The build assembly can be loaded in FLAC by adding a new file to the My Docs\FLAntiCheat folder with the name: DynamicAssemblies.xml
Multiple plugins can be added, simply add another plugin tag to plugins. The content of this file for including the example class library is as follows:


<?xml version="1.0" encoding="utf-8"?>
<dynamic_assemblies xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <plugins>
    <plugin assembly="C:\FlacPlugins\FlacPlugIn.Example.dll" listener="FlacPlugIn.Example.NotificationHandler" />
  </plugins>
</dynamic_assemblies>


Note!
FLAC loads the plugins on startup, if you make changes to the config file or plugin itself... make sure you restart FLAC to use/test these changes.
Link to Post - Back to Top  IP: Logged

[image]
Eagle has landed...
Unicornz
FLAC
***
member is offline

[avatar]

[msn]
[homepage]

Joined: Jan 2006
Gender: Male
Posts: 331
Location: Uk
 Re: Creating Plug-ins
« Reply #1 on Jun 13, 2008, 8:08pm »

mmm i thought yours would be avail for download eagle ?
Link to Post - Back to Top  IP: Logged
Eagle
Administrator
*****
member is offline

[avatar]

Black holes suck


[homepage]

Joined: Oct 2003
Gender: Male
Posts: 5,417
Location: Netherlands
 Re: Creating Plug-ins
« Reply #2 on Jun 13, 2008, 10:12pm »

It is, in the news section of the FLAC forum 8-)
Link to Post - Back to Top  IP: Logged

[image]
Eagle has landed...
Unicornz
FLAC
***
member is offline

[avatar]

[msn]
[homepage]

Joined: Jan 2006
Gender: Male
Posts: 331
Location: Uk
 Re: Creating Plug-ins
« Reply #3 on Jun 17, 2008, 12:05am »

i'm going blind m8 sorry
Link to Post - Back to Top  IP: Logged
Unicornz
FLAC
***
member is offline

[avatar]

[msn]
[homepage]

Joined: Jan 2006
Gender: Male
Posts: 331
Location: Uk
 Re: Creating Plug-ins
« Reply #4 on Jul 31, 2008, 1:26am »

tried building the example, built ok, added to the repective file and it works :D now i need to learn what can be done and how todo it..

simple things first, anyone got any pointers

Link to Post - Back to Top  IP: Logged
bulldogg
FLAC
***
member is offline




[homepage]

Joined: May 2007
Gender: Male
Posts: 431
 Re: Creating Plug-ins
« Reply #5 on Jul 31, 2008, 8:14am »

i first started by looking at making a custom command to send some preset text to a player, for me it was some server rules,

so i used PrivateChat.Fire(user, string.Format("TEXT")); to send text to the player using the command, thats pretty much as simple as it gets. if you wanted to make something like this take a look at the suicide example

youd rename the internal class to something such as rules and the public class to rules aswell. change the description and replace whats inside

public override void Execute(Player user, string parameters) {

}

with the code to send a private message to a player which would be PrivateChat.Fire(user, string.Format("TEXT"));

build and test. from there i went to getting it to read the rules from a file allowing admins to change the rules to their server rules :)

have a read of the documentation http://www.xs4all.nl/~marends/documentation/ it really helped me alot
Link to Post - Back to Top  IP: Logged

http://gamer-forums.com
Eagle
Administrator
*****
member is offline

[avatar]

Black holes suck


[homepage]

Joined: Oct 2003
Gender: Male
Posts: 5,417
Location: Netherlands
 Re: Creating Plug-ins
« Reply #6 on Jul 31, 2008, 8:17am »

See if you understand all that has been included in the example, and when you do you could have a look at the EagleWare.Libraries.FLServerCommunications.Events and EagleWare.Libraries.FLServerCommunications.Notifications namespaces in the documentation to see what else is available. Let me know how you're progressing 8-)
Link to Post - Back to Top  IP: Logged

[image]
Eagle has landed...
Unicornz
FLAC
***
member is offline

[avatar]

[msn]
[homepage]

Joined: Jan 2006
Gender: Male
Posts: 331
Location: Uk
 Re: Creating Plug-ins
« Reply #7 on Jul 31, 2008, 1:34pm »


Quote:
build and test. from there i went to getting it to read the rules from a file allowing admins to change the rules to their server rules :)


i cant find anything telling me how to read from a file though and for what i have in mind i need to find this first
Link to Post - Back to Top  IP: Logged
Eagle
Administrator
*****
member is offline

[avatar]

Black holes suck


[homepage]

Joined: Oct 2003
Gender: Male
Posts: 5,417
Location: Netherlands
 Re: Creating Plug-ins
« Reply #8 on Jul 31, 2008, 4:05pm »

You'll find all you need here, also if you google for .NET in combination with file reading or whatever else you might need, you're sure to find tutorials concerning 8-)
Link to Post - Back to Top  IP: Logged

[image]
Eagle has landed...
   [Search This Thread][Send Topic To Friend] [Print]

Click Here To Make This Board Ad-Free


This Board Hosted For FREE By ProBoards
Get Your Own Free Message Boards & Free Forums!