Register for your free account! | Forgot your password?

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

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

Advertisement



How to stop people from spamming marriage

Discussion on How to stop people from spamming marriage within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Jul 2013
Posts: 37
Received Thanks: 2
How to stop people from spamming marriage

This is the code i'm currently using. You can send out invites to several chars and press ''Marry'' on all chars and it will have marriage to all the chars. Where can i put another check to make it stop being able to marry more than 1 char?

PHP Code:
 public class Marriage
    
{
        public static 
void Handle(Main.GameClient GCbyte[] Data)
        {
            
uint AttackType BitConverter.ToUInt32(Data20);

            if (
AttackType == 8)
            {
                
uint TargetUID BitConverter.ToUInt32(Data12);
                
Game.Character TargetMarry null;

                if (
Game.World.H_Chars.ContainsKey(TargetUID))
                    
TargetMarry Game.World.H_Chars[TargetUID];
                if (
TargetMarry == null)
                    return;

                if (
GC.MyChar.Spouse != "None" && GC.MyChar.Spouse != " " && GC.MyChar.Spouse != "")
                {
                    
GC.LocalMessage(2005"You are married."); return;
                }
                if (
TargetMarry.Spouse != "None" && TargetMarry.Spouse != " " && TargetMarry.Spouse != "")
                {
                    
GC.LocalMessage(2005"The target is married."); return;
                }
                if ((
TargetMarry.Body == 1003 || TargetMarry.Body == 1004) && (GC.MyChar.Body == 1003 || GC.MyChar.Body == 1004))
                {
                    
GC.LocalMessage(2005"No male and male marriage is permited!"); return;
                }
                if ((
TargetMarry.Body == 2001 || TargetMarry.Body == 2002) && (GC.MyChar.Body == 2001 || GC.MyChar.Body == 2002))
                {
                    
GC.LocalMessage(2005"No female and female marriage is permited!"); return;
                }

                
TargetMarry.MyClient.AddSend(Packets.AttackPacket(GC.MyChar.EntityIDTargetMarry.EntityIDTargetMarry.Loc.XTargetMarry.Loc.Y08));
            }
            else if (
AttackType == 9)
            {
            
                
uint TargetUID BitConverter.ToUInt32(Data12);
                
Game.Character TargetMarry null;
               
                if (
Game.World.H_Chars.ContainsKey(TargetUID))
                    
TargetMarry Game.World.H_Chars[TargetUID];
              
                
TargetMarry.Spouse GC.MyChar.Name;
                    
GC.MyChar.Spouse TargetMarry.Name;
                
TargetMarry.MyClient.AddSend(Packets.String(TargetMarry.EntityID6TargetMarry.Spouse));
                
GC.AddSend(Packets.String(GC.MyChar.EntityID6GC.MyChar.Spouse));
               
                
Database.SaveCharacter(TargetMarryTargetMarry.MyClient.AuthInfo.Account);
                
Database.SaveCharacter(GC.MyCharGC.AuthInfo.Account);
                if (
GC.MyChar.Body == 1003 || GC.MyChar.Body == 1004)
                    
Game.World.SendMsgToAll("SYSTEM"GC.MyChar.Name " and " TargetMarry.Name " are married now."20050);
                else
                    
Game.World.SendMsgToAll("SYSTEM"TargetMarry.Name " and " GC.MyChar.Name " are married now."20050);
            }
        }
    }

~OwnageBoy is offline  
Old 01/07/2018, 10:52   #2
 
boDil's Avatar
 
elite*gold: 0
Join Date: Apr 2017
Posts: 91
Received Thanks: 56
First of all, this code is really ******* terrible. I have no idea what source this is, but it seems to be a really ****** one from what I can see. I would advise deleting it from your computer, but that's just me.

Secondly, if you can't even figure out something as simple as this, I mean, the code (however ****** it may be) for checking if the people are married is already there. Then you shouldn't be attempting to run a private server.

I'll give you a hint, though: Add the "are these people already married?" check to the "accept marriage" part ...

That's as far as my spoon reaches.
boDil is offline  
Thanks
1 User
Old 01/07/2018, 10:56   #3
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
This was the first issue I ever debugged... with 2-3 hours of programming experience.
You should try fixing it yourself instead of requesting people spoon feed you answers.
Spirited is offline  
Old 01/08/2018, 02:28   #4
 
elite*gold: 0
Join Date: Jul 2013
Posts: 37
Received Thanks: 2
Just as I thought. Great answers, happy new year anyway

Edit: Thanks for the hint boDil. Problem solved
~OwnageBoy is offline  
Old 01/08/2018, 08:11   #5
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
Quote:
Originally Posted by ~OwnageBoy View Post
Just as I thought. Great answers, happy new year anyway

