本文整理汇总了C#中Conquer_Online_Server.Database.MySqlCommand.Execute方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlCommand.Execute方法的具体用法?C# MySqlCommand.Execute怎么用?C# MySqlCommand.Execute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Conquer_Online_Server.Database.MySqlCommand
的用法示例。
在下文中一共展示了MySqlCommand.Execute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeleteItem
public static void DeleteItem(uint UID)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE);
int res = cmd.Delete("items", "UID", UID).Execute();
MySqlCommand cmds = new MySqlCommand(MySqlCommandType.DELETE).Delete("items", "UID", UID);
cmds.Execute();
}
示例2: SaveHorseRaceStatistics
public static void SaveHorseRaceStatistics(Network.GamePackets.HorseRaceStatistic stats, MySql.Data.MySqlClient.MySqlConnection conn)
{
var cmd = new MySqlCommand(MySqlCommandType.UPDATE).Update("HorseRace")
.Set("EntityName", stats.Name)
.Set("Rank", stats.Rank)
.Set("CurrentPts", stats.CurrentPts)
.Where("EntityID", stats.EntityID);
cmd.Execute(conn);
}
示例3: 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();
}
示例4: 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;
}
示例5: DeleteTabelTop2
public static void DeleteTabelTop2(Client.GameState C)
{
MySqlCommand cmds = new MySqlCommand(MySqlCommandType.DELETE)
.Delete("Top2", "TopTrojan2", C.Entity.TopTrojan2)
.Delete("Top2", "TopWarrior2", C.Entity.TopWarrior2)
.Delete("Top2", "TopMonk2", C.Entity.TopMonk2)
.Delete("Top2", "TopNinja2", C.Entity.TopNinja2)
.Delete("Top2", "TopWaterTaoist2", C.Entity.TopWaterTaoist2)
.Delete("Top2", "TopArcher2", C.Entity.TopArcher2)
.Delete("Top2", "TopFireTaoist2", C.Entity.TopFireTaoist2)
.Delete("Top2", "UID", C.Entity.UID);
cmds.Execute();
}
示例6: AddItem
public static void AddItem(ref Interfaces.IConquerItem Item, Client.GameState client)
{
try
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("items").Insert("EntityID", client.Entity.UID).Insert("UID", Item.UID)
.Insert("ID", Item.ID).Insert("Plus", Item.Plus).Insert("Bless", Item.Bless)
.Insert("Enchant", Item.Enchant).Insert("SocketOne", (byte)Item.SocketOne)
.Insert("SocketTwo", (byte)Item.SocketTwo).Insert("Durability", Item.Durability)
.Insert("MaximDurability", Item.MaximDurability).Insert("SocketProgress", Item.SocketProgress)
.Insert("PlusProgress", Item.PlusProgress).Insert("Effect", (ushort)Item.Effect)
.Insert("Bound", Item.Bound).Insert("Locked", Item.Lock).Insert("Suspicious", Item.Suspicious)
.Insert("Color", (uint)Item.Color).Insert("Position", Item.Position).Insert("Warehouse", Item.Warehouse)
.Insert("UnlockEnd", Item.UnlockEnd.ToBinary()).Insert("SuspiciousStart", Item.SuspiciousStart.ToBinary())
.Insert("StackSize", Item.StackSize).Insert("MaxStackSize", Item.MaxStackSize);
cmd.Execute();
}
catch
{
again:
Item.UID = Conquer_Online_Server.Network.GamePackets.ConquerItem.ItemUID.Next;
if (IsThere(Item.UID))
goto again;
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("items").Insert("EntityID", client.Entity.UID).Insert("UID", Item.UID)
.Insert("ID", Item.ID).Insert("Plus", Item.Plus).Insert("Bless", Item.Bless)
.Insert("Enchant", Item.Enchant).Insert("SocketOne", (byte)Item.SocketOne)
.Insert("SocketTwo", (byte)Item.SocketTwo).Insert("Durability", Item.Durability)
.Insert("MaximDurability", Item.MaximDurability).Insert("SocketProgress", Item.SocketProgress)
.Insert("PlusProgress", Item.PlusProgress).Insert("Effect", (ushort)Item.Effect)
.Insert("Bound", Item.Bound).Insert("Locked", Item.Lock).Insert("Suspicious", Item.Suspicious)
.Insert("Color", (uint)Item.Color).Insert("Position", Item.Position).Insert("Warehouse", Item.Warehouse)
.Insert("UnlockEnd", Item.UnlockEnd.ToBinary()).Insert("SuspiciousStart", Item.SuspiciousStart.ToBinary())
.Insert("StackSize", Item.StackSize).Insert("MaxStackSize", Item.MaxStackSize);
cmd.Execute();
}
}
示例7: ResetTopGL
public static void ResetTopGL()
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Select("entities").Set("TopGuildLeader", 0).Where("TopGuildLeader", 1); cmd.Execute();
}
示例8: ResetTopDL
public static void ResetTopDL()
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("entities").Set("TopDeputyLeader", 0).Where("TopDeputyLeader", 1); cmd.Execute();
}
示例9: RemoveItem
public static void RemoveItem(uint UID)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
int res = cmd.Update("items").Set("EntityID", 0).Set("Position", 0).Where("UID", UID).Execute();
MySqlCommand cmds = new MySqlCommand(MySqlCommandType.DELETE).Delete("items", "UID", UID);
cmds.Execute();
}
示例10: DetainItem
public static void DetainItem(Interfaces.IConquerItem item, Client.GameState owner, Client.GameState gainer)
{
DetainedItem Item = new DetainedItem(true);
Item.ItemUID = item.UID;
Item.Item = item;
Item.UID = Item.ItemUID - 1;
Item.ConquerPointsCost = CalculateCost(item);
Item.OwnerUID = owner.Entity.UID;
Item.OwnerName = owner.Entity.Name;
Item.GainerUID = gainer.Entity.UID;
Item.GainerName = gainer.Entity.Name;
Item.Date = DateTime.Now;
Item.DaysLeft = 0;
owner.DeatinedItem.Add(Item.UID, Item);
owner.Send(Item);
DetainedItem Item2 = new DetainedItem(true);
Item2.ItemUID = item.UID;
Item2.UID = Item2.ItemUID - 1;
Item2.Item = item;
Item2.Page = (byte)DetainedItem.ClaimPage;
Item2.ConquerPointsCost = CalculateCost(item);
Item2.OwnerUID = gainer.Entity.UID;
Item2.GainerName = gainer.Entity.Name;
Item2.GainerUID = owner.Entity.UID;
Item2.OwnerName = owner.Entity.Name;
Item2.Date = Item.Date;
Item2.DaysLeft = 0;
gainer.ClaimableItem.Add(Item2.UID, Item2);
gainer.Send(Item2);
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT)
.Insert("detaineditems")
.Insert("ItemUID", item.UID)
.Insert("ConquerPointsCost", Item.ConquerPointsCost)
.Insert("Date", Item.Date.Ticks)
.Insert("OwnerUID", owner.Entity.UID)
.Insert("OwnerName", owner.Entity.Name)
.Insert("GainerUID", gainer.Entity.UID)
.Insert("GainerName", gainer.Entity.Name);
//.Where("ItemUID", item.UID);
cmd.Execute();
}
示例11: Claim
public static void Claim(DetainedItem item, Client.GameState owner)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE).Delete("detaineditems", "ItemUID", item.Item.UID).And("GainerUID", owner.Entity.UID);
cmd.Execute();
}
示例12: Redeem
public static void Redeem(DetainedItem item, Client.GameState owner)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE)
.Update("detaineditems").Set("OwnerUID", 500).Where("ItemUID", item.Item.UID).And("OwnerUID", owner.Entity.UID);
cmd.Execute();
}
示例13: SaveArenaStatistics
public static void SaveArenaStatistics(Network.GamePackets.ArenaStatistic stats)
{
var cmd = new MySqlCommand(MySqlCommandType.UPDATE).Update("arena")
.Set("LastSeasonRank", stats.LastSeasonRank)
.Set("ArenaPoints", stats.ArenaPoints)
.Set("TodayWin", stats.TodayWin)
.Set("TodayBattles", stats.TodayBattles)
.Set("LastSeasonWin", stats.LastSeasonWin)
.Set("LastSeasonLose", stats.LastSeasonLose)
.Set("TotalWin", stats.TotalWin)
.Set("TotalLose", stats.TotalLose)
.Set("HistoryHonor", stats.HistoryHonor)
.Set("CurrentHonor", stats.CurrentHonor)
.Set("Level", stats.Level)
.Set("Class", stats.Class)
.Set("ArenaPointFill", stats.LastArenaPointFill.Ticks)
.Set("Model", stats.Model)
.Set("LastSeasonArenaPoints", stats.LastSeasonArenaPoints)
.Where("EntityID", stats.EntityID);
cmd.Execute();
}
示例14: DeletVotes
public static void DeletVotes(PlayersVot PlayerVot)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.DELETE).Delete("VoteIp", "ID", PlayerVot.Uid).And("IP", PlayerVot.AdressIp);
cmd.Execute();
}
示例15: ResetTopWater2
public static void ResetTopWater2()
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("entities").Set("TopWaterTaoist2", 0).Where("TopWaterTaoist2", 1); cmd.Execute();
}