Register for your free account! | Forgot your password?

You last visited: Today at 18:32

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

Advertisement



[CoEmu PlayerCap]

Discussion on [CoEmu PlayerCap] within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2009
Posts: 104
Received Thanks: 7
[CoEmu PlayerCap]

How can I make this work for CoEmu? I want to have a Player Capacity....

Code:
if (World.AllChars.Count > 0)
                {
                  foreach (DictionaryEntry DE in World.AllChars)
                    {
                        Character Char = (Character)DE.Value;
                        Char.MyClient.Drop();
                        return;
                    }
}
1supertao is offline  
Old 08/19/2009, 20:56   #2
 
elite*gold: 20
Join Date: Jul 2007
Posts: 613
Received Thanks: 486
Code:
if (Nano.ClientPool.Count>0)
samehvan is offline  
Old 08/19/2009, 21:00   #3
 
elite*gold: 0
Join Date: Aug 2009
Posts: 104
Received Thanks: 7
Where do i put
if (Nano.ClientPool.Count>0)
1supertao is offline  
Old 08/19/2009, 21:02   #4
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
I just don't see why people won't cap the pool itself, like:

Quote:
public static Dictionary<int, ClientSocket> ClientPool = new Dictionary<int, ClientSocket>(100); // 100 being the limit

case 1052:
Quote:
try
{
Monitor.Enter(Nano.ClientPool);
Nano.ClientPool.Add(CSocket.Client.ID, CSocket);
//}
}
catch(Exception e)
{
CSocket.Disconnect();
Console.WriteLine(e.ToString());
}

Just added 3 letters and one line, voila.
_Emme_ is offline  
Old 08/19/2009, 21:31   #5
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,000
Actually emme... that is incorrect. Look at the following example, it will work just fine.
PHP Code:
Dictionary<uintuintUintPool = new Dictionary<uintuint>(10);
for (
uint i 01000i++)
{
      
UintPool.Add(i10);

The integer parameter passed to constructor is just the initial size, it will allocate more space in the array it uses.


PHP Code:
const int PLAYER_LIMIT 200;
if(
Nano.ClientPool.Count PLAYER_LIMIT) {
    
CSocket.Disconnect();

That code would be more correct. Ofcourse it won't work if you just copy paste it so figure out it yourself. ( I don't have CoEmu V2 on my computer, can't help more. )
tanelipe is offline  
Old 08/19/2009, 21:35   #6
 
elite*gold: 0
Join Date: Aug 2009
Posts: 104
Received Thanks: 7
still not understanding any of this
1supertao is offline  
Old 08/19/2009, 23:38   #7
 
elite*gold: 0
Join Date: Jun 2009
Posts: 787
Received Thanks: 314
Quote:
Originally Posted by 1supertao View Post
still not understanding any of this
Then you should probably learn to code before asking for help you won't understand?
_tao4229_ is offline  
Old 08/20/2009, 00:02   #8
 
elite*gold: 0
Join Date: Aug 2009
Posts: 104
Received Thanks: 7
ya thats true... but ya... i got it...
1supertao is offline  
Old 08/20/2009, 03:36   #9
 
felipeboladao's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 255
Received Thanks: 273
then make a better type of Packet WrongPass ..
To tell the This Server Full '

Sorry for my Englesh'
felipeboladao is offline  
Old 08/20/2009, 03:46   #10


 
CptSky's Avatar
 
elite*gold: 0
Join Date: Jan 2008
Posts: 1,434
Received Thanks: 1,147
Quote:
Originally Posted by felipeboladao View Post
then make a better type of Packet WrongPass ..
To tell the This Server Full '

Sorry for my Englesh'
Just send a message's packet on the channel 2101 and drop the connection...
LOTF Exemple:
Code:
SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "Le serveur est complet!", 2101));
ListenSock.WinSock.Close();
ListenSock = null;
CptSky is offline  
Reply


Similar Threads Similar Threads
[RELEASE] PlayerCap[LOTF]
07/22/2009 - CO2 PServer Guides & Releases - 16 Replies
Well this code is to add a player cap if ur source isnt stable or so on but eh its ok Search for public void GamePacketHandler(object Sender, HybridSocket Socket) Under { try { Add this
[Help] CoEmu
06/02/2009 - CO2 Private Server - 0 Replies
Help comands for PM charakter dont vork
i need help in CoEmu v2
05/29/2009 - CO2 Private Server - 2 Replies
i need backup for all thing fixd in CoEmu v2 cq_actions for COEMU v2 CoEmu v2 Character Creation Page LadyLuck in Prize room request for leaving Birth Village CoEmu V2 5095 Skills V5095 Client For The New Source Release! Fix the ShopMall in Coemu Source Cup Awards / CoEmuV2 MAKE SCROLLS WORK CoEmuV2 Talisman in Coemu V2 Source
How do I edit the PlayerCap?
04/17/2009 - CO2 Private Server - 7 Replies
Its at 30 :/ I want it 100. We can support it and I don't care if its stable or not. "LOTF" Yes I know it fails.



All times are GMT +2. The time now is 18:32.


Powered by vBulletin®
Copyright ©2000 - 2024, 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 ©2024 elitepvpers All Rights Reserved.