|
You last visited: Today at 00:21
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.
01/07/2018, 06:45
|
#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 GC, byte[] Data) { uint AttackType = BitConverter.ToUInt32(Data, 20);
if (AttackType == 8) { uint TargetUID = BitConverter.ToUInt32(Data, 12); 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.EntityID, TargetMarry.EntityID, TargetMarry.Loc.X, TargetMarry.Loc.Y, 0, 8)); } else if (AttackType == 9) { uint TargetUID = BitConverter.ToUInt32(Data, 12); 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.EntityID, 6, TargetMarry.Spouse)); GC.AddSend(Packets.String(GC.MyChar.EntityID, 6, GC.MyChar.Spouse)); Database.SaveCharacter(TargetMarry, TargetMarry.MyClient.AuthInfo.Account); Database.SaveCharacter(GC.MyChar, GC.AuthInfo.Account); if (GC.MyChar.Body == 1003 || GC.MyChar.Body == 1004) Game.World.SendMsgToAll("SYSTEM", GC.MyChar.Name + " and " + TargetMarry.Name + " are married now.", 2005, 0); else Game.World.SendMsgToAll("SYSTEM", TargetMarry.Name + " and " + GC.MyChar.Name + " are married now.", 2005, 0); } } } }
|
|
|
01/07/2018, 10:52
|
#2
|
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.
|
|
|
01/07/2018, 10:56
|
#3
|
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.
|
|
|
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
|
|
|
01/08/2018, 08:11
|
#5
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
|
Quote:
Originally Posted by ~OwnageBoy
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.
|
|
|
01/08/2018, 12:13
|
#6
|
elite*gold: 0
Join Date: Jul 2006
Posts: 2,216
Received Thanks: 793
|
Homophobic code.
|
|
|
01/09/2018, 15:21
|
#7
|
elite*gold: 0
Join Date: Jul 2013
Posts: 37
Received Thanks: 2
|
Quote:
Originally Posted by Spirited
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
|
|
|
01/09/2018, 17:08
|
#8
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
|
Quote:
Originally Posted by ~OwnageBoy
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.
|
|
|
01/09/2018, 18:24
|
#9
|
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
|
Quote:
Originally Posted by ~OwnageBoy
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.
|
|
|
01/12/2018, 14:57
|
#10
|
elite*gold: 0
Join Date: Jul 2013
Posts: 37
Received Thanks: 2
|
Quote:
Originally Posted by turk55
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?
|
|
|
01/13/2018, 11:04
|
#11
|
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
|
Quote:
Originally Posted by ~OwnageBoy
I code for ****? Well then I got full bags of ****. Anything else?
|
Are you proud of your achievements so far? And why?
|
|
|
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.
|
|
|
01/14/2018, 21:22
|
#13
|
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
|
Quote:
Originally Posted by ~OwnageBoy
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!!!
|
|
|
01/15/2018, 04:23
|
#14
|
elite*gold: 12
Join Date: Jul 2011
Posts: 8,211
Received Thanks: 4,114
|
Quote:
Originally Posted by turk55
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.
|
|
|
01/15/2018, 09:20
|
#15
|
elite*gold: 130
Join Date: Oct 2007
Posts: 1,652
Received Thanks: 701
|
Quote:
Originally Posted by Spirited
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.
|
|
|
|
|
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.
|
|