Register for your free account! | Forgot your password?

You last visited: Today at 17:41

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

Advertisement



Team Arena Problem

Discussion on Team Arena Problem within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
Team Arena Problem

Hello guys !!
I have 2 problem in my Arena Team and i don't know how can i fix it
The 1st problem is : after all sign up all start attack each other b4 the counter stop !
The 2nd problem : after all team die no 1 go out and i checked my TeamArena.cs file and i find the public void ExportTeam() is work
btw i'm just new person try to learn C# so i dont know if the code is right or something wrong
can some1 help me ?

this is the public void ExportTeam() code

PHP Code:
public void ExportTeam()
                {
                    foreach (
GameState state in this.Players1.Team.Teammates)
                    {
                        foreach (
GameState state2 in this.Players2.Team.Teammates)
                        {
                            foreach (
GameState state3 in this.Winner.Team.Teammates)
                            {
                                foreach (
GameState state4 in this.Loser.Team.Teammates)
                                {
                                    
state.Entity.InTeamArenaMap state2.Entity.InTeamArenaMap false;
                                    
state.InTeamArenaMatch state2.InTeamArenaMatch false;
                                    foreach (
GameState state5 in this.Watchers.ToArray())
                                    {
                                        
TeamArena.TeamQualifyEngine.DoLeaveTeam(state5);
                                    }
                                    
TeamArena.TeamWin(state3state4);
                                    
this.Inside false;
                                    
state.Entity.Teleport(state.Entity.PreviousMapIDstate.Entity.PrevXstate.Entity.PrevY);
                                    
state3.Entity.Teleport(state.Entity.PreviousMapIDstate.Entity.PrevXstate.Entity.PrevY);
                                    
state2.Entity.Teleport(state2.Entity.PreviousMapIDstate2.Entity.PrevXstate2.Entity.PrevY);
                                    
state4.Entity.Teleport(state2.Entity.PreviousMapIDstate2.Entity.PrevXstate2.Entity.PrevY);
                                    
state4.Entity.Ressurect();
                                    
state3.Entity.Ressurect();
                                    
state.TeamArenaStatistic.AcceptBox state2.TeamArenaStatistic.AcceptBox false;
                                    
state.TeamArenaStatistic.AcceptBoxShow state2.TeamArenaStatistic.AcceptBoxShow state2.TeamArenaStatistic.AcceptBoxShow.AddHours(2);
                                    
state.TeamArenaStatistic.PlayWith state2.TeamArenaStatistic.PlayWith 0;
                                    
TeamArena.TeamArenaSignup signup = new TeamArena.TeamArenaSignup
                                    
{
                                        
DialogID 10
                                    
};
                                    
state4.Send(signup.BuildPacket());
                                    
signup.OptionID 1;
                                    
state3.Send(signup.BuildPacket());
                                    
TeamArena.TeamQualifierList.Groups.Remove(this.ID);
                                    
state.Entity.PKMode this.P1Mode;
                                    
Data buffer = new Data(true)
                                    {
                                        
UID state.Entity.UID,
                                        
ID 0x60,
                                        
dwParam = (uint)state.Entity.PKMode
                                    
};
                                    
state.Send(buffer);
                                    
state2.Entity.PKMode this.P2Mode;
                                    
Data data2 = new Data(true)
                                    {
                                        
UID state2.Entity.UID,
                                        
ID 0x60,
                                        
dwParam = (uint)state2.Entity.PKMode
                                    
};
                                    
state2.Send(data2);
                                    
state.TeamQualifierGroup null;
                                    
state2.TeamQualifierGroup null;
                                    
state.Entity.InTeamArenaorArena false;
                                    
state2.Entity.InTeamArenaorArena false;
                                    if (
this.dynamicMap != null)
                                    {
                                        
this.dynamicMap.Dispose();
                                    }
                                }
                            }
                        }
                    }
                } 
thanks guys
girgismena is offline  
Old 07/24/2013, 07:54   #2
 
Spirited's Avatar
 
