Register for your free account! | Forgot your password?

You last visited: Today at 16:44

  • Please register to post and access all features, it's quick, easy and FREE!

 

Release: How to fix guilds and friends.

Closed Thread
 
Old   #1
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
Release: How to fix guilds and friends.

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...



alexbigfoot is offline  
Thanks
31 Users
Old   #2
 
elite*gold: 0
Join Date: Jul 2007
Posts: 442
Received Thanks: 104
wow nice


plasma-hand is offline  
Old   #3
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
1 would be enough.... XD :P
alexbigfoot is offline  
Old   #4
 
elite*gold: 0
Join Date: Feb 2008
Posts: 668
Received Thanks: 160
Nice Guides you made there


YukiXian is offline  
Old   #5
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
thanx
alexbigfoot is offline  
Old   #6
 
elite*gold: 0
Join Date: May 2006
Posts: 170
Received Thanks: 8
man in my database.cs i cant find this

Quote:
public static void RemoveFromFriend(uint RemoverUID, uint RemovedUID)
The_Real_Slim_Shady is offline  
Old   #7
 
elite*gold: 0
Join Date: Mar 2008
Posts: 62
Received Thanks: 6
hey cant any1 hel me
catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
i got one erro
pegaeu is offline  
Old   #8
 
elite*gold: 0
Join Date: Dec 2007
Posts: 618
Received Thanks: 213
The_Real_Slim_Shady - You are using PowerSourceCo Version???
alexbigfoot is offline  
Old   #9
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Thanks for the guide +thanks =) Just a note:
Code:
            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
where you see this... make it this:
Code:
            }
            catch (Exception Exc) { General.WriteLine(Convert.ToString(Exc)); }
           }
this will prevent errors when rebuilding the source.
taguro is offline  
Thanks
1 User
Old   #10
 
elite*gold: 20
Join Date: Jan 2008
Posts: 2,012
Received Thanks: 2,871
String parsing / processing in C# = Super Slow, Avoid it (PS:, unneccicary try/catches slow down your server too).
InfamousNoone is offline  
Old   #11
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 153
Or you could just prevent the server from allowing people to have
'~' 's in their names.. It looks like now if they have a '.' in there name it will do the same thing..

Although I didn't take the time to read the whole thing..
tao4229 is offline  
Old   #12
 
elite*gold: 0
Join Date: May 2006
Posts: 170
Received Thanks: 8
Quote:
The_Real_Slim_Shady - You are using PowerSourceCo Version???
yes i m
The_Real_Slim_Shady is offline  
Old   #13
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Quote:
Originally Posted by tao4229 View Post
Or you could just prevent the server from allowing people to have
'~' 's in their names.. It looks like now if they have a '.' in there name it will do the same thing..

Although I didn't take the time to read the whole thing..
Registration prevents players from using periods in their username and their character name, so this is a pretty safe alternative.
taguro is offline  
Old   #14
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 153
Quote:
Originally Posted by taguro View Post
Registration prevents players from using periods in their username and their character name, so this is a pretty safe alternative.
Oh, didn't pay attention to that. D= Never tried making a char with a '.'

I retract my statement.
tao4229 is offline  
Old   #15
 
elite*gold: 0
Join Date: Jun 2007
Posts: 387
Received Thanks: 64
Quote:
Originally Posted by tao4229 View Post
Oh, didn't pay attention to that. D= Never tried making a char with a '.'

I retract my statement.
No worries m8, thats why were here, to help others and to learn.


taguro is offline  
Closed Thread



« Previous Thread | Next Thread »

Similar Threads
Guilds-Recruiting Thread (Join/Announce Guilds Here!!)
Guilds-Recruiting === ===== ======= ========= =========== =============
95 Replies - SRO Main - Discussions / Questions
Friends For Sale Cheats-Facebook Friends For Sale Cheats,hack,tips and trickss
How to gain more money in Friend for Sale? Log in every 4 hours ($2,000) and invite up to 20 people a day for $500 each. Invite rock bands to be...
3 Replies - Facebook
Guilds
Ok just a quick question i had jus re-released my Shaiya Private server and i had noticed in game that there were numerous guilds i went an looked in...
2 Replies - Shaiya Private Server
[Request] Guilds, Friends, Marriage, Auto Restart
Hi everyone! I'd like some help fixing my code for these sections. I use PowerSource. I would appreciate any code given, and any explanations...
8 Replies - CO2 PServer - Discussions / Questions



All times are GMT +2. The time now is 16:44.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Abuse
Copyright ©2018 elitepvpers All Rights Reserved.