Example #1
0
        public static void JoinClan(Client.GameState client)
        {
            MySqlCommand cmd3 = new MySqlCommand(MySqlCommandType.UPDATE);
            cmd3.Update("entities").Set("ClanID", client.Entity.Myclan.ClanId).Set("ClanRank", client.Entity.Myclan.Members[client.Entity.UID].Rank)
                .Set("ClanDonation", client.Entity.Myclan.Members[client.Entity.UID].Donation).Where("UID", client.Entity.UID).Execute();

            Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
            client.Send(cl.ToArray());
        }
Example #2
0
        public static void CreateClan(Client.GameState client)
        {
            uint clanid = Game.Clans.ClanCount.Next;
            //clanid = (uint)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 40000);
            //if (Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(clanid))
              //  while (!Conquer_Online_Server.ServerBase.Kernel.ServerClans.ContainsKey(clanid))
                //    clanid = (uint)Conquer_Online_Server.ServerBase.Kernel.Random.Next(1, 400000);

            client.Entity.Myclan.ClanId = clanid;
            MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
            cmd.Insert("Clans").Insert("Name", client.Entity.Myclan.ClanName).Insert("ClanID", clanid)
                .Insert("Leader", client.Entity.Name).Insert("Fund", 500000).Execute();

            MySqlCommand cmd3 = new MySqlCommand(MySqlCommandType.UPDATE);
            cmd3.Update("entities").Set("ClanID", client.Entity.Myclan.ClanId).Set("ClanRank", client.Entity.Myclan.Members[client.Entity.UID].Rank)
                .Set("ClanDonation", client.Entity.Myclan.Members[client.Entity.UID].Donation).Where("UID", client.Entity.UID).Execute();

            client.Entity.ClanRank = 100;
            client.Entity.ClanName = client.Entity.Myclan.ClanName;
            client.Entity.ClanId = clanid;
            Network.GamePackets.Clan cl = new Conquer_Online_Server.Network.GamePackets.Clan(client, 1);
            client.Send(cl.ToArray());
            Conquer_Online_Server.ServerBase.Kernel.ServerClans.Add(clanid, client.Entity.Myclan);
        }