elite*gold: 12
Join Date: Jul 2011
Posts: 8,282
Received Thanks: 4,191
Moved to the right section with a 4 hour redirect.
All private server questions should be in this section.
Spirited is offline  
Old 07/24/2013, 08:04   #3
 
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
oh sorry
i know the true section but i dont know what happened
thanks for moving and sorry for that a mistake
girgismena is offline  
Old 07/24/2013, 14:15   #4
 
abdoumatrix's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 238
1.

2. if u r a public source then i 'm sure that all codes had to recoded and all structures too.
i know cuz i see most of them.
abdoumatrix is offline  
Old 07/24/2013, 23:35   #5
 
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
thanks for ur answer
for 1st problem u mean i add that in packet handel ?

for 2nd i'm not good too answer if my team arena in source are good or not
girgismena is offline  
Old 07/25/2013, 00:50   #6
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
Why the hell are you nesting 4 loops?
Super Aids is offline  
Old 07/25/2013, 01:08   #7
 
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
Quote:
Originally Posted by Super Aids View Post
Why the hell are you nesting 4 loops?
what's your problem ?
if you can help me ok if you didn't so whats your problem ?
girgismena is offline  
Old 07/25/2013, 01:20   #8
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
It's not my problem. It's your problem.

This is how your code works.

For every player in player1's team you will loop player2's team.
For every player in player2's team you will loop the winners team.
For every player in the winners team you will loop the losers team.
For every player in the losers team you will handle the loops above.

This will cause the loser, winner and player2's team to be exeuted countless time.

You should run each loop for themselves.

Let me sum up why.
Let's say you have 2 players in player1's team, 2 players in player2's team,
the winner team is player1's team and the loser team is player2's team.

That means your loop will run this much:
Code:
2
	4
		8
			16
When you could have it run like this:
Code:
2
2
2
2
However you could even cut it down to:
Code:
2
2
By only using player1 and player2's team since those 2 teams will also be the winner and loser team.
Super Aids is offline  
Thanks
1 User
Old 07/25/2013, 03:49   #9
 
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
Quote:
Originally Posted by Super Aids View Post
It's not my problem. It's your problem.

This is how your code works.

For every player in player1's team you will loop player2's team.
For every player in player2's team you will loop the winners team.
For every player in the winners team you will loop the losers team.
For every player in the losers team you will handle the loops above.

This will cause the loser, winner and player2's team to be exeuted countless time.

You should run each loop for themselves.

Let me sum up why.
Let's say you have 2 players in player1's team, 2 players in player2's team,
the winner team is player1's team and the loser team is player2's team.

That means your loop will run this much:
Code:
2
	4
		8
			16
When you could have it run like this:
Code:
2
2
2
2
However you could even cut it down to:
Code:
2
2
By only using player1 and player2's team since those 2 teams will also be the winner and loser team.
i cant understand bro
i just start learning C# from 2 days
and that alot for me
i try to edit that code but i dont know what mean of loop
that hard for me
thanks
girgismena is offline  
Old 07/25/2013, 11:36   #10
 
abdoumatrix's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 238
Quote:
Originally Posted by girgismena View Post
thanks for ur answer
for 1st problem u mean i add that in packet handel ?

for 2nd i'm not good too answer if my team arena in source are good or not
in ur handle.cs
search
PHP Code:
his.attacker.AttackStamp Time32.Now;
            if ((
this.attacker.Owner.QualifierGroup != null) && (Time32.Now this.attacker.Owner.QualifierGroup.CreateTime.AddSeconds(12)))
            {
                return;
            } 
and put

PHP Code:
if ((this.attacker.Owner.QualifierGroups != null) && (Time32.Now this.attacker.Owner.QualifierGroups.CreateTime.AddSeconds(12)))
            {
                return;
            } 

Quote:
Originally Posted by Super Aids View Post
Why the hell are you nesting 4 loops?
Trinty based source codes so we used to it so we used it till we gain more experience and improve it

Quote:
Originally Posted by Super Aids View Post
ty for ur helpful tip.
so this is gonna be better


the 4 loop will affect the performance.right?
abdoumatrix is offline  
Old 07/25/2013, 14:57   #11
 
Super Aids's Avatar
 
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
You are still nesting the loops. They have to be separated.
Super Aids is offline  
Thanks
2 Users
Old 07/25/2013, 16:54   #12
 
