From a7f066c343da5916c890c885cf765afdde2c8ffe Mon Sep 17 00:00:00 2001 From: John Hurliman Date: Thu, 14 Dec 2006 20:26:51 +0000 Subject: [PATCH] * Changed disconnect callbacks in NetworkManager to events * Sanity check for sending a zero or negative amount in GiveMoney() git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@723 52acb1d6-8a22-11de-b505-999d5b087335 --- libsecondlife-cs/MainAvatar.cs | 6 ++++-- libsecondlife-cs/NetworkManager.cs | 5 +++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/libsecondlife-cs/MainAvatar.cs b/libsecondlife-cs/MainAvatar.cs index 91a823c0..d05b735e 100644 --- a/libsecondlife-cs/MainAvatar.cs +++ b/libsecondlife-cs/MainAvatar.cs @@ -448,8 +448,10 @@ namespace libsecondlife public void GiveMoney(LLUUID target, int amount, string description) { // 5001 - transaction type for av to av money transfers - - GiveMoney(target, amount, description, 5001); + if (amount > 0) + GiveMoney(target, amount, description, 5001); + else + Client.Log("Attempted to pay zero or negative value " + amount, Helpers.LogLevel.Warning); } /// diff --git a/libsecondlife-cs/NetworkManager.cs b/libsecondlife-cs/NetworkManager.cs index dc09077e..e6d0e4f0 100644 --- a/libsecondlife-cs/NetworkManager.cs +++ b/libsecondlife-cs/NetworkManager.cs @@ -659,16 +659,17 @@ namespace libsecondlife { get { return connected; } } + /// /// An event for the connection to a simulator other than the currently /// occupied one disconnecting /// - public SimDisconnectCallback OnSimDisconnected; + public event SimDisconnectCallback OnSimDisconnected; /// /// An event for being logged out either through client request, server /// forced, or network error /// - public DisconnectCallback OnDisconnected; + public event DisconnectCallback OnDisconnected; private SecondLife Client; private Dictionary> Callbacks = new Dictionary>();