Hi all. Here is my way to get guilds work on CoEmuv2.
First of all, make copy of your source, before you start doing anything with it. To avoid any bugs read carefully that guide. I have spent some time to get it work, so press Thank if it helps.
So lets start.
1.Create new class file Guild.cs under GS>Entities and paste whole code:
Code:
/*
* Created by Bisiol.
*/
using System;
using System.Collections;
using System.Collections.Generic;
using System.Timers;
using CoEmu_v2_GameServer.Connections;
using CoEmu_v2_GameServer.Structs;
using CoEmu_v2_GameServer.Packets;
using CoEmu_v2_GameServer.Database;
namespace CoEmu_v2_GameServer.Entities
{
/// <summary>
/// A conquer online guild.
/// </summary>
public class Guild
{
public ushort ID;//Guild ID
public string Name;//Guild Name
public member Leader;// Guild Leader
public Dictionary<int, member> Members = new Dictionary<int, member>();//Members(normal and DL)
public int Fund;//Guild Fund
public uint MembersCount;//Number of all members
public string Bulletin; //Bulletin
/// <summary>
/// Remove member from guild and sent message to guild members.
/// </summary>
public void PlayerQuits(Character Quitter)
{
Members.Remove(Quitter.ID);
GuildMessage(Quitter.Name + " has left our guild.");
MembersCount--;
}
public static void refresh(ClientSocket CSocket)
{
if (CSocket.Client.InGuild && Nano.Guilds.ContainsKey(CSocket.Client.gid))
{
Guild gd = Nano.Guilds[CSocket.Client.gid];
CSocket.Send(ConquerPacket.GName(CSocket.Client.gid, CSocket.Client.gna));
CSocket.Send(ConquerPacket.Ginfo(gd, CSocket.Client));
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, gd.Bulletin, Struct.ChatType.GuildBulletin));
}
}
public void GuildMessage(string Message)
{
if (Nano.ClientPool.ContainsKey(Leader.ID))
{
Nano.ClientPool[Leader.ID].Send(ConquerPacket.Chat(0, "Guild", "All", Message, Struct.ChatType.Guild));
}
foreach (KeyValuePair<int, member> mb in Members)
{
if (Nano.ClientPool.ContainsKey(mb.Value.ID))
{
Nano.ClientPool[mb.Value.ID].Send(ConquerPacket.Chat(0, "Guild", "All", Message, Struct.ChatType.Guild));
}
}
}
}
public class member : IComparable<member>
{
public int ID;
public string Name = "";
public bool isDL = false;
public int lvl;
public int Donation = 0;
#region IComparable<member> Members
public int CompareTo(member other)
{
return other.lvl.CompareTo(this.lvl);
}
#endregion
}
}
2.Create new class file Guild.cs under GS>Packets and paste whole code:
Code:
/*
* Created by Bisiol.
*/
using System;
using CoEmu_v2_GameServer.Connections;
using CoEmu_v2_GameServer.Entities;
namespace CoEmu_v2_GameServer.Packets
{
/// <summary>
/// Guild packets.
/// </summary>
public partial class ConquerPacket
{
public static byte[] GSend(int GuildID, byte Type)
{
PacketBuilder Packet = new PacketBuilder(0x453, 12);
Packet.Long(Type);
Packet.Long(GuildID);
return Packet.getFinal();
}
public static byte[] Ginfo(Guild gd, Character ch)
{
PacketBuilder Packet = new PacketBuilder(0x452, 21 + gd.Leader.Name.Length);
Packet.Long(gd.ID); //id
Packet.Long(ch.donation); //don
Packet.Long(gd.Fund); //fund
Packet.Long(gd.MembersCount); //mc
Packet.Int(ch.gpo); //pos
Packet.Text(gd.Leader.Name); //gl
return Packet.getFinal();
}
public static byte[] GName(ushort ID, string Name)
{
PacketBuilder Packet = new PacketBuilder(1015, 11 + Name.Length);
Packet.Short(ID);
Packet.Int(0);
Packet.Int(0);
Packet.Int(3);
Packet.Int(1);
Packet.Int(Name.Length);
for (int i = 0; i < Name.Length; i++)
{
Packet.Int(Convert.ToByte(Name[i]));
}
return Packet.getFinal();
}
public static byte[] GList(long CharId, byte Type, string name, byte Count)
{
PacketBuilder Packet = new PacketBuilder(1015, 10 + name.Length);
Packet.Long((uint)CharId);
Packet.Int(Type);
Packet.Int((byte)Count);
Packet.Text(name);
return Packet.getFinal();
}
}
}
3. Go to GS>PacketProcessor.cs and search for:
Code:
#region CreateCharacter
case 1001://Create Character
12. Open GS>Nano.cs find StartServer() void and after Struct.LoadTNpcs(); add:
Code:
Database.Database.LoadGuilds();
13. Go To GS>Handlers>NPCTalk.cs and look for:
Code:
public static void NpcTalk(ClientSocket CSocket, int ID, int LinkBack)
replace it with:
Code:
public static void NpcTalk(ClientSocket CSocket, int ID, int LinkBack,byte[] data)
look for:
Code:
using CoEmu_v2_GameServer.Calculations;
and addif you dont have already)
Code:
using CoEmu_v2_GameServer.Entities;
14. still NPCTalk.cs add that somewhere:
Code:
case 10003: // Guild Controler
{
if (LinkBack == 0)
{
Text("I am in charge of all the guilds in TwinCity, You may consult me for anything related to the guilds.", CSocket);
Link("Create a Guild.", 1, CSocket);
Link("Deputize.", 2, CSocket);
Link("Remove from Office.", 7, CSocket);
Link("Disband.", 3, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 1)
{
if (!CSocket.Client.InGuild)
{
Text("It will cost you 1,000,000 silvers, and you need to be level 95 at least.", CSocket);
Input(4, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. You in a Guild.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 2)
{
if (CSocket.Client.gpo == 100)
{
int dlcount = 0;
foreach (KeyValuePair<int, member> m in Nano.Guilds[CSocket.Client.gid].Members)
if (m.Value.isDL)
dlcount++;
if (dlcount < 6)
{
Text("Enter the name of your guildmate you want to deputize.", CSocket);
Input(5, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Your guild already have 6 DLs", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else
{
Text("Sorry. Only GuildLeader can promote members.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 3)
{
if (CSocket.Client.gpo == 100)
{
if (Nano.Guilds[CSocket.Client.gid].Members.Count == 0)
{
Text("Are you sure you want to disband your guild?", CSocket);
Link("Yes.", 6, CSocket);
Link("No, actually.", 255, CSocket);
End(CSocket);
}
else
{
Text("You Cant Disband your guild until you have members in.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
}
}
else
{
Text("Only guild leader can disband his/her guild.", CSocket);
Link("Ok.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 4)
{
if (!CSocket.Client.InGuild)
{
if (CSocket.Client.Money >= 1000000)
{
if (CSocket.Client.Level >= 95)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
bool chk = true;
foreach (KeyValuePair<int, Guild> gd in Nano.Guilds)
{
if (gd.Value.Name == str)
chk = false;
}
if (chk)
{
int ngid;
do
{
ngid = Nano.Rand.Next(100, 33333);
} while (Nano.Guilds.ContainsKey(ngid));
Money(-1000000, CSocket);
Guild GD = new Guild();
GD.Bulletin = "Enter Bulletin Here";
GD.Fund = 1000000;
GD.ID = (ushort)ngid;
GD.Leader = new member();
GD.Leader.ID = CSocket.Client.ID;
GD.Leader.lvl = CSocket.Client.Level;
GD.Leader.Name = CSocket.Client.Name;
GD.Name = str;
GD.MembersCount++;
Nano.Guilds.Add(ngid, GD);
CSocket.Client.gid = GD.ID;
CSocket.Client.gna = str;
CSocket.Client.gpo = 100;
CSocket.Client.InGuild = true;
Guild.refresh(CSocket);
foreach (KeyValuePair<int, ClientSocket> C in Nano.ClientPool)
C.Value.Send(ConquerPacket.Chat(0, "SYSTEM", "ALL", "Congratulations " + CSocket.Client.Name + " has set up " + str + " successfully!", Struct.ChatType.Talk));
Database.Database.NewGuild(GD, CSocket.Client);
}
else
Text("Guild name are taken.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
else
Text("You aren't high level enough.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
Text("You don't have enough silvers.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
Text("Congratulations You have set up a guild.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
else if (LinkBack == 5)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
bool t = false;
foreach (KeyValuePair<int, member> m in Nano.Guilds[CSocket.Client.gid].Members)
if (m.Value.Name == str)
{
t = true;
m.Value.isDL = true;
if (Nano.ClientPool.ContainsKey(m.Key))
{
Nano.ClientPool[m.Value.ID].Client.gpo = 90;
Guild.refresh(Nano.ClientPool[m.Value.ID]);
Spawn.All(CSocket);
break;
}
else
{
Text("The player you want to deputize must be in your guild and online.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
}
if (!t)
{
Text("You do not have that member.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 6)
{
foreach (KeyValuePair<int, ClientSocket> C in Nano.ClientPool)
C.Value.Send(ConquerPacket.Chat(0, "SYSTEM", "ALL", CSocket.Client.gna + " has been disbanded.", Struct.ChatType.Talk));
Database.Database.DeleteGuild(CSocket.Client.gid);
CSocket.Send(ConquerPacket.GSend(CSocket.Client.gid, 19));
CSocket.Client.gid = 0;
CSocket.Client.gna = "";
CSocket.Client.gpo = 50;
Nano.Guilds.Remove(CSocket.Client.gid);
}
else if (LinkBack == 7)
{
if (CSocket.Client.gpo == 100)
{
Text("Enter the name of your guildmate with you want remove from office.", CSocket);
Input(8, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Only GuildLeader can remove DLs.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 8)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
bool t = false;
foreach (KeyValuePair<int, member> m in Nano.Guilds[CSocket.Client.gid].Members)
if (m.Value.Name == str)
{
t = true;
m.Value.isDL = false;
if (Nano.ClientPool.ContainsKey(m.Key))
{
Nano.ClientPool[m.Value.ID].Client.gpo = 50;
Guild.refresh(Nano.ClientPool[m.Value.ID]);
Spawn.All(CSocket);
break;
}
else
{
Text("The player you want to remove DL must be online.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
break;
}
}
if (!t)
{
Text("You do not have that member.", CSocket);
Link("OK.", 255, CSocket);
End(CSocket);
}
}
break;
}
15. In GS>PacketProcessor.cs search for:
Code:
case 2031: //Initial NPC talk
then replace:
Code:
case 2031: //Initial NPC talk
{
int ID = ReadLong(Data, 4);
Handler.NpcTalk(CSocket, ID, 0);
break;
}
case 2032: //Reply NPC Talk
{
int ID = CSocket.Client.LastNPC;
int LinkBack = Data[10];
if(LinkBack != 255)
Handler.NpcTalk(CSocket, ID, LinkBack);
break;
}
with:
Code:
case 2031: //Initial NPC talk
{
int ID = ReadLong(Data, 4);
Handler.NpcTalk(CSocket, ID, 0,data);
break;
}
case 2032: //Reply NPC Talk
{
int ID = CSocket.Client.LastNPC;
int LinkBack = Data[10];
if(LinkBack != 255)
Handler.NpcTalk(CSocket, ID, LinkBack,data);
break;
}
foreach (KeyValuePair<int, Guild> GD in Nano.Guilds)
CSocket.Send(ConquerPacket.GName(GD.Value.ID, GD.Value.Name));
Guild.refresh(CSocket);
Spawn.MeTo(CSocket);
17. Last thing what you must do is edit your database. Find Members column under guilds tabble and change type to Text and allow null and Leader to vchar(26)you can execute that sql script in phpmyadmin to do it for you:
Code:
ALTER TABLE `guilds` CHANGE `Members` `Members` TEXT CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL
ALTER TABLE `guilds` CHANGE `Leader` `Leader` VARCHAR( 26 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NOT NULL
public static void refresh(ClientSocket CSocket)
{
if (CSocket.Client.InGuild && Nano.Guilds.ContainsKey(CSocket.Client.gid))
{
Guild gd = Nano.Guilds[CSocket.Client.gid];
CSocket.Send(ConquerPacket.GName(CSocket.Client.gid, CSocket.Client.gna));
CSocket.Send(ConquerPacket.Ginfo(gd, CSocket.Client));
CSocket.Send(ConquerPacket.Chat(0, "SYSTEM", CSocket.Client.Name, gd.Bulletin, Struct.ChatType.GuildBulletin));
foreach(int e in Nano.Guilds[CSocket.Client.gid].Enemy)
CSocket.Send(ConquerPacket.GSend(e,9));
foreach (int a in Nano.Guilds[CSocket.Client.gid].Allies)
CSocket.Send(ConquerPacket.GSend(a, 7));
}
}
2. Open GS>Database>Database.cs
Under public static void LoadGuilds() look for:
Code:
if (!Nano.Guilds.ContainsKey(GD.ID))
{
Nano.Guilds.Add(GD.ID, GD);
}
and before it add:
Code:
tmp = Convert.ToString(DR["Enemies"]);
if (tmp != "")
{
string[] AllEn = tmp.Split(':');
foreach(string e in AllEn)
GD.Enemy.Add(int.Parse(e));
}
tmp = "";
tmp = Convert.ToString(DR["Allies"]);
if (tmp != "")
{
string[] AllEn = tmp.Split(':');
foreach (string a in AllEn)
if (!GD.Enemy.Contains(int.Parse(a)))
GD.Allies.Add(int.Parse(a));
}
string packEnemy = "", packAlly = "";
first = true;
foreach (int e in GD.Enemy)
if (first)
{
packEnemy = e.ToString();
first = false;
}
else
packEnemy += ":" + e.ToString();
first = true;
foreach (int a in GD.Allies)
if(!GD.Enemy.Contains(a))
if (first)
{
packAlly = a.ToString();
first = false;
}
else
packAlly += ":" + a.ToString();
Cmd = new MySqlCommand("UPDATE `guilds` SET `Bulletin` = '" + GD.Bulletin + "', `Fund` = " + GD.Fund + ", `Members` = '" + packmemb + "', `Enemies` = '" + packEnemy + "', `Allies` = '" + packAlly + "', `Leader` = '" + GD.Leader.ID + ":" + GD.Leader.Name + "' WHERE `GuildID` = " + GD.ID, DatabaseConnection.NewConnection());
3. Go to GS>Handlers>NPCTalk.cs
search for:
Code:
case 10003: // Guild Controler
{
if (LinkBack == 0)
{
Text("I am in charge of all the guilds in TwinCity, You may consult me for anything related to the guilds.", CSocket);
Link("Create a Guild.", 1, CSocket);
Link("Deputize.", 2, CSocket);
Link("Remove from Office.", 7, CSocket);
Link("Disband.", 3, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
and replace it with:
Code:
case 10003: // Guild Controler
{
if (LinkBack == 0)
{
Text("I am in charge of all the guilds in TwinCity, You may consult me for anything related to the guilds.", CSocket);
Link("Create a Guild.", 1, CSocket);
Link("Deputize.", 2, CSocket);
Link("Remove from Office.", 7, CSocket);
Link("Disband.", 3, CSocket);
Link("More.", 9, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
if (LinkBack == 9)
{
Text("I am in charge of all the guilds in TwinCity, You may consult me for anything related to the guilds.", CSocket);
Link("Make Allay.", 10, CSocket);
Link("Make Enemy.", 14, CSocket);
Link("Cancel Allay.", 12, CSocket);
Link("Cancel Enemy.", 16, CSocket);
Link("Back.", 0, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else if (LinkBack == 10)
{
if (CSocket.Client.gpo==100)
{
Text("Team Up with other Guild Leader and Press OK when ready.", CSocket);
Link("OK.", 11, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Only Guild Leader can make alliance.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 11)
{
if (CSocket.Client.gpo == 100)
{
if(CSocket.Client.Team!=null&&CSocket.Client.Team.Members.Count>=2)
foreach(KeyValuePair<int,ClientSocket> OL in CSocket.Client.Team.Members)
if(OL.Value.Client.gpo==100&&OL.Value.Client.ID!=CSocket.Client.ID)
if(Nano.Guilds[CSocket.Client.gid].Allies.Count<5&&Nano.Guilds[OL.Value.Client.gid].Allies.Count<5)
if (!Nano.Guilds[CSocket.Client.gid].Allies.Contains(OL.Value.Client.gid) && !Nano.Guilds[OL.Value.Client.gid].Allies.Contains(CSocket.Client.gid))
{
Nano.Guilds[CSocket.Client.gid].Allies.Add((int)OL.Value.Client.gid);
Nano.Guilds[OL.Value.Client.gid].Allies.Add((int)CSocket.Client.gid);
if (Nano.Guilds[CSocket.Client.gid].Enemy.Contains(OL.Value.Client.gid))
Nano.Guilds[CSocket.Client.gid].Enemy.Remove(OL.Value.Client.gid);
if (Nano.Guilds[OL.Value.Client.gid].Enemy.Contains(CSocket.Client.gid))
Nano.Guilds[OL.Value.Client.gid].Enemy.Remove(CSocket.Client.gid);
Database.Database.UpdateGuild(Nano.Guilds[CSocket.Client.gid]);
Database.Database.UpdateGuild(Nano.Guilds[OL.Value.Client.gid]);
foreach (KeyValuePair<int, ClientSocket> cs in Nano.ClientPool)
{
if (cs.Value.Client.gid == OL.Value.Client.gid && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(CSocket.Client.gid, 7));
Guild.refresh(cs.Value);
}
if (cs.Value.Client.gid == CSocket.Client.gid && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(OL.Value.Client.gid, 7));
Guild.refresh(cs.Value);
}
}
}
}
}
else if (LinkBack == 12)
{
if (CSocket.Client.gpo == 100)
{
Text("Enter guildname with you want cancel alliance.", CSocket);
Input(13, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Only GuildLeader can cancel alliance.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 13)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
int id = 0;
foreach (KeyValuePair<int, Guild> gd in Nano.Guilds)
if (gd.Value.Name == str)
{
id = gd.Value.ID;
if (Nano.Guilds[CSocket.Client.gid].Allies.Contains(id))
Nano.Guilds[CSocket.Client.gid].Allies.Remove(id);
if (Nano.Guilds[id].Allies.Contains(CSocket.Client.gid))
Nano.Guilds[id].Allies.Remove(CSocket.Client.gid);
Database.Database.UpdateGuild(Nano.Guilds[CSocket.Client.gid]);
Database.Database.UpdateGuild(Nano.Guilds[id]);
CSocket.Send(ConquerPacket.GSend(id, 8));
Guild.refresh(CSocket);
foreach (KeyValuePair<int, ClientSocket> cs in Nano.ClientPool)
{
if (cs.Value.Client.gid == id&&Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(CSocket.Client.gid, 8));
Guild.refresh(cs.Value);
}
if (cs.Value.Client.gid == CSocket.Client.gid && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(id, 8));
Guild.refresh(cs.Value);
}
}
}
}
else if (LinkBack == 14)
{
if (CSocket.Client.gpo == 100)
{
Text("Enter guildname with you want to make enemy.", CSocket);
Input(15, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Only GuildLeader can make enemy guild.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 15)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
int id = 0;
foreach (KeyValuePair<int, Guild> gd in Nano.Guilds)
if (gd.Value.Name == str)
{
id = gd.Value.ID;
if (Nano.Guilds[CSocket.Client.gid].Allies.Contains(id))
Nano.Guilds[CSocket.Client.gid].Allies.Remove(id);
if (Nano.Guilds[id].Allies.Contains(CSocket.Client.gid))
Nano.Guilds[id].Allies.Remove(CSocket.Client.gid);
Nano.Guilds[CSocket.Client.gid].Enemy.Add(id);
Database.Database.UpdateGuild(Nano.Guilds[CSocket.Client.gid]);
Database.Database.UpdateGuild(Nano.Guilds[id]);
CSocket.Send(ConquerPacket.GSend(id, 9));
Guild.refresh(CSocket);
foreach (KeyValuePair<int, ClientSocket> cs in Nano.ClientPool)
{
if (cs.Value.Client.gid == id && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(CSocket.Client.gid, 8));
Guild.refresh(cs.Value);
}
if (cs.Value.Client.gid == CSocket.Client.gid && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(id, 9));
Guild.refresh(cs.Value);
}
}
}
}
else if (LinkBack == 16)
{
if (CSocket.Client.gpo == 100)
{
Text("Enter guildname with you want cancel enemy.", CSocket);
Input(17, CSocket);
Link("No, thanks.", 255, CSocket);
End(CSocket);
}
else
{
Text("Sorry. Only GuildLeader can cancel alliance.", CSocket);
Link("Ahhh.", 255, CSocket);
End(CSocket);
}
}
else if (LinkBack == 17)
{
string str = "";
for (int i = 14; i < 14 + data[13]; i++)
{
str += Convert.ToChar(data[i]);
}
int id = 0;
foreach (KeyValuePair<int, Guild> gd in Nano.Guilds)
if (gd.Value.Name == str)
{
id = gd.Value.ID;
if (Nano.Guilds[CSocket.Client.gid].Enemy.Contains(id))
Nano.Guilds[CSocket.Client.gid].Enemy.Remove(id);
Database.Database.UpdateGuild(Nano.Guilds[CSocket.Client.gid]);
CSocket.Send(ConquerPacket.GSend(id, 8));
Guild.refresh(CSocket);
foreach (KeyValuePair<int, ClientSocket> cs in Nano.ClientPool)
{ if (cs.Value.Client.gid == CSocket.Client.gid && Nano.ClientPool.ContainsKey(cs.Value.Client.ID))
{
cs.Value.Send(ConquerPacket.GSend(id, 8));
Guild.refresh(cs.Value);
}
}
}
}
In Entities>Guild.cs after
Code:
public string Bulletin; //Bulletin
add:
Code:
public List<int> Allies = new List<int>();
public List<int> Enemy = new List<int>();
he forgot to post the definitions for Enemy and ally.... but i tryied to make my self whith strings... and others but does not work... i don't know what type of definitions he make... i think i will need to make something more specifyc...
he forgot to post the definitions for Enemy and ally.... but i tryied to make my self whith strings... and others but does not work... i don't know what type of definitions he make... i think i will need to make something more specifyc...
(sorry for bad english haha)
Sorry for that.
In Entities>Guild.cs after
Code:
public string Bulletin; //Bulletin
add:
Code:
public List<int> Allies = new List<int>();
public List<int> Enemy = new List<int>();
[HELP] with Guilds 06/11/2010 - Shaiya - 6 Replies Ok guilds dont store in database.
We can make a guild in game. but it doesnt store in database and it doesnt store the guildchars either.
When we restart server it disappears.
yes i have tried the forums and ran the sql scripts that are release but still didnt fix problem
SO im asking if anyone know why this is happening.
Guilds 05/26/2010 - Shaiya Private Server - 2 Replies Ok just a quick question i had jus re-released my Shaiya Private server and i had noticed in game that there were numerous guilds i went an looked in the database an the guilds were not registered in the database how can i go about fixing that so i can actually see that and kno that if i were to restart the server it doesnt delete the guilds