Register for your free account! | Forgot your password?

Go Back   elitepvpers › MMORPGs › Conquer Online 2 › CO2 Private Server
You last visited: Today at 05:06

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

Advertisement



SendScreen Issue

Discussion on SendScreen Issue within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 15
SendScreen Issue

here is my issue , O.o







any help ?
abdeen is offline  
Old   #2
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Objects.Count is probably a method like Objects.Count();

So try Objects.Count()
BaussHacker is offline  
Old   #3
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 15
those cods for friend and enemy , but when you request someone friend and he is accept it , nothing happen.


this in paclethandler.cs

PHP Code:
        #region KnownPersons
        
static void RemoveFriend(KnownPersons knownperson, Client.GameState client)
        {
            if (
client.Friends.ContainsKey(knownperson.UID))
            {
                
Game.ConquerStructures.Society.Friend friend = client.Friends[knownperson.UID];
                if (
friend.IsOnline)
                {
                    
friend.Client.Friends.Remove(client.Entity.UID);
                    
friend.Client.Send(new KnownPersons(true)
                    {
                        
UID = client.Entity.UID,
                        
Type = KnownPersons.RemovePerson,
                        
Name = "",
                        
Online = false
                    
});
                }
                
client.Friends.Remove(friend.ID);
                
client.Send(new KnownPersons(true)
                {
                    
UID = friend.ID,
                    
Type = KnownPersons.RemovePerson,
                    
Name = "",
                    
Online = false
                
});
                
Database.KnownPersons.RemoveFriend(client, friend.ID);
            }
        }
        static 
void RemoveEnemy(KnownPersons knownperson, Client.GameState client)
        {
            if (
client.Enemy.ContainsKey(knownperson.UID))
            {
                
Game.ConquerStructures.Society.Enemy enemy = client.Enemy[knownperson.UID];

                
client.Enemy.Remove(enemy.ID);
                
client.Send(new KnownPersons(true)
                {
                    
UID = enemy.ID,
                    
Type = KnownPersons.RemovePerson,
                    
Name = "",
                    
Online = false
                
});
                
Database.KnownPersons.RemoveEnemy(client, enemy.ID);
            }
        }
        static 
void AddFriend(KnownPersons knownperson, Client.GameState client)
        {
            if (!
client.Friends.ContainsKey(knownperson.UID))
            {
                
Client.GameState Client = ServerBase.Kernel.GamePool[knownperson.UID];
                if (
Client != null)
                {
                    
Client.OnMessageBoxOK = delegate
                    
{
                        if (
client != null)
                        {
                            if (
client.Socket.Connected)
                            {
                                if (!
Client.Friends.ContainsKey(client.Entity.UID))
                                {
                                    
client.Friends.Add(Client.Entity.UID, new Conquer_Online_Server.Game.ConquerStructures.Society.Friend()
                                    {
                                        
ID = Client.Entity.UID,
                                        
Name = Client.Entity.Name
                                    
});
                                    
Client.Friends.Add(client.Entity.UID, new Conquer_Online_Server.Game.ConquerStructures.Society.Friend()
                                    {
                                        
ID = client.Entity.UID,
                                        
Name = client.Entity.Name
                                    
});
                                    
client.Send(new KnownPersons(true)
                                    {
                                        
UID = Client.Entity.UID,
                                        
Type = KnownPersons.AddFriend,
                                        
Name = Client.Entity.Name,
                                        
Online = true
                                    
});
                                    
Client.Send(new KnownPersons(true)
                                    {
                                        
UID = client.Entity.UID,
                                        
Type = KnownPersons.AddFriend,
                                        
Name = client.Entity.Name,
                                        
Online = true
                                    
});
                                    
Database.KnownPersons.AddFriend(client, client.Friends[Client.Entity.UID]);
                                    
client.Screen.SendScreen(new Message(Client.Entity.Name + " has accepted " + client.Entity.Name + "'s friendship request.", System.Drawing.Color.Blue, Message.TopLeft), true);
                                }
                            }
                        }
                    };
                    
Client.OnMessageBoxCANCEL = delegate
                    
{
                        if (
client != null)
                        {
                            if (
client.Socket.Connected)
                            {
                                if (
Client != null)
                                {
                                    if (
Client.Socket.Connected)
                                    {
                                        
client.Send(new Message(Client.Entity.Name + " has rejected your friendship request.", System.Drawing.Color.Blue, Message.TopLeft));
                                    }
                                }
                            }
                        }
                    };
                    
Client.Send(new NpcReply(NpcReply.MessageBox, client.Entity.Name + " wants to be your friend."));
                }
            }
        }
        public static 
