Register for your free account! | Forgot your password?

Go Back   elitepvpers > MMORPGs > Conquer Online 2 > CO2 Private Server
You last visited: Today at 15:52

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

Advertisement



[Problem] Friend Check,

Discussion on [Problem] Friend Check, within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
Friend Packet ?

##Close
-Shunsui- is offline  
Old 09/04/2010, 00:03   #2


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Tried debugging and stepping through it?
Korvacs is offline  
Old 09/04/2010, 00:11   #3
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
Loop through the dictionary of friends and check and see if they're in Kernel.GamePool instead.
_tao4229_ is offline  
Old 09/04/2010, 00:15   #4


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
Well, ive noticed a few things, FriendsUID <--- is a ushort? The dictionary is a uint, seems to me that the FriendsUID cannot be the same thing as client.Entity.UID.
Korvacs is offline  
Thanks
1 User
Old 09/04/2010, 00:26   #5
 
_DreadNought_'s Avatar
 
elite*gold: 28
Join Date: Jun 2010
Posts: 2,225
Received Thanks: 868
I would of done it kinda like well 2 ways
Code:
foreach (Client.GameState aFriend in Kernel.GamePool.Values)
                                        {
                                                Console.WriteLine(client.Entity.UID + " " + client.Entity.Name + " <- Clients Info .. Friends info - > " + aFriend.Entity.UID + " " + aFriend.Entity.Name);
                                                if (client.Entity.Friends.ContainsKey(afriend.Entity.UID))
                                                {
                                                    Console.WriteLine("Has Friend Online");
                                                }
                                        }
^ Wont work either, but im tired Tao's way is more efficent.
_DreadNought_ is offline  
Old 09/04/2010, 00:59   #6
 
ImmuneOne's Avatar
 
elite*gold: 0
Join Date: Nov 2009
Posts: 754
Received Thanks: 544
Quote:
Originally Posted by -Shunsui- View Post
huh ? and no cant check the client u need to check every person in the game that has the client (wich is the one login in ) as a friend,

But anyways, tnx guys i got it
Code:
LoadFriends(caller);
caller.FriendManagement.SendCollection(caller);


Class:
public Friends
{
    private Dictionary<uint, FriendPacket> friendsCollection;
    public Friends()
    { 
        friendsCollection = new Dictionary<uint, FriendPacket>();
    }
    
    public void Insert(uint friendID, FriendPacket friend)
    { 
        if (!friendsCollection.Containskey(friendID))
           friendsCollection.Add(friendID, friend);
        else
           friendsCollection[friendID] = friend;
    }

    public void Remove(uint friendID)
    {
        if (friendsCollection.Containskey(friendID))
           friendsCollection.Remove(friendID);
    }
    
    public void SendCollection(ConquerClient caller)
    {
        foreach (KeyValuePair<uint, FriendPacket> entry in Collection)
        {
            entry.Value.Online = Kernel.GamePool.Containskey(entry.Key);
            caller.WinsockClient.Send(&entry.Value, Marshal.SizeOf(entry.Value));
            if (entry.Value.Online)
               caller.WinsockClient[entry.Key].Send(&caller.FriendPacket, Marshal.SizeOf(caller.FriendPacket));
        }
    }
}
ImmuneOne is offline  
Old 09/04/2010, 06:43   #7
 
-Shunsui-'s Avatar
 
elite*gold: 0
Join Date: Apr 2008
Posts: 1,152
Received Thanks: 321
Reusing !
-Shunsui- is offline  
Reply


Similar Threads Similar Threads
[WTT]No CRC check and gg bypass for dekaron eu and no crc check for 2moons
10/18/2008 - Dekaron Trading - 1 Replies
Look at the title:rolleyes: I wanna trade it for 50mill on dekaron eu. just add me to msn for proofs [email protected]
Password check problem
09/01/2007 - Lineage 2 - 2 Replies
On the private server i play on the validation of your account/password is checked after you choose your server. This way walker always give this error when you try to login: 16:58:19 Now we will use local verification:o) 16:58:19 Enjoy! 16:58:19 Link LoginServer Succeed. 16:58:22 Login LoginServer Success. 16:58:22 服务器当前在&# 32447;率:1.66%,能否登ƀ 70;:能 16:58:25 Password does not match this account. Confirm your account information and log in again later. 16:58:25 ->Login LoginServer Fail.



All times are GMT +1. The time now is 15:57.


Powered by vBulletin®
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2025 elitepvpers All Rights Reserved.