Register for your free account! | Forgot your password?

You last visited: Today at 16:30

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

Advertisement



[Release] kick strikes

Discussion on [Release] kick strikes within the CO2 PServer Guides & Releases forum part of the CO2 Private Server category.

Reply
 
Old   #1
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
[Release] kick strikes

THIS IS FOR COEMU!

Okay so what this does is Whenever someone gets kicked It will add a strike to that person

In me and pros server you get 3 strikes you get banned automatically

NOTE This is not tested but im pretty confident it works

Also This can be used for various things like i said we use it for automatic ban

I will not be releasing that this is where u the community come in to code that

Anyway here it is

This goes in Chat.cs


Code:
case "kick":
							{
								if(CSocket.Client.isGM || CSocket.Client.isPM)
								{
                                    
									if(Command.Length < 2)
									{
										CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[ERROR] Command example: /kick player", Struct.ChatType.Talk));
										break;
									}
									bool kicked = false;
									//lock(Nano.ClientPool)
									//{
									try
									{
										Monitor.Enter(Nano.ClientPool);
										foreach(KeyValuePair<int, ClientSocket> Player in Nano.ClientPool)
										{
                                            
											if(Player.Value.Client.Name.ToLower() == Command[1].ToLower())
											{
												if(Player.Value.Client.isPM && !CSocket.Client.isPM)
													CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "GMs cannot kick PMs, sorry!", Struct.ChatType.Top));
												else
												{
													ConquerPacket.ToServer(ConquerPacket.Chat(0, "SYSTEM", "ALLUSERS", Player.Value.Client.Name + " has been kicked from the server", Struct.ChatType.Center), 0);
													Player.Value.Disconnect();
													kicked = true;
                                                    Player.Value.Client.KickStrikes += 1;
												}
												break;
											}
										}
									//}
									}
									catch(Exception e)
									{
										Console.WriteLine(e.ToString());
									}
									finally
									{
										Monitor.Exit(Nano.ClientPool);
									}
									if(!kicked)
									{
										CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, "[ERROR] Cannot kick player.", Struct.ChatType.Talk));
									}
								}
								break;
							}

This goes in Character.cs

Code:
public int KickStrikes = 0;

Last but not least This goes in Database.cs

Code:
 public static void Strikes(Character Client)
        {
            MySqlCommand Cmd = new MySqlCommand("UPDATE `characters` SET `Strikes = " +Client.KickStrikes + DatabaseConnection.NewConnection());
            Cmd.ExecuteNonQuery();
            Cmd.Connection.Close();
            Cmd.Connection.Dispose();
            Cmd.Dispose();
        }
Search for GetCharacter in Database.cs and add this at the bottom

Code:
Client.KickStrikes = Convert.ToInt32(DR["Strikes"]);
Now Search for SaveCharacter in Database.cs and add this


Code:
", `Strikes`= " + Client.KickStrikes +
Note this has not been Tested

Also

Edit your character tables According to this

Name:Strikes
Type:int
Length:11
Decimals:0
Not Null

Have Fun And tell me if it doesnt work cause i havent tested it out yet

#edit saved and loaded from db
hunterman01 is offline  
Thanks
3 Users
Old 02/20/2010, 00:44   #2
 
elite*gold: 0
Join Date: Feb 2010
Posts: 480
Received Thanks: 207
Good job Hunter!
Decker_ is offline  
Old 02/20/2010, 00:50   #3
 
elite*gold: 40
Join Date: Feb 2010
Posts: 78
Received Thanks: 17
I think this is awesome
ArtOfWar is offline  
Old 02/20/2010, 00:55   #4
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Its just a way of keeping track of how many times a player gets kicked for this release but the one in Hellmouth we got it to ban ya if u get 3

But with the one i released you can see who the trouble makers are and perhaps ban them yourself
hunterman01 is offline  
Old 02/20/2010, 01:30   #5
 
elite*gold: 0
Join Date: Jan 2009
Posts: 1,922
Received Thanks: 491
You could make this easier on the person who is kicking these people..

make it check lets say

strike += 1;
switch (strike)
{
case 1: You have recieved your first strike
case 2: You have two strikes. One more and you will be banned!
case 3: You are banned from the server.. Sorry Please appeal your ban at the forums! Bye
}
they press okay ( npc or w.e ) and it bans them..if they don't press okay.. do like a 30 second timer.

that way you don't have to check. it will automatically do it )

good release though, if you want a more complete ban system idea just tell me and i will "write"( not code cuz no C# here ) up and give u it..
PeTe Ninja is offline  
Old 02/20/2010, 03:17   #6
 
hunterman01's Avatar
 
elite*gold: 20
Join Date: Dec 2006
Posts: 945
Received Thanks: 175
Quote:
Originally Posted by PeTe Ninja View Post
You could make this easier on the person who is kicking these people..

make it check lets say

strike += 1;
switch (strike)
{
case 1: You have recieved your first strike
case 2: You have two strikes. One more and you will be banned!
case 3: You are banned from the server.. Sorry Please appeal your ban at the forums! Bye
}
they press okay ( npc or w.e ) and it bans them..if they don't press okay.. do like a 30 second timer.

that way you don't have to check. it will automatically do it )

good release though, if you want a more complete ban system idea just tell me and i will "write"( not code cuz no C# here ) up and give u it..
This is just a way for me to see how my players are interacting with my gms
In my code i also put it to where i can see which gm kicked the person This way i can tell if its a staff problem or not

+

I dont like using timers that often makes server laggy
hunterman01 is offline  
Reply


Similar Threads Similar Threads
[Release]Kick Ass CO
02/15/2010 - CO2 PServer Archive - 1 Replies
Hey, well I want to post up our server for testing and for general gaming (but mostly for testing) our server is connected through Hamachi, for now... until we someone show us how to operate it without Hamachi in a very detailed and possibly team viewed way. :P so, about the whole Hamachi thing, the Hamachi network is called New Generation Gaming and the password is 2468 once you've connected to the server you no longer have to Hamachi running, i know it's Strange and confusing, but it...
SWSRO - The Lag Strikes Back
07/20/2009 - SRO Private Server - 27 Replies
What a hell, it's impossible to use skills, fucking lag :mad::mad::mad: :(:(:( :o:o:o :rolleyes::rolleyes::rolleyes:
Ocean the noob scammer strikes again
11/17/2008 - SRO Private Server - 2 Replies
Ocean the scammer strikes again. I bought 1bil 2 weeks ago. And it was on my char. I log onto my account now my char is gone and my account has 1 of my old chars on. Ocean burn you twat. He strikes again.
What's about sweeping strikes?
04/08/2007 - World of Warcraft - 0 Replies
Hey there, try looking at this thread: http://forums.wow-europe.com/thread.html?t...2731 77604&sid=1 Something must be wrong with sweeping strikes? Does anyone know what, 'cause I'd like to know :)



All times are GMT +1. The time now is 16:30.


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