void AddEnemy(Client.GameState client, Client.GameState enemy)
        {
            if (!
client.Enemy.ContainsKey(enemy.Entity.UID))
            {
                
client.Enemy.Add(enemy.Entity.UID, new Conquer_Online_Server.Game.ConquerStructures.Society.Enemy()
                {
                    
ID = enemy.Entity.UID,
                    
Name = enemy.Entity.Name
                
});
                
client.Send(new KnownPersons(true)
                {
                    
UID = enemy.Entity.UID,
                    
Type = KnownPersons.AddEnemy,
                    
Name = enemy.Entity.Name,
                    
Online = true
                
});
                
Database.KnownPersons.AddEnemy(client, client.Enemy[enemy.Entity.UID]);
            }
        }

        
#endregion 
this in Screen.cs
PHP Code:
        public void SendScreen(Interfaces.IPacket buffer, bool self)
        {
            for (
int c = 0; c < Objects.Count(); c++)
            {
                
//For a multi threaded application, while we go through the collection
                //the collection might change. We will make sure that we wont go off  
                //the limits with a check.
                
if (c >= Objects.Count())
                    break;
                
Interfaces.IMapObject _obj = Objects[c];
                if (
_obj == null)
                    continue;
                if (
_obj.UID != Owner.Entity.UID)
                {
                    if (
_obj.MapObjType == Game.MapObjectType.Player)
                    {
                        
GameState client = _obj.Owner as GameState;
                        if (
Owner.WatchingGroup != null && client.WatchingGroup == null)
                            continue;
                        
client.Send(buffer);
                    }
                }
            }

            if (
self)
                
Owner.Send(buffer);
        } 
abdeen is offline  
Old   #4
 
elite*gold: 0
Join Date: Feb 2007
Posts: 342
Received Thanks: 38
you can't compare an integer with a void function...you have to compare 2 numbers
ryuchetval is offline  
Thanks
1 User
Old   #5
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 15
Quote:
Originally Posted by ryuchetval View Post
you can't compare an integer with a void function...you have to compare 2 numbers
more explain please
abdeen is offline  
Old   #6
 
elite*gold: 0
Join Date: Sep 2011
Posts: 40
Received Thanks: 8
change this (int c = 0; c < Objects.Count(); c++)
for (int c = 0; c < Objects.Length(); c++)

and if (c >= Objects.Count())
for if (c >= Objects.Length())
DontSpeakToMe is offline  
Thanks
1 User
Old   #7
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 15
Quote:
Originally Posted by DontSpeakToMe View Post
change this (int c = 0; c < Objects.Count(); c++)
for (int c = 0; c < Objects.Length(); c++)

and if (c >= Objects.Count())
for if (c >= Objects.Length())
you see this error ?

abdeen is offline  
Old   #8
 
elite*gold: 0
Join Date: Sep 2011
Posts: 40
Received Thanks: 8
ok then try to change ini for uint
DontSpeakToMe is offline  
Thanks
1 User
Old   #9
 
elite*gold: 0
Join Date: May 2011
Posts: 1,769
Received Thanks: 756
Remove the () in the code.

Just Objects.Length;
BaussHacker is offline  
Thanks
1 User
Old   #10
 
abdeen's Avatar
 
elite*gold: 0
Join Date: Mar 2010
Posts: 475
Received Thanks: 15
Quote:
Originally Posted by BaussHacker View Post
Remove the () in the code.

Just Objects.Length;

thanks , i`ll try
abdeen is offline  
Reply


Similar Threads Similar Threads
KTS issue
06/13/2011 - Rappelz - 7 Replies
NULL
Having an issue
06/18/2010 - Shaiya Private Server - 0 Replies
On the server that I'm hosting, we've followed the tutorials to get the server to EP4 and gotten the server itself to work. All files attatched to SQL correctly (or so it said), using MSSQL 2005 Express. Here's the issue: All of the people who have our game.exe (which is staff only at the moment) who try to log on, make it to the character selection screen. All of their toons are there and able to be selected. However, when they click to start the game, it automatically DC's them. ...
[HELP]Log in issue.
06/13/2010 - EO PServer Hosting - 1 Replies
Hey everyone, i am trying to log into my friend server and it works untill verifying account, then it closes. He is able to log in and he sent me a screenshot, so if anyone has a great idea or way too fix this, message me on MSN or on here or reply, thank you very much
HEY DC ISSUE !!!!
06/15/2007 - Silkroad Online - 7 Replies
i Reinstalled the game and still getting DC ever 5 minutes when i log in game so y the hell is this please need help really 2 days like this !! please help and in specific details would be appreciated " sry if spam " but i cant hodl much longer sry all ... <hr>Append on Jun 14 2007, 12:19<hr> Has to do sth with host or FireWall or Kaspersky !! i don't think so please need fast Solve solution ~!!!



All times are GMT +1. The time now is 05:07.


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

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