本文整理汇总了C#中PhoenixProject.Database.MySqlCommand.Update方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlCommand.Update方法的具体用法?C# MySqlCommand.Update怎么用?C# MySqlCommand.Update使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhoenixProject.Database.MySqlCommand
的用法示例。
在下文中一共展示了MySqlCommand.Update方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CreateClan
public static void CreateClan(Client.GameState client)
{
try
{
uint clanid = Program.nextClanid;
Program.nextClanid++;
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", clanid).Set("ClanRank", "100")
.Set("ClanDonation", "500000").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 PhoenixProject.Network.GamePackets.Clan(client, 1);
client.Send(cl.ToArray());
PhoenixProject.ServerBase.Kernel.ServerClans.Add(clanid, client.Entity.Myclan);
Network.GamePackets.Clan cls = new PhoenixProject.Network.GamePackets.Clan(client, 1);
client.Send(cls.ToArray());
}
catch (Exception e)
{
Program.SaveException(e);
}
}
示例2: Disband
public static void Disband(Game.ConquerStructures.Society.Guild guild)
{
MySqlCommand command = new MySqlCommand(MySqlCommandType.UPDATE);
command.Update("entities").Set("GuildID", 0).Where("GuildID", guild.ID).Execute();
ServerBase.Kernel.Guilds.Remove(guild.ID);
command = new MySqlCommand(MySqlCommandType.DELETE);
command.Delete("guilds", "ID", guild.ID).Execute();
}
示例3: KimoUpdateName
public static void KimoUpdateName(Client.GameState client)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("entities");
PhoenixProject.Database.MySqlReader r = new PhoenixProject.Database.MySqlReader(cmd);
String name = "";
while (r.Read())
{
//newname = r.ReadString("namechange");//debug make
name = r.ReadString("name");
if (name != "")
{
MySqlCommand cmdupdate = null;//lol i see the problem hold on ,,, hold on what? :$ try now
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("apprentice").Set("MentorName", client.Entity.NewName).Where("MentorName", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("apprentice").Set("ApprenticeName", client.Entity.NewName).Where("ApprenticeName", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("arena").Set("EntityName", client.Entity.NewName).Where("EntityName", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("claimitems").Set("OwnerName", client.Entity.NewName).Where("OwnerName", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("claimitems").Set("GainerName", client.Entity.NewName).Where("GainerName", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("detaineditems").Set("OwnerName", client.Entity.NewName).Where("OwnerName", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("detaineditems").Set("GainerName", client.Entity.NewName).Where("GainerName", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("enemy").Set("EnemyName", client.Entity.NewName).Where("EnemyName", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("friends").Set("FriendName", client.Entity.NewName).Where("FriendName", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("guilds").Set("Name", client.Entity.NewName).Where("Name", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("guilds").Set("LeaderName", client.Entity.NewName).Where("LeaderName", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("nobility").Set("EntityName", client.Entity.NewName).Where("EntityName", name).Execute();
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("partners").Set("PartnerName", client.Entity.NewName).Where("PartnerName", name).Execute();
UpdateStaff(client);
return;
}
}
r.Close();
r.Dispose();
}
示例4: Update
public static void Update(Game.Entity Entity, Statement.SubClass SubClass)
{
MySqlCommand Command = new MySqlCommand(MySqlCommandType.UPDATE);
Command.Update("subclasses")
.Set("phase", SubClass.Phase)
.Set("level", SubClass.Level)
.Where("id", Entity.UID)
.And("uid", SubClass.ID)
.Execute();
}
示例5: Save
public void Save()
{
if (exists)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("accounts").Set("Password", Password).Set("IP", IP).Set("EntityID", EntityID).Set("LastCheck", (ulong)DateTime.Now.ToBinary()).Where("Username", Username).Execute();
}
else
{
try
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("accounts").Insert("Username", Username).Insert("Password", Password).Insert("State", (byte)State).Execute();
}
catch (Exception e) { Program.SaveException(e); }
}
}
示例6: PkExploitAdd
public static void PkExploitAdd(Client.GameState client, uint UIDEnemy, Game.PkExpeliate pk)
{
MySqlCommand cmds = new MySqlCommand(MySqlCommandType.SELECT);
cmds.Select("pk_explorer").Where("uid", client.Account.EntityID);
MySqlReader rdr = new MySqlReader(cmds);
if (rdr.Read())
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("pk_explorer")
.Set("killed_uid", UIDEnemy)
.Set("killed_name", pk.Name).Set("killed_map", pk.KilledAt)
.Set("lost_exp", pk.LostExp).Set("times", pk.Times++)
.Set("battle_power", pk.Potency).Set("level", pk.Level);
cmd.Execute();
if (!client.Entity.PkExplorerValues.ContainsKey(pk.UID))
{
client.Entity.PkExplorerValues.Add(pk.UID, pk);
}
else
{
client.Entity.PkExplorerValues.Remove(pk.UID);
client.Entity.PkExplorerValues.Add(pk.UID, pk);
}
}
else
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("pk_explorer")
.Insert("uid", pk.UID).Insert("killed_uid", UIDEnemy)
.Insert("killed_name", pk.Name).Insert("killed_map", pk.KilledAt)
.Insert("lost_exp", pk.LostExp).Insert("times", pk.Times)
.Insert("battle_power", pk.Potency).Insert("level", pk.Level);
cmd.Execute();
if (!client.Entity.PkExplorerValues.ContainsKey(pk.UID))
client.Entity.PkExplorerValues.Add(pk.UID, pk);
}
rdr.Close();
rdr.Dispose();
}
示例7: UpdateNames
public static void UpdateNames()
{
Dictionary<String, NameChangeC> UPDATE = new Dictionary<string, NameChangeC>();
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.SELECT).Select("nobility");
PhoenixProject.Database.MySqlReader r = new PhoenixProject.Database.MySqlReader(cmd);
// String newname = "", name = "";
int UID;
ulong Donation;
while (r.Read())
{
//newname = r.ReadString("namechange");
//name = r.ReadString("name");
UID = (int)r.ReadInt64("EntityUID");
Donation = (ulong)r.ReadInt64("Donation");
if (Donation != 0)
{
MySqlCommand cmdupdate = null;
cmdupdate = new MySqlCommand(MySqlCommandType.UPDATE);
cmdupdate.Update("entities").Set("Donation", Donation).Where("UID", UID).Execute();
Console.WriteLine("Donation Set.");
}
}
r.Close();
r.Dispose();
}
示例8: JoinClan
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 PhoenixProject.Network.GamePackets.Clan(client, 1);
client.Send(cl.ToArray());
//Console.WriteLine("111100");
}
示例9: SaveClientDonation
public static void SaveClientDonation(Client.GameState client)
{
MySqlCommand cmd3 = new MySqlCommand(MySqlCommandType.UPDATE);
cmd3.Update("entities").Set("ClanDonation", client.Entity.Myclan.Members[client.Entity.UID].Donation).Where("ClanId", client.Entity.Myclan.ClanId)
.And("UID", client.Entity.UID).Execute();
// Console.WriteLine("9999");
}
示例10: UpdateKills
public void UpdateKills(Client.GameState h)
{
MySqlCommand cmd3 = new MySqlCommand(MySqlCommandType.UPDATE);
cmd3.Update("heroquests").Set("step", h.MonsterHunterStats.Kills).Where("hero", h.Entity.UID).And("quest", 0xb71b0).Execute();
}
示例11: UpdateBulletin
public static void UpdateBulletin(Game.ConquerStructures.Society.Guild guild, string bulletin)
{
MySqlCommand command = new MySqlCommand(MySqlCommandType.UPDATE);
command.Update("guilds").Set("Bulletin", guild.Bulletin).Where("ID", guild.ID).Execute();
}
示例12: SaveSpells
public static void SaveSpells(Client.GameState client, MySql.Data.MySqlClient.MySqlConnection conn)
{
if (client.Entity == null)
return;
if (client.Spells == null)
return;
if (client.Spells.Count == 0)
return;
foreach (Interfaces.ISkill spell in client.Spells.Values)
{
if (spell.Available)
{
if (spell.TempLevel != spell.Level)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("skills").Set("Level", spell.Level).Set("TempLevel", spell.Level).Set("PreviousLevel", spell.PreviousLevel)
.Set("Experience", spell.Experience).Where("EntityID", client.Entity.UID).And("ID", spell.ID).Execute();
}
}
else
{
spell.Available = true;
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("skills").Insert("Level", spell.Level).Insert("TempLevel", spell.Level).Insert("Experience", spell.Experience).Insert("EntityID", client.Entity.UID)
.Insert("ID", spell.ID).Execute();
}
}
}
示例13: SaveProficiencies
public static void SaveProficiencies(Client.GameState client, MySql.Data.MySqlClient.MySqlConnection conn)
{
if (client.Entity == null)
return;
if (client.Proficiencies == null)
return;
if (client.Proficiencies.Count == 0)
return;
foreach (Interfaces.IProf proficiency in client.Proficiencies.Values)
{
if (proficiency.Available)
{
if (proficiency.TempLevel != proficiency.Level)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("profs").Set("Level", proficiency.Level).Set("TempLevel", 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("profs").Insert("Level", proficiency.Level).Insert("TempLevel", proficiency.Level).Insert("Experience", proficiency.Experience).Insert("EntityID", client.Entity.UID)
.Insert("ID", proficiency.ID).Execute();
}
}
}
示例14: Savekimo
public void Savekimo()
{
if (exists)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("accounts").Set("State", 80).Where("Username", Username).Execute();
}
else
{
try
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("accounts").Insert("Username", Username).Insert("Password", Password).Insert("State", (byte)State).Execute();
}
catch (Exception e) { Program.SaveException(e); }
}
}
示例15: SaveFlowerTable
public static void SaveFlowerTable(GameState client)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.UPDATE);
cmd.Update("flowers").Set("id", (long)((ulong)client.Entity.UID)).Set("redroses", (long)((ulong)client.Entity.Flowers.RedRoses)).Set("redrosestoday", (long)((ulong)client.Entity.Flowers.RedRoses2day)).Set("lilies", (long)((ulong)client.Entity.Flowers.Lilies)).Set("liliestoday", (long)((ulong)client.Entity.Flowers.Lilies2day)).Set("tulips", (long)((ulong)client.Entity.Flowers.Tulips)).Set("tulipstoday", (long)((ulong)client.Entity.Flowers.Tulips2day)).Set("orchads", (long)((ulong)client.Entity.Flowers.Orchads)).Set("orchadstoday", (long)((ulong)client.Entity.Flowers.Orchads2day)).Set("last_flower_sent", client.Entity.Flowers.LastFlowerSent.ToString()).Where("id", (long)((ulong)client.Entity.UID)).Execute();
}