How to make ur guilds/Friends to work perfect.

Experienced Elementalist
Joined
Jun 12, 2008
Messages
237
Reaction score
0
OKi...so here we are... well the problem of guilds/friends in lotf source is the name of players in guild or u have in ur friends list.If that person have a name with the '~' in its name....the server will go crazy.To fix u can do 1 thing....XD

For GUILDS!
NOTE:BEFORE DO ANYTHING DELETE ALL GUILDS FROM DATABASE!
Go in database.cs
search for
Code:
public static void SaveGuild(Guild TheGuild)
u`ll see there something like
Code:
PackedDLs += dl + "~";
PackedMembers += nm + "~";
PackedAllies += ally + "~";
PackedEnemies += enemy + "~";
make them
Code:
PackedDLs += dl + ".";
PackedMembers += nm + ".";
PackedAllies += ally + ".";
PackedEnemies += enemy + ".";

now search for
Code:
        public static void LoadGuilds()
u`ll see there....
Code:
string[] RDLS = DLs.Split('~');
string[] RNMs = NMs.Split('~');
make them
Code:
string[] RDLS = DLs.Split('.');
string[] RNMs = NMs.Split('.');


Now in guild.cs
search for
Code:
        public Guild(string guildname, ushort guildid, string creator, string[] dls, string[] members, uint fund, uint gwwins, byte holdingpole, uint membersc, string bulletin, string allies, string enemies)
there u can see something like
Code:
string[] Splitter = allies.Split('~');
Splitter = allies.Split('~');
make it....
Code:
string[] Splitter = allies.Split('.');
Splitter = allies.Split('.');
now... in same statement before
Code:
                GuildName = guildname;
                GuildID = guildid;
                MembersCount = membersc;
                GWWins = gwwins;
                Fund = fund;
add a
Code:
try
{
and after
Code:
                if (members.Length > 0 && members[0] != "")
                {
                    foreach (string mem in members)
                    {
                        if (mem != null && mem.Length > 0)
                        {
                            Splitter = mem.Split(':');
                            Members.Add(uint.Parse(Splitter[1]), mem);
                        }
                    }
                }
add
Code:
            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }

Thats all for the guilds.

For FRIENDS now...
in database.cs
search for
Code:
        public static void RemoveFromFriend(uint RemoverUID, uint RemovedUID)
there u`ll see
Code:
string[] Friendss = Friends.Split('~');
NewFriends += friend + "~";
make them
Code:
string[] Friendss = Friends.Split('.');
NewFriends += friend + ".";

now....
in character.cs
search for
Code:
public void UnPackFriends()

you`ll see there
Code:
string[] Friendss = PackedFriends.Split('~');
make it
Code:
string[] Friendss = PackedFriends.Split('.');

and at
Code:
public void PackFriends()
u`ll see there
Code:
                PackedFriends += (string)DE.Value + ":" + (uint)DE.Key + "~";
make it
Code:
                PackedFriends += (string)DE.Value + ":" + (uint)DE.Key + ".";


Hope you`ll enjoy...wont exist any problems with the guilds and friends after...
 
Well.. Guilds and all working fine to me but, without Allies and Enemies. If I change it to this will also that work?
 
nooo's finally sm1 else besides meh figured this out lolz =x

i did it to the wh's also along time ago cuz i figured it might cause problems 2 if i had left it like that with the ~ in it donnu tho =x

i believe ~ can't be used cuz its can be used for login id's/ ingame names correct?
 
my database.cs doesnt have public static void RemoveFromFriend(uint RemoverUID, uint RemovedUID)

and how do u add the try { and **** can u just give me the
Code:
 public Guild(string guildname, ushort guildid, string creator, string[] dls, string[] members, uint fund, uint gwwins, byte holdingpole, uint membersc, string bulletin, string allies, string enemies)
        {
            GuildName = guildname;
            GuildID = guildid;
            MembersCount = membersc;
            GWWins = gwwins;
            Fund = fund;
            if (holdingpole == 0)
                HoldingPole = false;
            else
                HoldingPole = true;
            Creator = creator;
            Bulletin = bulletin;

            string[] Splitter = allies.Split('.');

            foreach (string ally in Splitter)
            {
                Allies.Add(ally);
            }

            Splitter = allies.Split('.');

            foreach (string enemy in Splitter)
            {
                Enemies.Add(enemy);
            }

            if (dls.Length > 0 && dls[0] != "")
            {
                foreach (string dl in dls)
                {
                    if (dl != null && dl.Length > 0)
                    {
                        Splitter = dl.Split(':');
                        DLs.Add(uint.Parse(Splitter[1]), dl);
                    }
                }
            }

            if (members.Length > 0 && members[0] != "")
            {
                foreach (string mem in members)
                {
                    if (mem != null && mem.Length > 0)
                    {
                        Splitter = mem.Split(':');
                        Members.Add(uint.Parse(Splitter[1]), mem);
                    }
                }
            }
        }

can u just give me that section?
 
public Guild(string guildname, ushort guildid, string creator, string[] dls, string[] members, uint fund, uint gwwins, byte holdingpole, uint membersc, string bulletin, string allies, string enemies)
{
GuildName = guildname;
GuildID = guildid;
MembersCount = membersc;
GWWins = gwwins;
Fund = fund;
if (holdingpole == 0)
HoldingPole = false;
else
HoldingPole = true;
Creator = creator;
Bulletin = bulletin;

string[] Splitter = allies.Split('.');

foreach (string ally in Splitter)
{
Allies.Add(ally);
}

Splitter = allies.Split('.');

foreach (string enemy in Splitter)
{
Enemies.Add(enemy);
}

if (dls.Length > 0 && dls[0] != "")
{
foreach (string dl in dls)
{
if (dl != null && dl.Length > 0)
{
Splitter = dl.Split(':');
DLs.Add(uint.Parse(Splitter[1]), dl);
}
}
}

if (members.Length > 0 && members[0] != "")
{
foreach (string mem in members)
{
if (mem != null && mem.Length > 0)
{
Splitter = mem.Split(':');
Members.Add(uint.Parse(Splitter[1]), mem);
}
}
}
}
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }

so u should prolly also remove it for skills/warehouses/etc? or no? not sure about that part but if so then u mighta wanna update ure tut lolz

well...the problem is because of ppl names...not items or skills or things like that
 
public Guild(string guildname, ushort guildid, string creator, string[] dls, string[] members, uint fund, uint gwwins, byte holdingpole, uint membersc, string bulletin, string allies, string enemies)
{
GuildName = guildname;
GuildID = guildid;
MembersCount = membersc;
GWWins = gwwins;
Fund = fund;
if (holdingpole == 0)
HoldingPole = false;
else
HoldingPole = true;
Creator = creator;
Bulletin = bulletin;

string[] Splitter = allies.Split('.');

foreach (string ally in Splitter)
{
Allies.Add(ally);
}

Splitter = allies.Split('.');

foreach (string enemy in Splitter)
{
Enemies.Add(enemy);
}

if (dls.Length > 0 && dls[0] != "")
{
foreach (string dl in dls)
{
if (dl != null && dl.Length > 0)
{
Splitter = dl.Split(':');
DLs.Add(uint.Parse(Splitter[1]), dl);
}
}
}

if (members.Length > 0 && members[0] != "")
{
foreach (string mem in members)
{
if (mem != null && mem.Length > 0)
{
Splitter = mem.Split(':');
Members.Add(uint.Parse(Splitter[1]), mem);
}
}
}
}
}
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }



well...the problem is because of ppl names...not items or skills or things like that


ill try that btw u have an npc to make allies/enemies cuz like i dont get how to do it :/
 
Back