Register for your free account! | Forgot your password?

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

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

Advertisement



[Request] So that only a certain amount of people can join your server.

Discussion on [Request] So that only a certain amount of people can join your server. within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
justprownage's Avatar
 
elite*gold: 0
Join Date: May 2008
Posts: 203
Received Thanks: 87
[Request] So that only a certain amount of people can join your server.

Can someone help me make it so that only a certain # of people can join my server? Is there a way to make it work for LOTF?
justprownage is offline  
Old 12/19/2008, 04:11   #2
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
Do you mean a player cap? Or do you mean a certain number of accounts registered?
Either one isn't that hard..
tao4229 is offline  
Old 12/19/2008, 08:26   #3
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
Code:
 if (World.AllChars.Count == 70)
                                        {
                                            Console.WriteLine("Server is now full last space = " + MyChar.Name);
                                            World.SendMsgToAll(MyChar.Name + " Got the last space The Server is now full", "SYSTEM", 2011);
                                        }

                                        if (World.AllChars.Count >= 71)
                                        {
                                            SendPacket(General.MyPackets.SendMsg(MessageId, "SYSTEM", MyChar.Name, "The server is full please try later", 2000));
                                            Console.WriteLine(MyChar.Name + " Attempted to login server full");
                                            MyChar.MyClient.Drop();
                                        }
EDIT : 70 players is just an example you could change that if you like to ^^
turk55 is offline  
Old 12/19/2008, 08:39   #4
 
felipeboladao's Avatar
 
elite*gold: 0
Join Date: Jul 2007
Posts: 255
Received Thanks: 273
Max Players On Code ;D

My Code To Max Players On ..

Code:
public void AuthPacketHandler(object Sender, HybridSocket Socket)
        {
            try
            {
                Socket Sock = Socket.WinSock;
                IPEndPoint IPE = (IPEndPoint)Sock.RemoteEndPoint;
                string Ip = Convert.ToString(IPE.Address);
                int Port = IPE.Port;

                byte[] Data = Socket.Packet;

                AuthBinder AB = (AuthBinder)AuthServerClients[Ip + ":" + Port];
                Client TheClient = AB.Client;

                if (Data.Length == 52)
                    TheClient.Crypto.Decrypt(ref Data);

                if (Data[0] == 0x34 && Data[1] == 0x00 && Data[2] == 0x1b && Data[3] == 0x04)
                {
                    try
                    {
                        int read = 0x04;
                        string ThisAcc = "";
                        string ThisPass = "";

                        while (read < 0x14 && Data[read] != 0x00)
                        {
                            ThisAcc += Convert.ToChar(Data[read]);
                            read += 1;
                        }
                        [COLOR="Red"]if (World.AllChars.Count <= 130)[/COLOR]

                        read = 0x14;

                        while (read < 36 && Data[read] != 0)
                        {
                            ThisPass += (Convert.ToString(Data[read], 16)).PadLeft(2, '0');
                            read += 1;
                        }

                        byte Auth = DataBase.Authenticate(ThisAcc, ThisPass);

                        if (Auth != 0)
                        {
                            General.WriteLine("Account: " + ThisAcc + " IP: " + Ip);
                            AB.Auth = Auth;
                            AB.Acc = ThisAcc;
                            AB.Client.Account = ThisAcc;

                            ulong TheKeys = (uint)(Rand.Next(0x98968) << 32);
                            TheKeys = TheKeys << 32;
                            TheKeys = (uint)(TheKeys | (uint)Rand.Next(10000000));

                            KeyClients.Add(TheKeys, AB);

                            byte[] Key1 = new byte[4];
                            byte[] Key2 = new byte[4];

                            Key1[0] = (byte)((ulong)(TheKeys & 0xff00000000000000L) >> 56);
                            Key1[1] = (byte)((TheKeys & 0xff000000000000) >> 48);
                            Key1[2] = (byte)((TheKeys & 0xff0000000000) >> 40);
                            Key1[3] = (byte)((TheKeys & 0xff00000000) >> 32);
                            Key2[0] = (byte)((TheKeys & 0xff000000) >> 24);
                            Key2[1] = (byte)((TheKeys & 0xff0000) >> 16);
                            Key2[2] = (byte)((TheKeys & 0xff00) >> 8);
                            Key2[3] = (byte)(TheKeys & 0xff);

                            try
                            {
                                byte[] Pack = MyPackets.AuthResponse(ServerIP, Key1, Key2);
                                TheClient.Crypto.Encrypt(ref Pack);
                                Sock.Send(Pack);

                                byte[] Pack1 = MyPackets.AuthResponse(ServerIP2, Key1, Key2);
                                TheClient.Crypto.Encrypt(ref Pack);
                                Sock.Send(Pack);
                            }
                            catch { }

                            Socket.Disconnect();
                            AuthServerClients.Remove(Ip + ":" + Port);
                        }
                        else
                        {
                            TheClient.SendPacket(General.MyPackets.SendMsg(TheClient.MessageId, "SYSTEM", "ALLUSERS", "Wrong username or password! Try Again!", 2101));
                            Socket.Disconnect();
                            AuthServerClients.Remove(Ip + ":" + Port);
                        }
                    }
                    catch (Exception Exc) { WriteLine(Convert.ToString(Exc)); }
                }
            }
            catch (Exception Exc) { WriteLine(Exc.ToString()); }
        }
