Thank your for the comments. :)
_EDIT
Plugin Example to enable new console search if you don't have:
PHP Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Holo;
public class ConsoleSearchPlugin : HolographPlugin
{
public ConsoleSearchPlugin()
{
this._Name = "Console Search Plugin";
this._Description = "Makes the 'Search' function of the console work. Credits to Holo Total Database Pooling";
this._Author = "Holo TDbP";
this._Version = new Version(1, 0);
}
public override void Init()
{
Out.WriteLine("Console Search Enabled");
}
public override void End()
{
Out.WriteLine("Console Search Disabled");
}
public override void processAdditionalPacket(string currentPacket, Holo.Virtual.Users.virtualUser User)
{
this._User = User;
if (currentPacket.Substring(0, 2) == "@i")
{
Out.WriteLine("User searched '" + currentPacket.Substring(4) + "' in the console.");
// Variables
//Database dbClient = new Database(true, false, 204);
string Packet = "Fs";
string PacketFriends = "";
string PacketOthers = "";
string PacketAdd = "";
int CountFriends = 0;
int CountOthers = 0;
// Database
string[] IDs;
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
string Search = currentPacket.Substring(4);
Search = Search.Replace(@"\", "\\").Replace("'", @"\'");
dbClient.AddParamWithValue("search", Search);
IDs = dataHandling.dColToArray((dbClient.getColumn("SELECT id FROM users WHERE name LIKE '" + Search + "%' LIMIT 20 ")));
}
// Loop through results
for (int i = 0; i < IDs.Length; i++)
{
int thisID = Convert.ToInt32(IDs[i]);
bool online = userManager.containsUser(thisID);
string onlineStr = online ? "I" : "H";
DataRow row;
using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
{
row = dbClient.getRow("SELECT name, mission, lastvisit, figure FROM users WHERE id = " + thisID.ToString());
}
PacketAdd = Encoding.encodeVL64(thisID)
+ row[0] + ""
+ row[1] + ""
+ onlineStr + onlineStr + ""
+ onlineStr + (online ? row[3] : "") + ""
+ (online ? "" : row[2]) + "";
// Friend or not?
if (Messenger.hasFriendship(thisID))
{
CountFriends += 1;
PacketFriends += PacketAdd;
}
else
{
CountOthers += 1;
PacketOthers += PacketAdd;
}
}
// Add count headers
PacketFriends = Encoding.encodeVL64(CountFriends) + PacketFriends;
PacketOthers = Encoding.encodeVL64(CountOthers) + PacketOthers;
// Merge packets
Packet += PacketFriends + PacketOthers;
// Send packets
sendData(Packet);
}
}
}