void Search_FoundLookup(byte[] data, object arg) { try { if (Core.Sim == null || Core.Sim.Internet.TestEncryption) { data = Utilities.DecryptBytes(data, data.Length, Network.OpCrypt.Key); } LocationData loc = LocationData.Decode(data); if (loc != null) { Core.Locations.AddRoutingData(loc); } } catch { } }
void Search_FoundLocation(byte[] data, object arg) { SharedFile file = arg as SharedFile; if (file.Completed) { return; } OpTransfer transfer = null; // add locations to running transfer LocationData loc = LocationData.Decode(data); DhtClient client = new DhtClient(loc.UserID, loc.Source.ClientID); if (transfer == null) { transfer = StartTransfer(client, file); } Core.Network.LightComm.Update(loc); transfer.AddPeer(client); }
void Search_FoundRoom(byte[] data, object arg) { ChatRoom room = arg as ChatRoom; if (!room.Active) { return; } // add locations to running transfer LocationData loc = LocationData.Decode(data); DhtClient client = new DhtClient(loc.UserID, loc.Source.ClientID); Core.Network.LightComm.Update(loc); if (!room.Members.SafeContains(client.UserID)) { room.AddMember(client.UserID); Core.Locations.Research(client.UserID); } // connect to new members ConnectRoom(room); }