|
You last visited: Today at 18:59
Advertisement
HELP!
Discussion on HELP! within the CO2 Private Server forum part of the Conquer Online 2 category.
01/12/2010, 06:29
|
#1
|
elite*gold: 0
Join Date: Apr 2006
Posts: 534
Received Thanks: 66
|
HELP!
[code]#region Adding Enemies
string Name = ""; for (int i = 14; i < 14 + Data[13]; i++) { Name += Convert.ToChar(Data[i]); }
if (GC.MyChar.MyGuild.Enemies.Count < 5)
{
foreach (KeyValuePair<int, Struct.Guilds> Guilds in Guilds)
{
Struct.Guilds TGuild = Guilds.Value;
if (TGuild.Name != GC.MyChar.MyGuild.GuildID)
{
if (!GC.MyChar.MyGuild.Enemies.Contains(TGuild.ID))
{
if (TGuild.Name == Name)
{
Struct.Guilds GuildUpdate = NewestCoServer.Guilds[GC.MyChar.MyGuild];
GuildUpdate.Enemies.Add(TGuild.ID, TGuild);
GC.AddSend(Packets.NPCSay("Done."));
GC.AddSend(Packets.NPCLink("Thanks.", 255));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
Database.database.UpdateGuild(GC.MyChar.MyGuild);
foreach (GC Socket in Database.ClientPool.Values)
{
string[] Names = new string[1];
Names[0] = TGuild.Name;
Socket.GetType(NewestCoServer.String(Names, TGuild.ID, Struct.StringType.GuildEnemies, 1));
PacketHandler.Guild.SendGuildScreen(Socket);
}
}
}
else { GC.AddSend(Packets.NPCSay("This is guild already is your enemy."));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
}
}
}
else { GC.AddSend(Packets.NPCSay("You are full enemies."));
GC.AddSend(Packets.NPCSetFace(N.Avatar));
GC.AddSend(Packets.NPCFinish());
}
#endregion
What do I need to put because I am changing the npc text etc but some of the things are puzzling to me especially such as this part >.< Just a few things that won`t accept >.<
|
|
|
01/12/2010, 06:37
|
#2
|
elite*gold: 20
Join Date: Oct 2009
Posts: 1,009
Received Thanks: 621
|
What was the original code and what did you change. It would be easier if you pointed it out.
|
|
|
01/12/2010, 07:11
|
#3
|
elite*gold: 0
Join Date: Apr 2006
Posts: 534
Received Thanks: 66
|
[code]#region Adding Enemies
string Name = ""; for (int i = 14; i < 14 + Data[13]; i++) { Name += Convert.ToChar(Data[i]); }
if (CSocket.Client.Guild.Enemies.Count < 5)
{
foreach (KeyValuePair<int, Struct.Guilds> Guilds in Nano.Guilds)
{
Struct.Guilds TGuild = Guilds.Value;
if (TGuild.Name != CSocket.Client.Guild.Name)
{
if (!CSocket.Client.Guild.Enemies.ContainsKey(TGuild. ID))
{
if (TGuild.Name == Name)
{
Struct.Guilds GuildUpdate = Nano.Guilds[CSocket.Client.GuildID];
GuildUpdate.Enemies.Add(TGuild.ID, TGuild);
Text("Done.", CSocket);
Link("Thanks.", 255, CSocket);
End(CSocket);
Database.Database.UpdateGuild(CSocket.Client.Guild );
foreach (ClientSocket Socket in Nano.ClientPool.Values)
{
string[] Names = new string[1];
Names[0] = TGuild.Name;
Socket.Send(ConquerPacket.String(Names, TGuild.ID, Struct.StringType.GuildEnemies, 1));
Handlers.Guilds.SendGuildScreen(Socket);
}
}
}
else { ErrorMsg("This is guild already is your enemy.", CSocket); }
}
}
}
else { ErrorMsg("You are full enemies.", CSocket); }
#endregion
This is the original I am attempting to make it work for 5165
|
|
|
01/12/2010, 07:40
|
#4
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
What errors are you getting?
I haven't used the source so it's hard for me to tell but from a purely structural level things seemed to make some sense (note: please use the [code] system properly.. makes everything infinitely more readable)
|
|
|
01/12/2010, 09:05
|
#5
|
elite*gold: 20
Join Date: Mar 2006
Posts: 6,126
Received Thanks: 2,518
|
You havent explained whats wrong at all lol, how are people supposed to help you?
|
|
|
01/12/2010, 19:40
|
#6
|
elite*gold: 0
Join Date: Apr 2006
Posts: 534
Received Thanks: 66
|
Huh@Korvacs? "This is the original I am attempting to make it work for 5165" I would have thought with the words GUILDS and ENEMIES it would have been obvious considering 5165 has no allies and enemies for guilds >.< In fairness my only posts recently have been for 5165.
Ok the original code is for coemuv2 thought checking through sources this would have been obvious since 5017 is completely different with no script liike this for GuildNPC. So far I have seen this code only once unless you count binaries.
This is the part that confuses me because I am not sure what the 5165 should read >.<
[code]
Database.database.UpdateGuild(GC.MyChar.MyGuild);
foreach (GC Socket in Database.ClientPool.Values)
{
string[] Names = new string[1];
Names[0] = TGuild.Name;
Socket.GetType(NewestCoServer.String(Names, TGuild.ID, Struct.StringType.GuildEnemies, 1));
PacketHandler.Guild.SendGuildScreen(Socket);
}
}
With all due respect pro4never I am forever trying to use the [code] thing and STILL have no idea how to do it lmao.
|
|
|
01/12/2010, 21:02
|
#7
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
[ code ]
text
[ / code ]
that's allt here is to it. Just like any other forum based syntax.
It makes everything so much more readable by keeping all the indentation and formating the same so people can actually read it :P
So you are still in the process of converting the last bit of the code... but what errors are you getting?
Again I can't help much cause I've not used the source.
|
|
|
01/12/2010, 21:37
|
#8
|
elite*gold: 0
Join Date: Apr 2006
Posts: 534
Received Thanks: 66
|
Ok cool I think I understand the code thing now  Some of the words are not found in that little part now but I have no idea what the words should be >.<
Basically Database is fine but Database.database is not fine because database comes up as an issue. So the words causing me a problem in this little part would be Struct, Guilds, NewestCoServer, Getstats and ClientPool
|
|
|
01/12/2010, 23:34
|
#9
|
elite*gold: 21
Join Date: Jul 2005
Posts: 9,193
Received Thanks: 5,380
|
Database.Database is because you are converting it from a CoEmu source that has a folder named Database with a .cs file in it named Database.cs (therefore Database.Database.functionname)
Where is your guild structures handled? again, CoEmu has a folder named Struct>Guilds.cs for handling guild structures.
basically you just need to link the problem areas up with where the code exists in your source. client pool would indicate all connected clients, easiest way to find that would be to find where new connections are being accepted. Once authenticated/logged in fully they should be being added to a client thread... Client Pool I am 90 pct sure refers to what it is called in CoEmu but it should still function similarly
|
|
|
01/13/2010, 00:41
|
#10
|
elite*gold: 0
Join Date: Apr 2006
Posts: 534
Received Thanks: 66
|
Ahhhhhhhhhh so I need it to be something like Database.Features.functionname? Ok so I have Guilds.cs in Features but I also have Guild stuff in Database.cs and Guild.cs in PacketHandling
Meh I give up I have absolutely no idea what is supposed to be where and when I try to change it well it just gives new errors >.<
|
|
|
02/09/2010, 01:25
|
#11
|
elite*gold: 0
Join Date: Apr 2008
Posts: 275
Received Thanks: 43
|
is that the npc for making enemy guild? are you converting it in 5165?
|
|
|
02/09/2010, 07:21
|
#12
|
elite*gold: 0
Join Date: May 2006
Posts: 127
Received Thanks: 91
|
Quote:
Originally Posted by WHITELIONX
Ahhhhhhhhhh so I need it to be something like Database.Features.functionname? Ok so I have Guilds.cs in Features but I also have Guild stuff in Database.cs and Guild.cs in PacketHandling
Meh I give up I have absolutely no idea what is supposed to be where and when I try to change it well it just gives new errors >.<
|
dont give up. try digging more. As I saw the converted codes.. seems like there are few Methods that you need to add in Guild.cs enable for it to work. maybe by adding some structs for allies and enemies. then modify the SaveGuild() method to add the info for allies and enemies... as will as the LoadGuild() and other affected methods in Guild.cs
|
|
|
All times are GMT +1. The time now is 19:00.
|
|