Not a member yet? Register for your free account!

 

Go Back   elitepvpers > Conquer Online 2 > CO2 PServer - Discussions / Questions

HELP!

This is a discussion on HELP! within the CO2 PServer - Discussions / Questions forum part of the Conquer Online 2 category; [code]#region Adding Enemies string Name = ""; for (int i = 14; i < 14 + Data[13]; i++) { Name ...


Reply
 
LinkBack Thread Tools
Old 01-12-2010, 06:29   #1
Senior Member
 
WHITELIONX's Avatar
 
Join Date: Apr 2006
Posts: 478
Received Thanks: 32
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   Reply With Quote
 
Old 01-12-2010, 06:37   #2
Cookies?!
 
spare2's Avatar
 
Join Date: Oct 2009
Posts: 849
Received Thanks: 445
Blog Entries: 2
What was the original code and what did you change. It would be easier if you pointed it out.
spare2 is offline   Reply With Quote
Old 01-12-2010, 07:11   #3
Senior Member
 
WHITELIONX's Avatar
 
Join Date: Apr 2006
Posts: 478
Received Thanks: 32
[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   Reply With Quote
Old 01-12-2010, 07:40   #4
Senior Member
 
pro4never's Avatar
 
Join Date: Jul 2005
Posts: 1,292
Received Thanks: 279
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   Reply With Quote
Old 01-12-2010, 09:05   #5
CO PServer Moderator
 
Korvacs's Avatar
 
Join Date: Mar 2006
Posts: 2,130
Received Thanks: 412
You havent explained whats wrong at all lol, how are people supposed to help you?
Korvacs is online now   Reply With Quote
Old 01-12-2010, 19:40   #6
Senior Member
 
WHITELIONX's Avatar
 
Join Date: Apr 2006
Posts: 478
Received Thanks: 32
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.

Last edited by WHITELIONX; 01-12-2010 at 19:50.
WHITELIONX is offline   Reply With Quote
Old 01-12-2010, 21:02   #7
Senior Member
 
pro4never's Avatar
 
Join Date: Jul 2005
Posts: 1,292
Received Thanks: 279
[ 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   Reply With Quote
The Following User Says Thank You to pro4never For This Useful Post:
WHITELIONX (01-14-2010)
Old 01-12-2010, 21:37   #8
Senior Member
 
WHITELIONX's Avatar
 
Join Date: Apr 2006
Posts: 478
Received Thanks: 32
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   Reply With Quote
Old 01-12-2010, 23:34   #9
Senior Member
 
pro4never's Avatar
 
Join Date: Jul 2005
Posts: 1,292
Received Thanks: 279
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   Reply With Quote
Old 01-13-2010, 00:41   #10
Senior Member
 
WHITELIONX's Avatar
 
Join Date: Apr 2006
Posts: 478
Received Thanks: 32
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 >.<

Last edited by WHITELIONX; 01-14-2010 at 03:12.
WHITELIONX is offline   Reply With Quote
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 15:31.


Powered by vBulletin® Version 3.8.2
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.3.0

Contact | FAQ | Impressum | Advertising
Copyright ©2010 Heroic Studios UG (haftungsbeschränkt) All Rights Reserved.