|
You last visited: Today at 17:41
Advertisement
Team Arena Problem
Discussion on Team Arena Problem within the CO2 Private Server forum part of the Conquer Online 2 category.
07/24/2013, 07:11
|
#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(state3, state4);
this.Inside = false;
state.Entity.Teleport(state.Entity.PreviousMapID, state.Entity.PrevX, state.Entity.PrevY);
state3.Entity.Teleport(state.Entity.PreviousMapID, state.Entity.PrevX, state.Entity.PrevY);
state2.Entity.Teleport(state2.Entity.PreviousMapID, state2.Entity.PrevX, state2.Entity.PrevY);
state4.Entity.Teleport(state2.Entity.PreviousMapID, state2.Entity.PrevX, state2.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
|
|
|
07/24/2013, 07:54
|
#2
|
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.
|
|
|
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
|
|
|
07/24/2013, 14:15
|
#4
|
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 238
|
1.
PHP Code:
this.attacker.AttackStamp = Time32.Now; if ((this.attacker.Owner.QualifierGroup != null) && (Time32.Now < this.attacker.Owner.QualifierGroup.CreateTime.AddSeconds(12))) { return; } if ((this.attacker.Owner.QualifierGroups != null) && (Time32.Now < this.attacker.Owner.QualifierGroups.CreateTime.AddSeconds(12))) { return; }
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.
|
|
|
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
|
|
|
07/25/2013, 00:50
|
#6
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
Why the hell are you nesting 4 loops?
|
|
|
07/25/2013, 01:08
|
#7
|
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
|
Quote:
Originally Posted by Super Aids
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 ?
|
|
|
07/25/2013, 01:20
|
#8
|
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:
When you could have it run like this:
However you could even cut it down to:
By only using player1 and player2's team since those 2 teams will also be the winner and loser team.
|
|
|
07/25/2013, 03:49
|
#9
|
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
|
Quote:
Originally Posted by Super Aids
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:
When you could have it run like this:
However you could even cut it down to:
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
|
|
|
07/25/2013, 11:36
|
#10
|
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 238
|
Quote:
Originally Posted by girgismena
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
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
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:
When you could have it run like this:
However you could even cut it down to:
By only using player1 and player2's team since those 2 teams will also be the winner and loser team.
|
ty for ur helpful tip. 
so this is gonna be better
PHP Code:
{
foreach (Client.GameState teammate1 in Player1.Entity.Owner.Team.Teammates)
{
foreach (Client.GameState teammate2 in Player2.Entity.Owner.Team.Teammates)
{
teammate1.InArenaMatch = Player1.InArenaMatch;
teammate2.InArenaMatch = Player2.InArenaMatch;
Player1.InArenaMatch = Player2.InArenaMatch = false;
var arr = Watcherss.ToArray();
foreach (Client.GameState client in arr)
QualifyEngine2.DoLeave(client);
arr = null;
Win(Winner, Loser);
Inside = false;
// Player1.Entity.Teleport(Player1.Entity.PreviousMapID, Player1.Entity.PrevX, Player1.Entity.PrevY);
// Player2.Entity.Teleport(Player2.Entity.PreviousMapID, Player2.Entity.PrevX, Player2.Entity.PrevY);
Player1.Entity.Teleport(1002, 444, 444);
teammate1.Entity.Teleport(1002, 444, 444);
Player2.Entity.Teleport(1002, 444, 444);
teammate2.Entity.Teleport(1002, 444, 444);
Conquer_Online_Server.Console.WriteLine("Team arena Job Done");
Loser.Entity.Ressurect2();
Winner.Entity.Ressurect2();
Player1.ArenaTeam.AcceptBox = Player2.ArenaTeam.AcceptBox = false;
Player1.ArenaTeam.AcceptBoxShow = Player2.ArenaTeam.AcceptBoxShow = Player2.ArenaTeam.AcceptBoxShow.AddHours(2);
Player1.ArenaTeam.PlayWith = Player2.ArenaTeam.PlayWith = 0;
ArenaTeamSignup sign = new ArenaTeamSignup();
sign.DialogID = ArenaTeamSignup.MainIDs.Dialog2;
Loser.Send(sign.BuildPacket());
sign.OptionID = ArenaTeamSignup.DialogButton.Win;
Winner.Send(sign.BuildPacket());
QualifierList2.Groups.Remove(ID);
Player1.Entity.PKMode = P1Mode;
Player1.Send(new Data(true) { UID = Player1.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)Player1.Entity.PKMode });
Player2.Entity.PKMode = P2Mode;
Player2.Send(new Data(true) { UID = Player2.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)Player2.Entity.PKMode });
Player1.QualifierGroups = null;
Player2.QualifierGroups = null;
teammate1.Entity.PKMode = P1Mode;
teammate1.Send(new Data(true) { UID = Player1.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)Player1.Entity.PKMode });
teammate2.Entity.PKMode = P2Mode;
teammate2.Send(new Data(true) { UID = Player2.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)Player2.Entity.PKMode });
teammate1.QualifierGroups = null;
teammate2.QualifierGroups = null;
if (dynamicMap != null)
dynamicMap.Dispose();
}
}
}
the 4 loop will affect the performance.right?
|
|
|
07/25/2013, 14:57
|
#11
|
elite*gold: 0
Join Date: Dec 2012
Posts: 1,761
Received Thanks: 950
|
You are still nesting the loops. They have to be separated.
|
|
|
07/25/2013, 16:54
|
#12
|
elite*gold: 0
Join Date: Jul 2008
Posts: 874
Received Thanks: 238
|
Quote:
Originally Posted by Super Aids
You are still nesting the loops. They have to be separated.
|
aha.
|
|
|
07/25/2013, 19:26
|
#13
|
elite*gold: 0
Join Date: Aug 2007
Posts: 1,525
Received Thanks: 230
|
Quote:
Originally Posted by abdoumatrix
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
|
|
|
07/25/2013, 21:24
|
#14
|
elite*gold: 0
Join Date: Aug 2009
Posts: 94
Received Thanks: 6
|
Quote:
Originally Posted by abdoumatrix
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
PHP Code:
{
foreach (Client.GameState teammate1 in Player1.Entity.Owner.Team.Teammates)
{
foreach (Client.GameState teammate2 in Player2.Entity.Owner.Team.Teammates)
{
teammate1.InArenaMatch = Player1.InArenaMatch;
teammate2.InArenaMatch = Player2.InArenaMatch;
Player1.InArenaMatch = Player2.InArenaMatch = false;
var arr = Watcherss.ToArray();
foreach (Client.GameState client in arr)
QualifyEngine2.DoLeave(client);
arr = null;
Win(Winner, Loser);
Inside = false;
// Player1.Entity.Teleport(Player1.Entity.PreviousMapID, Player1.Entity.PrevX, Player1.Entity.PrevY);
// Player2.Entity.Teleport(Player2.Entity.PreviousMapID, Player2.Entity.PrevX, Player2.Entity.PrevY);
Player1.Entity.Teleport(1002, 444, 444);
teammate1.Entity.Teleport(1002, 444, 444);
Player2.Entity.Teleport(1002, 444, 444);
teammate2.Entity.Teleport(1002, 444, 444);
Conquer_Online_Server.Console.WriteLine("Team arena Job Done");
Loser.Entity.Ressurect2();
Winner.Entity.Ressurect2();
Player1.ArenaTeam.AcceptBox = Player2.ArenaTeam.AcceptBox = false;
Player1.ArenaTeam.AcceptBoxShow = Player2.ArenaTeam.AcceptBoxShow = Player2.ArenaTeam.AcceptBoxShow.AddHours(2);
Player1.ArenaTeam.PlayWith = Player2.ArenaTeam.PlayWith = 0;
ArenaTeamSignup sign = new ArenaTeamSignup();
sign.DialogID = ArenaTeamSignup.MainIDs.Dialog2;
Loser.Send(sign.BuildPacket());
sign.OptionID = ArenaTeamSignup.DialogButton.Win;
Winner.Send(sign.BuildPacket());
QualifierList2.Groups.Remove(ID);
Player1.Entity.PKMode = P1Mode;
Player1.Send(new Data(true) { UID = Player1.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)Player1.Entity.PKMode });
Player2.Entity.PKMode = P2Mode;
Player2.Send(new Data(true) { UID = Player2.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)Player2.Entity.PKMode });
Player1.QualifierGroups = null;
Player2.QualifierGroups = null;
teammate1.Entity.PKMode = P1Mode;
teammate1.Send(new Data(true) { UID = Player1.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)Player1.Entity.PKMode });
teammate2.Entity.PKMode = P2Mode;
teammate2.Send(new Data(true) { UID = Player2.Entity.UID, ID = Data.ChangePKMode, dwParam = (uint)Player2.Entity.PKMode });
teammate1.QualifierGroups = null;
teammate2.QualifierGroups = null;
if (dynamicMap != null)
dynamicMap.Dispose();
}
}
}
the 4 loop will affect the performance.right?
|
Quote:
Originally Posted by shadowman123
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
|
|
|
07/25/2013, 21:44
|
#15
|
elite*gold: 0
Join Date: Mar 2013
Posts: 12
Received Thanks: 2
|
Quote:
Originally Posted by girgismena
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 Player s1
|
|
|
 |
|
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.
|
|