Edit: Thanks for the hint boDil. Problem solved
Can you post how you solved this? Because there's already a check for it, it's just a broken check. I mean, it's completely up to you if you'd like to share, but it's good to check with other programmers. You shouldn't duplicate logic if you can help it.
Spirited is offline  
Old 01/08/2018, 12:13   #6


 
KraHen's Avatar
 
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
Homophobic code.
KraHen is offline  
Old 01/09/2018, 15:21   #7
 
elite*gold: 0
Join Date: Jul 2013
Posts: 37
Received Thanks: 2
Quote:
Originally Posted by Spirited View Post
Can you post how you solved this? Because there's already a check for it, it's just a broken check. I mean, it's completely up to you if you'd like to share, but it's good to check with other programmers. You shouldn't duplicate logic if you can help it.
I added the missing check just as he said. I'm suppose to post it again so you can come up with a nice way to joke again? elitepvpers ftw
~OwnageBoy is offline  
Old 01/09/2018, 17:08   #8
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
Quote:
Originally Posted by ~OwnageBoy View Post
I added the missing check just as he said. I'm suppose to post it again so you can come up with a nice way to joke again? elitepvpers ftw
If you can't recognize a good gesture when you see it, then fine.
Spirited is offline  
Old 01/09/2018, 18:24   #9
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
Quote:
Originally Posted by ~OwnageBoy View Post
I added the missing check just as he said. I'm suppose to post it again so you can come up with a nice way to joke again? elitepvpers ftw
We already know that you code for ****, Spririted actually wanted to give you feedback unlike many others.
turk55 is offline  
Old 01/12/2018, 14:57   #10
 
elite*gold: 0
Join Date: Jul 2013
Posts: 37
Received Thanks: 2
Quote:
Originally Posted by turk55 View Post
We already know that you code for ****, Spririted actually wanted to give you feedback unlike many others.
I code for ****? Well then I got full bags of ****. Anything else?
~OwnageBoy is offline  
Old 01/13/2018, 11:04   #11
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
Quote:
Originally Posted by ~OwnageBoy View Post
I code for ****? Well then I got full bags of ****. Anything else?
Are you proud of your achievements so far? And why?
turk55 is offline  
Old 01/14/2018, 06:11   #12
 
elite*gold: 0
Join Date: Jul 2013
Posts: 37
Received Thanks: 2
I am pretty proud... i just layed a 20 courig **** and wrote a 20 hour code and got a pheasant to spawn in twin city.
~OwnageBoy is offline  
Old 01/14/2018, 21:22   #13
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
Quote:
Originally Posted by ~OwnageBoy View Post
I am pretty proud... i just layed a 20 courig **** and wrote a 20 hour code and got a pheasant to spawn in twin city.
OMG! That is so amazing! You only did it in 20 hours!!!
turk55 is offline  
Old 01/15/2018, 04:23   #14
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
Quote:
Originally Posted by turk55 View Post
OMG! That is so amazing! You only did it in 20 hours!!!
Hey, if he's programming on his own, I'm for that. He just needs more practice before doing more with servers.
Spirited is offline  
Old 01/15/2018, 09:20   #15
 
turk55's Avatar
 
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
Quote:
Originally Posted by Spirited View Post
Hey, if he's programming on his own, I'm for that. He just needs more practice before doing more with servers.
Sure, however he is already running a private server.
turk55 is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Non Stop Non Stop 24/7] For Ever Free MM Service [Non Stop 24/7]
01/10/2012 - Middleman - 38 Replies
ch möchte hier meine Dienste als Middleman anbieten. Deutsch ✔] Telefon Verifizierung ✔] Seit 3 Monaten registriert ✔] Mehr als 300 Posts ✔] Mind. 10 TBM-Bewertungen ✔] Kein negatives Rating Welchen Service biete ich an?
STOP SPAMMING IDIOTS.
10/11/2009 - Grand Chase - 2 Replies
I KNOW I KNOW . JUST SAYING STOP SPAMMING. THREAD CLOSED
Stop people from hitting multiple stakes in TG/Stop weapon skill
12/06/2007 - CO2 Exploits, Hacks & Tools - 21 Replies
Let me start off by saying this is a pretty dirty trick! But if you really don't like someone you can stop them from getting their max exp in TG. Explained: When someone uses a club/wand/FOH/etc in TG, it hits multiple stakes. You can make it so it doesn't hit a certain stake(s). This is easiest achieved by using the #alone feature in proxy. Use the #alone feature and stack on top of the stake you wish for the person not to hit. That's it! Their skill isn't hitting the stake(s) for some...



All times are GMT +2. The time now is 00:21.


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.