Register for your free account! | Forgot your password?

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

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

Advertisement



I need Banning System For 5165

Discussion on I need Banning System For 5165 within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
sohaib's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
I need Banning System For 5165

hi, i have a conquer private server version 5165

i'm asking if there is a banning system( not botjail)

because i already have botjail

i want something who close the account or a command who cut the account file and put it in folder (banned) and another to unban

is it possible?

and i'm asking of ip ban is possible to make it in 5165?


thx
sohaib is offline  
Old   #2
 
elite*gold: 0
Join Date: Sep 2009
Posts: 19
Received Thanks: 0
talk to me in me email
khaled2010s` is offline  
Old   #3
 
elite*gold: 0
Join Date: Oct 2010
Posts: 148
Received Thanks: 57
search for my old account .Summer.

DL the source CoSX wich I released on it.

Take the ban system from it.

Gameworker.cs and Database.cs contains it.
_Vodka is offline  
Old   #4
 
sohaib's Avatar
 
elite*gold: 0
Join Date: Jun 2010
Posts: 258
Received Thanks: 102
okay , i added the required scripts in Database.cs and the script who shows yu have been banned the gameworker.cs , but icouldn't understand the command in chat.cs

Quote:
public static void BANPLAYER(string Name, string by)
{
if (!File.Exists(@"C:\CoSX\Database\Bans\" + Name + ".ban"))
{
FileStream FS = new FileStream(@"C:\CoSX\Database\Bans\" + Name + ".ban", FileMode.CreateNew);
BinaryWriter BW = new BinaryWriter(FS);
BW.Write(Name);
BW.Write(by);
BW.Write("-BanTime: " + DateTime.Now);
BW.Close();
FS.Close();
}
and i got another problem too, i can't download the database so i just created a text file called banname.txt

i tryied to write the username in the banname.txt but it didn't banned,

please explain me how to use the command the if i did every thing right
sohaib is offline  
Old   #5
 
elite*gold: 0
Join Date: Oct 2010
Posts: 148
Received Thanks: 57
Open Gameworker.cs and find:
Code:
                                GC.MessageID = (uint)Rnd.Next(50000);
                                GC.Soc = StO.Sock;
Under it put:
Code:
                                if (GC.AuthInfo.LogonType == 3)
                                {
                                    GC.AddSend(Packets.SystemMessage(GC.MessageID, "You have been banned!"));
                                }
Open database.cs and put:
Code:
        public static bool CheckBan(string Name)
        {
            if (File.Exists(@"C:\OldCODB\banname.txt"))
            {
                string[] Lines = File.ReadAllLines(@"C:\OldCODB\banname.txt");
                foreach (string line in Lines)
                {
                    if (line.Contains(Name))
                        return true;
                }
            }
            return false;
        }
        public static void AddBan(string Name)
        {
            if (!File.Exists(@"C:\OldCODB\banname.txt"))
            {
                File.AppendAllText(@"C:\OldCODB\banname.txt", Name + "\r\n");
            }
            else
            {
                if (!CheckBan(Name))
                {
                    File.AppendAllText(@"C:\OldCODB\banname.txt", Name + "\r\n");
                }
            }
        }
Now find:
Code:
public static Main.AuthWorker.AuthInfo Authenticate(string User, string Password)
replace it with:
Code:
public static Main.AuthWorker.AuthInfo Authenticate(string User, string Password)
        {
            Main.AuthWorker.AuthInfo Info = new NewestCOServer.Main.AuthWorker.AuthInfo();
            Info.Account = User;

            try
            {
                while (File.Exists(@"C:\OldCODB\Users\" + User + ".usr"))
                {
                    FileStream FS = new FileStream(@"C:\OldCODB\Users\" + User + ".usr", FileMode.Open);
                    BinaryReader BR = new BinaryReader(FS);
                    string RealPassword = Main.PassCrypto.EncryptPassword(Encoding.ASCII.GetString(BR.ReadBytes(BR.ReadByte())));
                    string[] FileCaseSensitive = Directory.GetFiles(@"C:\OldCODB\Users\",User + ".usr");
                    string RealAccount = Path.GetFileNameWithoutExtension(FileCaseSensitive[0]);
                    if (RealPassword == Password && RealAccount == User)
                    {
                        Info.Status = Encoding.ASCII.GetString(BR.ReadBytes(BR.ReadByte()));

                        Info.Character = "";
                        if (BR.BaseStream.Position != BR.BaseStream.Length)
                        {
                            byte len = BR.ReadByte();
                            Info.Character = Encoding.ASCII.GetString(BR.ReadBytes(len));
                        }

                        if (Info.Character == "")
                            Info.LogonType = 2;
                        else
                            Info.LogonType = 1;
                        if (CheckBan(RealAccount))
                            Info.LogonType = 3;
                    }
                    else
                        Info.LogonType = 255;
                    BR.Close();
                    FS.Close();

                    return Info;
                }
                Info.LogonType = 255;
            }
            catch (Exception Exc) { Console.WriteLine(Exc); }
            return Info;
        }
Now in chat.cs put this command:
Code:
                        #region ban
                        if (Cmd[0] == "/ban")
                        {
                            foreach (Character C in World.H_Chars.Values)
                            {
                                if (Cmd[1] == C.Name)
                                {
                                        BANPLAYER(C.Name, GC.MyChar.Name);
                                        C.MyClient.Soc.Disconnect(false);
                                        Database.AddBan(C.MyClient.AuthInfo.Account);
                                        C.MyClient.Disconnect();
                                        Game.World.SendMsgToAll(GC.MyChar.Name, C.Name + " have been banned by " + GC.MyChar.Name + "! (An abuse file have been created to check if he abused)", 2011, 0);//Fixed
                                }
                            }
                        }
                        #endregion
Now put in chat.cs put:
Code:
        public static void BANPLAYER(string Name, string by)
        {
            if (!File.Exists(@"C:\OldCODB\Bans\" + Name + ".txt"))
            {
                FileStream FS = new FileStream(@"C:\OldCODB\Bans\" + Name + ".txt", FileMode.CreateNew);
                StreamWriter SW = new StreamWriter(FS);
                SW.WriteLine(Name);
                SW.WriteLine(by);
                SW.WriteLine("BanTime: " + DateTime.Now);
                SW.Close();
                FS.Close();
            }
        }
Now make a folder in OldCODB called Bans.
Then it contains who got banned and who banned them.
Then make a textfile called banname.txt in OldCODB.
Thats where all bans are.
To unban, just remove the name from banname.txt.

Goodluck
_Vodka is offline  
Thanks
1 User
Old   #6
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,791
Received Thanks: 5,310
Wow, yours has a whole bunch of unneeded stuff.
@OP
My advice is use Spare2's ban system. Its very simple and efficient.
Arcо is offline  
Old   #7
 
elite*gold: 0
Join Date: Oct 2010
Posts: 148
Received Thanks: 57
Quote:
Originally Posted by Аrco View Post
Wow, yours has a whole bunch of unneeded stuff.
@OP
My advice is use Spare2's ban system. Its very simple and efficient.
it is that, just some extra stuff. (I think)
such as the banfolder thing to see who bans who.

just took it from an old source.
_Vodka is offline  
Thanks
1 User
Old   #8
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,791
Received Thanks: 5,310
Quote:
Originally Posted by _Vodka View Post
it is that, just some extra stuff. (I think)
such as the banfolder thing to see who bans who.

just took it from an old source.
This one is much simpler and more efficient.

@OP
Arcо is offline  
Old   #9
 
elite*gold: 0
Join Date: Oct 2010
Posts: 148
Received Thanks: 57
Quote:
Originally Posted by Аrco View Post
This one is much simpler and more efficient.

@OP
is exactly same.
I just putted the whobanned/when in.
_Vodka is offline  
Thanks
1 User
Old   #10
 
elite*gold: 0
Join Date: Sep 2010
Posts: 90
Received Thanks: 26
Wow, I went by Spares guide, but I can't find:

if (Game.World.H_Chars.Contains(GC.MyChar.EntityID))

Anywhere.
peterpiper99 is offline  
Old   #11
 
Arcо's Avatar
 
elite*gold: 0
Join Date: Oct 2009
Posts: 8,791
Received Thanks: 5,310
Probably with Game in the reference.
Arcо is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Release] 5165 Warehouses Auth System
04/01/2011 - CO2 PServer Guides & Releases - 18 Replies
this is just a simple Auth system for warehouses. It will ask for password (set from WHGuardian) each time players will open their warehouse. Attempt limit is not included in this release... btw; with this release, warehouseGuardian will now save the password in Character file. here are the screenshots: http://img408.imageshack.us/img408/6986/98867182. jpg Click The Image to see more screen shots 1. Go to NPCDialog.cs and search for this code: public static void...
[Release] Flower System (5165)
09/25/2010 - CO2 PServer Guides & Releases - 71 Replies
Heya! Mostly complete... just figure a way to save it on your server.... ScreenShots: http://img98.imageshack.us/img98/1949/164947279.j pg http://img714.imageshack.us/img714/5372/64922998. jpg http://img59.imageshack.us/img59/1025/64930238.jp g
[RELEASE]Anti bot system 5165
06/15/2010 - CO2 PServer Guides & Releases - 15 Replies
Here is an simple anti bot system. Credits goes to Arco for the npc send thing :) First go to MyThreads.cs and find: interval = Interval; T = new Thread(new ThreadStart(Run)); T.Start();
[question] how to changes system message 5165?
05/17/2010 - CO2 Private Server - 4 Replies
hi guys how to changes system message like this?: http://img40.imageshack.us/img40/175/69485093.jpg
[Release]NPC system 5165 simplified
05/10/2010 - CO2 PServer Guides & Releases - 14 Replies
//



All times are GMT +1. The time now is 04:00.


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.