* Internal callback mechanism, user callback hashtable is now UserCallbacks
* Moved some of the packet receiving logic in to internal callbacks * Fixed HORRIBLE threading race condition with Circuit.Buffer[] git-svn-id: http://libopenmetaverse.googlecode.com/svn/trunk@22 52acb1d6-8a22-11de-b505-999d5b087335
This commit is contained in:
@@ -9,7 +9,7 @@ namespace name2key
|
||||
static bool waiting = true;
|
||||
|
||||
//
|
||||
public static void QueryHandler(Packet packet)
|
||||
public static void QueryHandler(Packet packet, Circuit circuit)
|
||||
{
|
||||
if (packet.Layout.Name.IndexOf("Dir") > -1)
|
||||
{
|
||||
@@ -67,10 +67,10 @@ namespace name2key
|
||||
|
||||
// Setup the callback
|
||||
PacketCallback queryCallback = new PacketCallback(QueryHandler);
|
||||
client.Network.Callbacks["DirPeopleReply"] = queryCallback;
|
||||
client.Network.UserCallbacks["DirPeopleReply"] = queryCallback;
|
||||
|
||||
if (!client.Network.Login(args[0], args[1], args[2], "00:00:00:00:00:00", 1, 10, 2, 2, "Win",
|
||||
"0", "sldump", "jhurliman@wsu.edu"))
|
||||
"0", "name2key", "jhurliman@wsu.edu"))
|
||||
{
|
||||
// Login failed
|
||||
Console.WriteLine("ERROR: " + client.Network.LoginError);
|
||||
|
||||
@@ -7,10 +7,8 @@ namespace sldump
|
||||
class sldump
|
||||
{
|
||||
//
|
||||
public static void DefaultHandler(Packet packet)
|
||||
{
|
||||
Console.WriteLine("Received " + packet.Layout.Name);
|
||||
|
||||
public static void DefaultHandler(Packet packet, Circuit circuit)
|
||||
{
|
||||
string output = "";
|
||||
ArrayList blocks = packet.Blocks();
|
||||
|
||||
@@ -62,7 +60,7 @@ namespace sldump
|
||||
|
||||
// Setup the callback
|
||||
PacketCallback defaultCallback = new PacketCallback(DefaultHandler);
|
||||
client.Network.Callbacks["Default"] = defaultCallback;
|
||||
client.Network.UserCallbacks["Default"] = defaultCallback;
|
||||
|
||||
if (!client.Network.Login(args[0], args[1], args[2], "00:00:00:00:00:00", 1, 10, 2, 2, "Win",
|
||||
"0", "sldump", "jhurliman@wsu.edu"))
|
||||
|
||||
Reference in New Issue
Block a user