Register for your free account! | Forgot your password?

You last visited: Today at 18:59

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

Advertisement



HELP!

Discussion on HELP! within the CO2 Private Server forum part of the Conquer Online 2 category.

Reply
 
Old   #1
 
WHITELIONX's Avatar
 
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 >.<
WHITELIONX is offline  
Old 01/12/2010, 06:37   #2
 
spare2's Avatar
 
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.
spare2 is offline  
Old 01/12/2010, 07:11   #3
 
WHITELIONX's Avatar
 
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
WHITELIONX is offline  
Old 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)
pro4never is offline  
Old 01/12/2010, 09:05   #5


 
Korvacs's Avatar
 
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?
Korvacs is offline  
Old 01/12/2010, 19:40   #6
 
WHITELIONX's Avatar
 
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.
WHITELIONX is offline  
Old 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.
pro4never is offline  
Thanks
1 User
Old 01/12/2010, 21:37   #8
 
WHITELIONX's Avatar
 
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
WHITELIONX is offline  
Old 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
pro4never is offline  
Old 01/13/2010, 00:41   #10
 
WHITELIONX's Avatar
 
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 >.<
WHITELIONX is offline  
Old 02/09/2010, 01:25   #11
 
salem rey's Avatar
 
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?
salem rey is offline  
Old 02/09/2010, 07:21   #12
 
elite*gold: 0
Join Date: May 2006
Posts: 127
Received Thanks: 91
Quote:
Originally Posted by WHITELIONX View Post
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
kamote is offline  
Reply




All times are GMT +1. The time now is 19:00.


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