[Release] Iris

08/20/2010 16:56 Yamachi#1

[Only registered and activated users can see links. Click Here To Register...]

Iris is a GlobalMgrSvr Communication Library. In layman's terms, she lets you communicate with your server's GlobalMgrSvr and do things such as:
  • Obtain information about the server, including how many people are logged on. You can even see how many people are in each map.
  • Send a GM message by mail. Because this is done by directly communicating with the GMS, the GM mail appears on your users' screens immediately after sending it.
  • Broadcast a message. This message will appear at the top-center and bottom-right of all connected users' screens.
  • Disconnect all players from a channel. This is especially handy if you want to restart your server, or take it down for maintenance.

Iris is fully COM-visible, so she can be used with not only .Net languages like C# and VB.Net, but also native C++ and Autoit code (and anything else that supports COM).

To use Iris, simply reference her in your application, create an instance of the Iris.Communication class, then give it an IP and port to connect to. Here's an example in C#:

Code:
var iris = new Iris.Communication();
iris.Connect("192.168.1.2", 38170);
Simple, no? By default, Iris sends a "heartbeat" packet every 30000 milliseconds (30 seconds). You can, however, specify a custom interval. You can do so by passing the desired interval in milliseconds when you create an instance of Iris.Communication.

Code:
var iris = new Iris.Communication(5000);  // 5 seconds
...
Iris can also notify your application when certain events happen, like receiving the channel list, for example.

Code:
var iris = new Iris.Communication(5000);
iris.Events.OnReceiveServerList += new iris.EventHandler.ServerListHandler(myApp_OnReceiveServerList);
iris.Connect("192.168.1.2", 38170);
...
Iris can easily send both GM messages and broadcasts using the same method.

Code:
iris.SendMessage(6, 3, "my message");  // Broadcasts "my message" to channel 3 on server 6.
iris.SendMessage(6, 0, "msg");  // BC's "msg" to all channels on server 6.
iris.SendMessage(4, new byte[] { 2, 4, 6 }, "msg");  // BC's "msg" to channels 2, 4, and 6 on server 4.

iris.SendMessage(5, 2, "title", "message");  // Sends a GM message with the title "title", and containing the message "message" to channel 2 on server 5.

// You can use the same sort of principles with Broadcasting as GM messages to send messages to multiple/all channels.
Iris can also disconnect all players from a specified channel. This helps prevent accidental rollbacks or data loss when taking your server down for maintenance. Just disconnect everyone before you shut your server down, and you're good to go :)

Code:
iris.DisconnectPlayers(6, 2);  // Disconnects all players in channel 2 on server 6.

// You can do the same here as with Broadcasting to disconnect from multiple channels.



Time for the downloads :D
26/08/2010
Quote:
* Fixed all disconnections inside Iris (Iris.Disconnect(), disconnections caused by the server, etc.).
* Changed "ServerListArgs" -> "ServerEventListArgs" (was a typo. Make sure to update this in your programs).
* Changed ServerListEventArgs.IP to show the local IP instead of the server's IP. It's much more useful this way, especially seeing as we already have the server's IP.
* Added 3 new events: OnConnect, OnDisconnect, and OnLogin. Check intellisense for more information.
* Fixed Channel.Type being set incorrectly and added Channel.IsOnline. It turns out I was using old code, and not the newest code from my personal broadcast tool :S. Anyways, the code has now been merged with Iris.
* Added <summary> tags to the enuerations.
* Maybe a few small changes. Can't remember. Nothing code-breaking.
Binaries: [Only registered and activated users can see links. Click Here To Register...]
Source: [Only registered and activated users can see links. Click Here To Register...]

20/08/2010
Binaries: [Only registered and activated users can see links. Click Here To Register...]
Source: [Only registered and activated users can see links. Click Here To Register...]



NOTES:
  • You will need at least Visual C# 2010 Express to compile Iris.
  • All public members in Iris are accompanied by <summary> tags, so plenty of information is available via Intellisense while you code. Pay attention to the notes!
  • Iris is licensed under the GPLv3 open-source license. Please be aware that this means you may NOT use Iris in commercial products. The license also requires that any publicly-released modifications and/or derivative works (including any program making use of Iris' functionality) be licensed under GPLv3. If you are unsure about some of the implications of the GPLv3 license, please don't hesitate to ask about it here.
  • ALWAYS disconnect Iris before your application exits by calling "iris.Disconnect();". If you don't, a user slot will be taken up indefinitely in your GMS. Once all those slots are taken up, Iris will no longer be able to connect. You can remedy this by restarting your GMS.
  • I plan to add more features to Iris later on, possibly including the ability to change a channel's type on-the-fly, and start/stop/restart channels.
  • Most importantly, I WILL NOT OFFER ANY SUPPORT FOR IRIS. I have given you all plenty enough information, and more can be garnered from Intellisense and reading Iris' code. If you don't know how to program, that's not my fault. I suggest you start by picking a language, then Google some tutorials and read the language's documentation.
  • If you use Iris and would like to receive notifications of updates, please subscribe to this thread by using the following link: [Only registered and activated users can see links. Click Here To Register...]
  • TDP 4 presuhdentz =B








!!IMPORTANT!!
If you wish to protect your server from unauthorized access to your GMS, either change your GMS's port to something other than 38170, or restrict access to only certain safe IP's via Windows IPSec, Linux IPTables, or Linux hosts.allow/hosts.deny. If you don't do this, anyone will be able to broadcast and disconnect your players. Information on how to prevent this can be found by Google'ing.
08/20/2010 17:04 Pupix#2
This deserves a sticky!
08/20/2010 17:06 .SweeT#3
Was bringt das Programm ?
08/20/2010 17:18 .Cloud#4
einfach durchlesen was da steht dann weißt du auch was das programm bringt -.-
08/20/2010 22:11 Mirceagab#5
Nice release,as always ofcourse.Thanks
08/26/2010 14:05 Yamachi#6
Updated first post with new version.

Changelog:
Quote:
* Fixed all disconnections inside Iris (Iris.Disconnect(), disconnections caused by the server, etc.).
* Changed "ServerListArgs" -> "ServerEventListArgs" (was a typo. Make sure to update this in your programs).
* Changed ServerListEventArgs.IP to show the local IP instead of the server's IP. It's much more useful this way, especially seeing as we already have the server's IP.
* Added 3 new events: OnConnect, OnDisconnect, and OnLogin. Check intellisense for more information.
* Fixed Channel.Type being set incorrectly and added Channel.IsOnline. It turns out I was using old code, and not the newest code from my personal broadcast tool :S. Anyways, the code has now been merged with Iris.
* Added <summary> tags to the enuerations.
* Maybe a few small changes. Can't remember. Nothing code-breaking.
03/05/2015 13:22 Cykros#7
Can someone re upload the source please?
Thank you!
11/13/2016 16:15 PhantomLegacy#8
some one reupload for the old thread?
07/28/2017 16:56 cabalgow#9
Quote:
Originally Posted by PhantomLegacy View Post
some one reupload for the old thread?
[Only registered and activated users can see links. Click Here To Register...]