felipeboladao is offline  
Old 12/19/2008, 09:13   #5
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
Quote:
Originally Posted by felipeboladao View Post
My Code To Max Players On ..

Code:
public void AuthPacketHandler(object Sender, HybridSocket Socket)
        {
            try
            {
                Socket Sock = Socket.WinSock;
                IPEndPoint IPE = (IPEndPoint)Sock.RemoteEndPoint;
                string Ip = Convert.ToString(IPE.Address);
                int Port = IPE.Port;

                byte[] Data = Socket.Packet;

                AuthBinder AB = (AuthBinder)AuthServerClients[Ip + ":" + Port];
                Client TheClient = AB.Client;

                if (Data.Length == 52)
                    TheClient.Crypto.Decrypt(ref Data);

                if (Data[0] == 0x34 && Data[1] == 0x00 && Data[2] == 0x1b && Data[3] == 0x04)
                {
                    try
                    {
                        int read = 0x04;
                        string ThisAcc = "";
                        string ThisPass = "";

                        while (read < 0x14 && Data[read] != 0x00)
                        {
                            ThisAcc += Convert.ToChar(Data[read]);
                            read += 1;
                        }
                        [COLOR="Red"]if (World.AllChars.Count <= 130)[/COLOR]

                        read = 0x14;

                        while (read < 36 && Data[read] != 0)
                        {
                            ThisPass += (Convert.ToString(Data[read], 16)).PadLeft(2, '0');
                            read += 1;
                        }

                        byte Auth = DataBase.Authenticate(ThisAcc, ThisPass);

                        if (Auth != 0)
                        {
                            General.WriteLine("Account: " + ThisAcc + " IP: " + Ip);
                            AB.Auth = Auth;
                            AB.Acc = ThisAcc;
                            AB.Client.Account = ThisAcc;

                            ulong TheKeys = (uint)(Rand.Next(0x98968) << 32);
                            TheKeys = TheKeys << 32;
                            TheKeys = (uint)(TheKeys | (uint)Rand.Next(10000000));

                            KeyClients.Add(TheKeys, AB);

                            byte[] Key1 = new byte[4];
                            byte[] Key2 = new byte[4];

                            Key1[0] = (byte)((ulong)(TheKeys & 0xff00000000000000L) >> 56);
                            Key1[1] = (byte)((TheKeys & 0xff000000000000) >> 48);
                            Key1[2] = (byte)((TheKeys & 0xff0000000000) >> 40);
                            Key1[3] = (byte)((TheKeys & 0xff00000000) >> 32);
                            Key2[0] = (byte)((TheKeys & 0xff000000) >> 24);
                            Key2[1] = (byte)((TheKeys & 0xff0000) >> 16);
                            Key2[2] = (byte)((TheKeys & 0xff00) >> 8);
                            Key2[3] = (byte)(TheKeys & 0xff);

                            try
                            {
                                byte[] Pack = MyPackets.AuthResponse(ServerIP, Key1, Key2);
                                TheClient.Crypto.Encrypt(ref Pack);
                                Sock.Send(Pack);

                                byte[] Pack1 = MyPackets.AuthResponse(ServerIP2, Key1, Key2);
                                TheClient.Crypto.Encrypt(ref Pack);
                                Sock.Send(Pack);
                            }
                            catch { }

                            Socket.Disconnect();
                            AuthServerClients.Remove(Ip + ":" + Port);
                        }
                        else
                        {
                            TheClient.SendPacket(General.MyPackets.SendMsg(TheClient.MessageId, "SYSTEM", "ALLUSERS", "Wrong username or password! Try Again!", 2101));
                            Socket.Disconnect();
                            AuthServerClients.Remove(Ip + ":" + Port);
                        }
                    }
                    catch (Exception Exc) { WriteLine(Convert.ToString(Exc)); }
                }
            }
            catch (Exception Exc) { WriteLine(Exc.ToString()); }
        }
i bet mine is less space lol
turk55 is offline  
Old 12/19/2008, 10:49   #6
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
I did post this in another thread, but just as turk55 got from KinshiCO source, lol. Copy+Paste ftw huh?