abdoumatrix's Avatar
 
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 238
Quote:
Originally Posted by Super Aids View Post
You are still nesting the loops. They have to be separated.
aha.
abdoumatrix is offline  
Thanks
1 User
Old 07/25/2013, 19:26   #13
 
shadowman123's Avatar
 
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
Quote:
Originally Posted by abdoumatrix View Post
if u r a public source then i 'm sure that all codes had to recoded and all structures too.
i know cuz i see most of them.
thats it
shadowman123 is offline  
Thanks
1 User
Old 07/25/2013, 21:24   #14
 
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
Quote:
Originally Posted by abdoumatrix View Post
in ur handle.cs
search
PHP Code:
his.attacker.AttackStamp Time32.Now;
            if ((
this.attacker.Owner.QualifierGroup != null) && (Time32.Now this.attacker.Owner.QualifierGroup.CreateTime.AddSeconds(12)))
            {
                return;
            } 
and put

PHP Code:
if ((this.attacker.Owner.QualifierGroups != null) && (Time32.Now this.attacker.Owner.QualifierGroups.CreateTime.AddSeconds(12)))
            {
                return;
            } 



Trinty based source codes so we used to it so we used it till we gain more experience and improve it



ty for ur helpful tip.
so this is gonna be better


the 4 loop will affect the performance.right?
Quote:
Originally Posted by shadowman123 View Post
thats it
thanks again bro
i replace my public void ExportTeam() with yours but i got 1 Error
The Error is here :
PHP Code:
foreach (Client.GameState teammate1 in Player1.Entity.Owner.Team.Teammates
Error said Error: 2 The name 'Player1' does not exist in the current
i know i bother all so please forgive me guys
and thanks for helping me
girgismena is offline  
Old 07/25/2013, 21:44   #15
 
elite*gold: 0
Join Date: Mar 2013
Posts: 12
Received Thanks: 2
Quote:
Originally Posted by girgismena View Post
thanks again bro
i replace my public void ExportTeam() with yours but i got 1 Error
The Error is here :
PHP Code:
foreach (Client.GameState teammate1 in Player1.Entity.Owner.Team.Teammates
Error said Error: 2 The name 'Player1' does not exist in the current
i know i bother all so please forgive me guys
and thanks for helping me
Will be Players1
The.Goblin is offline  
Thanks
1 User
Reply


Similar Threads Similar Threads
[Sharing] Big Problem in Team Arena
05/15/2013 - CO2 Private Server - 1 Replies
i have big Problem in Team arena or when 3 member in Team Enter arena Vs 3 member in other Team when i kill all in map i can't Out From arena I Want to know What Can i do To make Team Arena Like TQ ? i wish if it help someone.
Arena Team?
11/04/2012 - World of Warcraft - 14 Replies
Servus, hätte mal ne Frage zur Kombination eines 2er Teams. Da mein Arenapartner nen Arms spielt wollt ich mal fragen ob man schon sagen kann was sich am Besten dazu eignet? Kann zwischen Schurke, DK, Hunter, Warri und Mage wählen. Antwort entweder in den Thread posten oder per PN ;) mfg Omboss
Team arena.
04/21/2012 - CO2 Private Server - 0 Replies
Hi peeps, i was wondering if any one got some of the team arena pk packets, i cant sniff them from trinity yeah, so any help would be good.
Get the Arena Team name you want even if it's taken.
02/23/2008 - WoW Exploits, Hacks, Tools & Macros - 2 Replies
This may or may not still work. I did it before the latest patch and it worked, though I had a friend try and he is saying that it's not working. He may be doing something wrong though. I don't know. If someone would confirm or deny this still works, would be appreciated. Hi, let's say you are starting an arena team and you have your awesome team name already picked out. You go to the Arena Organizer only to find that the perfect name you wanted is taken. Well, there is a way to have...
Arena Team Namen
05/03/2007 - World of Warcraft - 38 Replies
Ja wies Topic sagt ich suche nen guten Arena Team Namen, weil uns absolut keiner einfällt.... für gute Vorschläge gibts +k.



All times are GMT +1. The time now is 17:41.


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