本文整理汇总了C#中Conquer_Online_Server.Database.MySqlCommand.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlCommand.Insert方法的具体用法?C# MySqlCommand.Insert怎么用?C# MySqlCommand.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conquer_Online_Server.Database.MySqlCommand
的用法示例。
在下文中一共展示了MySqlCommand.Insert方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SaveProficiencies
public static void SaveProficiencies(Client.GameState client)
{
if (client.Entity == null)
return;
if (client.Proficiencies == null)
return;
if (client.Proficiencies.Count == 0)
return;
foreach (Interfaces.ISkill proficiency in client.Proficiencies.Values)
{
if(proficiency.Available)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("skills").Set("Level", proficiency.Level).Set("PreviousLevel", proficiency.PreviousLevel)
.Set("Experience", proficiency.Experience).Where("EntityID", client.Entity.UID).And("ID", proficiency.ID).Execute();
}
else
{
proficiency.Available = true;
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("skills").Insert("Level", proficiency.Level).Insert("Experience", proficiency.Experience).Insert("EntityID", client.Entity.UID)
.Insert("Type", "Proficiency").Insert("ID", proficiency.ID).Execute();
}
}
}
示例2: CreateArsenal
public static void CreateArsenal(ushort gID, Game.ConquerStructures.Society.ArsenalType Type)
{
if (!ContainsArsenal(gID))
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("guild_arsenals").Insert("guild_uid", gID).Execute();
}
else
{
string val = "";
switch (Type)
{
case ArsenalType.Headgear: val = "head_allowed"; break;
case ArsenalType.Armor: val = "armor_allowed"; break;
case ArsenalType.Weapon: val = "weapon_allowed"; break;
case ArsenalType.Ring: val = "ring_allowed"; break;
case ArsenalType.Boots: val = "boots_allowed"; break;
case ArsenalType.Necklace: val = "neck_allowed"; break;
case ArsenalType.Fan: val = "fan_allowed"; break;
case ArsenalType.Tower: val = "tower_allowed"; break;
}
if (val != "")
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("guild_arsenals").Set(val, 1).Execute();
}
}
}
示例3: Inscribe
public static void Inscribe(Game.ConquerStructures.Society.ArsenalType Type, uint Donation, Interfaces.IConquerItem item, Game.Entity Entity)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("guild_arsenalsdonation").Insert("d_uid", Entity.UID).Insert("guild_uid", Entity.GuildID).Insert("name", Entity.Name).Insert("item_uid", item.UID).Insert("item_donation", Donation).Insert("item_arsenal_type", (byte)Type).Execute();
cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("items").Set("Inscribed", 1).Where("UID", item.UID).Execute();
}
示例4: Insert
public static void Insert(Game.Entity Entity, byte id)
{
MySqlCommand Command = new MySqlCommand(MySqlCommandType.INSERT);
Command.Insert("subclasses")
.Insert("uid", id)
.Insert("id", Entity.UID)
.Execute();
}
示例5: AddPartner
public static void AddPartner(Client.GameState client, TradePartner partner)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("partners").Insert("entityid", client.Entity.UID).Insert("partnerid", partner.ID)
.Insert("partnername", partner.Name).Insert("probationstartedon", partner.ProbationStartedOn.Ticks).Execute();
cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("partners").Insert("entityid", partner.ID).Insert("partnerid", client.Entity.UID)
.Insert("partnername", client.Entity.Name).Insert("probationstartedon", partner.ProbationStartedOn.Ticks).Execute();
}
示例6: AddRelation
public void AddRelation(UInt32 Relative, Network.GamePackets.ClanRelations.RelationTypes type)
{
MySqlCommand Command = new MySqlCommand(MySqlCommandType.INSERT);
Command.Insert("clanrelation")
.Insert("clanid", this.ClanId)
.Insert("AssociatedId", Relative)
.Insert("type", Convert.ToByte(type))
.Execute();
}
示例7: AddFriend
public static void AddFriend(Client.GameState client, Friend friend)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("friends").Insert("entityid", client.Entity.UID).Insert("friendid", friend.ID)
.Insert("friendname", friend.Name).Execute();
cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("friends").Insert("entityid", friend.ID).Insert("friendid", client.Entity.UID)
.Insert("friendname", client.Entity.Name).Execute();
}
示例8: Create
public static void Create(Game.ConquerStructures.Society.Guild guild)
{
MySqlCommand command = new MySqlCommand(MySqlCommandType.INSERT);
command.Insert("guilds").
Insert("ID", guild.ID).
Insert("Name", guild.Name).
Insert("SilverFund", 500000).
Insert("LeaderName", guild.LeaderName);
command.Execute();
}
示例9: AddPurification
public static void AddPurification(ItemAdding.Purification_ purification)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("itemadding")
.Insert("uid", purification.ItemUID)
.Insert("addingtype", 0)
.Insert("addingid", purification.PurificationItemID)
.Insert("addinglevel", purification.PurificationLevel)
.Insert("duration", purification.PurificationDuration)
.Insert("addedon", purification.AddedOn.Ticks).Execute();
}
示例10: AddExtraEffect
public static void AddExtraEffect(ItemAdding.Refinery_ extraeffect)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("itemadding")
.Insert("uid", extraeffect.ItemUID)
.Insert("addingtype", 1)
.Insert("addingid", extraeffect.EffectID)
.Insert("addinglevel", extraeffect.EffectLevel)
.Insert("addingpercent", extraeffect.EffectPercent)
.Insert("duration", extraeffect.EffectDuration)
.Insert("addedon", extraeffect.AddedOn.Ticks).Execute();
}
示例11: CreateEntity
public static bool CreateEntity(Network.GamePackets.EnitityCreate eC, Client.GameState client, ref string message)
{
if (eC.Name.Length > 16)
eC.Name = eC.Name.Substring(0, 16);
if (eC.Name == "")
return false;
if (InvalidCharacters(eC.Name))
{
message = "Invalid characters inside the name.";
return false;
}
var rdr = new MySqlReader(new MySqlCommand(MySqlCommandType.SELECT).Select("entities").Where("name", eC.Name));
if (rdr.Read())
{
rdr.Close();
message = "The chosen name is already in use.";
return false;
}
rdr.Close();
client.Entity = new Game.Entity(Game.EntityFlag.Player, false);
client.Entity.Name = eC.Name;
DataHolder.GetStats(eC.Class, 1, client);
client.Entity.UID = Program.EntityUID.Next;
new MySqlCommand(MySqlCommandType.UPDATE).Update("configuration").Set("EntityID", client.Entity.UID).Where("Server", ServerBase.Constants.ServerName).Execute();
client.CalculateStatBonus();
client.CalculateHPBonus();
client.Entity.Hitpoints = client.Entity.MaxHitpoints;
client.Entity.Mana = (ushort)(client.Entity.Spirit * 5);
client.Entity.Class = eC.Class;
client.Entity.Body = eC.Body;
if (eC.Body == 1003 || eC.Body == 1004)
client.Entity.Face = (ushort)ServerBase.Kernel.Random.Next(1, 50);
else
client.Entity.Face = (ushort)ServerBase.Kernel.Random.Next(201, 250);
byte Color = (byte)ServerBase.Kernel.Random.Next(4, 8);
client.Entity.HairStyle = (ushort)(Color * 100 + 10 + (byte)ServerBase.Kernel.Random.Next(4, 9));
client.Account.EntityID = client.Entity.UID;
client.Account.Save();
//723753
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("entities").Insert("Name", eC.Name).Insert("Owner", client.Account.Username).Insert("Class", eC.Class).Insert("UID", client.Entity.UID)
.Insert("Hitpoints", client.Entity.Hitpoints).Insert("Mana", client.Entity.Mana).Insert("Body", client.Entity.Body)
.Insert("Face", client.Entity.Face).Insert("HairStyle", client.Entity.HairStyle).Insert("Strength", client.Entity.Strength)
.Insert("Agility", client.Entity.Agility).Insert("Vitality", client.Entity.Vitality).Insert("Spirit", client.Entity.Spirit);
cmd.Execute();
message = "ANSWER_OK";
return true;
}
示例12: ProcessTransaction
public static void ProcessTransaction(Client.GameState owner, Client.GameState receiver, uint amount, TransactionLogAction action)
{
DateTime Date = DateTime.Now;
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("transactionlog").
Insert("owneruid", owner.Entity.UID).
Insert("receiveruid", receiver.Entity.UID).
Insert("amount", amount).
Insert("ownerhadamount", owner.Entity.ConquerPoints).
Insert("receiverhadamount", receiver.Entity.ConquerPoints).
Insert("type", (byte)action).
Insert("date", Date.ToString()).
Execute();
}
示例13: SaveFlowerRank
public static void SaveFlowerRank(Client.GameState C)
{
Game.Struct.Flowers F = C.Entity.MyFlowers;
if (Conquer_Online_Server.ServerBase.Kernel.AllFlower.ContainsKey(C.Entity.UID))
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("cq_flowers").Set("redroses", F.RedRoses).Set("redrosestoday", F.RedRoses2day).Set("lilies", F.Lilies).Set("liliestoday", F.Lilies2day).Set("tulips", F.Tulips).Set("tulipstoday", F.Tulips2day).Set("orchads", F.Orchads).Set("orchadstoday", F.Orchads2day).Where("charuid", C.Entity.UID).Execute();
}
else
{
Conquer_Online_Server.ServerBase.Kernel.AllFlower.Add(C.Entity.UID, F);
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("cq_flowers").Insert("Names", C.Entity.Name).Insert("charuid", C.Entity.UID).Insert("redroses", F.RedRoses).Insert("redrosestoday", F.RedRoses2day).Insert("lilies", F.Lilies).Insert("liliestoday", F.Lilies2day).Insert("tulips", F.Tulips).Insert("tulipstoday", F.Tulips2day).Insert("orchads", F.Orchads).Insert("orchadstoday", F.Orchads2day).Execute();
}
}
示例14: Lotto
public static void Lotto(Client.GameState client, bool New)
{
if (New)
{
client.LotteryEntries = 1;
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("quest").Insert("EntityName", client.Entity.Name).Insert("IP", client.IP).Insert("LottoDate", DateTime.Now.Ticks).Insert("LottoTries", 1).Insert("Username", client.Account.Username).Execute();
}
else
{
client.LotteryEntries += 1;
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("quest").Set("LottoDate", DateTime.Now.Ticks).Set("LottoTries", client.LotteryEntries).Set("Username", client.Account.Username).Where("EntityName", client.Entity.Name).Or("IP", client.IP).Execute();
}
}
示例15: getVp
public static void getVp(Client.GameState client)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT);
cmd.Select("premium").Where("EntityName", client.Entity.Name).Or("Username", client.Account.Username);
MySqlReader rdr = new MySqlReader(cmd);
if (rdr.Read())
{
client.VotePoints = rdr.ReadUInt32("VotePoint");
rdr.Close();
}
else
{
client.VotePoints = 0;
MySqlCommand Do = new MySqlCommand(MySqlCommandType.INSERT);
Do.Insert("premium").Insert("EntityName", client.Entity.Name).Insert("Username", client.Account.Username).Insert("VotePoint", 0).Insert("IP", client.IP).Execute();
rdr.Close();
}
}