anyways, this is how you do it:
Search for the login text of the server, probably under Main() ****. Add a bool,
if (!World.AllChar.Count >= AMOUNT OF PLAYER)
{
Rest of the code here, e.g send packets to surrond players/you, etc etc
}

If you want the player's client to give a message before logging in, like instead of "Currupted blabla" it can say "Server is full" , I also posted that. Use search funcion.


Goodluck
_Emme_ is offline  
Old 12/19/2008, 11:09   #7
 
elite*gold: 0
Join Date: Feb 2008
Posts: 668
Received Thanks: 160
How to send a Error message? Like when the server is offline, You get a message that the server is undegoing a Servermaintenance or something,
YukiXian is offline  
Old 12/19/2008, 11:19   #8
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
I posted it in a thread.
_Emme_ is offline  
Old 12/19/2008, 12:45   #9
 
elite*gold: 0
Join Date: Feb 2008
Posts: 668
Received Thanks: 160
Quote:
Originally Posted by EmmeTheCoder View Post
I posted it in a thread.
Where? You'f got a link?
YukiXian is offline  
Old 12/19/2008, 13:07   #10
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
Nope, cant remember which thread, =P
_Emme_ is offline  
Old 12/19/2008, 13:50   #11
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
Quote:
Originally Posted by EmmeTheCoder View Post
I did post this in another thread, but just as turk55 got from KinshiCO source, lol. Copy+Paste ftw huh?

hell no i didnt got it from kinshico source, i just remembered ure treath about it >_>
i added that into the source im using now and copy+paste it then ffs....
turk55 is offline  
Old 12/19/2008, 14:06   #12
 
_Emme_'s Avatar
 
elite*gold: 1142
Join Date: Aug 2006
Posts: 2,464
Received Thanks: 1,161
Ohh yeah, thats mine, forgot, looks simular to kinshi's one, either he took mine or I made a similuar to his. LOL!
_Emme_ is offline  
Old 12/19/2008, 22:19   #13
 
elite*gold: 0
Join Date: Feb 2008
Posts: 1,590
Received Thanks: 154
Quote:
Originally Posted by YukiXian View Post
How to send a Error message? Like when the server is offline, You get a message that the server is undegoing a Servermaintenance or something,
It's a chat type, but you can only send it before the client sets location(before the client loads the map and ****).

Chattype 0x835 or 2101.(0x835 is 2101 in hex)
tao4229 is offline  
Old 12/20/2008, 12:42   #14


 
Korvacs's Avatar
 
elite*gold: 20
Join Date: Mar 2006
Posts: 6,125
Received Thanks: 2,518
Why do people come up with idiotic ways of doing things, in your connection class there will be an array of active connections, CAP THE ARRAY >_>
Korvacs is offline  
Old 12/20/2008, 15:05   #15
 
elite*gold: 20
Join Date: Aug 2005
Posts: 1,734
Received Thanks: 1,000
They wouldn't know this because they're using infs socket system so copy+paste ftw again.
tanelipe is offline  
Reply


Similar Threads Similar Threads
Why people doesn't join Pservers .. ?
12/20/2009 - EO PServer Hosting - 19 Replies
Why people doesn't join Pservers .. ? There is an something like 15 k players .. at TQ Rank Server Players 1 LA/LasVegas 4984 2 Toronto/Sydney 3655 3 NewYork 3137 4 London 2667 5 Birmingham 952
[New]Server is Up Join Today the 2 first People get 10K free nx!StarMS!
08/03/2009 - MapleStory - 4 Replies
http://hotstepdancers.ho.funpic.de/StarMs%20BAnner .jpg The first 2 people who playing at my server will get 10K Nx cash! What is different with other servers? Good Website Online Support! Another Npcs Many Events
[Request]how to let other people join
06/10/2009 - CO2 Private Server - 2 Replies
im having trouble letting other people join =[ what ports should i portforward and what ips should i put in packetprocessor
[help] Other people cant join my server
09/05/2008 - EO PServer Hosting - 13 Replies
For some reason other people cannot join my server. And my register page isnt working, but that isnt as important right now. So..any suggestions?
Come On People Join My Server.
04/18/2008 - EO PServer Hosting - 42 Replies
hello everyone...i think you have heard abou DarkDevilEO server...so if you want to join come here DarkDevilEO | ... The drop rates are so high that in cata 1 monster drops 1 card EOCARD 270 which contains 300 eps... Xp rates are normal... Compsing rates are Higher Than Usual...at 80* increses about 20-30 points... ------------------------------------------------- ---------------------------- Please Come And Join...:D:p



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


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.