本文整理汇总了C#中PhoenixProject.Database.MySqlCommand.Insert方法的典型用法代码示例。如果您正苦于以下问题:C# MySqlCommand.Insert方法的具体用法?C# MySqlCommand.Insert怎么用?C# MySqlCommand.Insert使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PhoenixProject.Database.MySqlCommand
的用法示例。
在下文中一共展示了MySqlCommand.Insert方法的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: 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();
}
示例3: Insert
public static void Insert(Entity Entity, byte id)
{
Statement.SubClass Sub = new Statement.SubClass();
MySqlCommand Command = new MySqlCommand(MySqlCommandType.INSERT);
Command.Insert("subclasses")
.Insert("uid", id)
.Insert("id", Entity.UID)
.Execute();
}
示例4: CreateArsenal
public static void CreateArsenal(uint s_id, Arsenal_ID id)
{
MySqlCommand Command = new MySqlCommand(MySqlCommandType.INSERT);
Command.Insert("pt_arsenal")
.Insert("syn_id", s_id)
.Insert("arsenal_id", (byte)id)
.Insert("arsenal_unlocked", 1)
.Execute();
}
示例5: 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();
}
示例6: NewReincarnated
public static void NewReincarnated(Game.Entity entity)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("reincarnation")
.Insert("uid", entity.UID)
.Insert("level", entity.Level)
.Insert("experience", 0);
cmd.Execute();
// Conquer.Database.Reincarnation.Insert((int)entity.UID, (int)entity.Level, 0);
}
示例7: 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();
}
示例8: 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();
}
示例9: CreateArsenalItem
public static void CreateArsenalItem(uint uid, string name, uint i_uid, ushort sid, Arsenal_ID aid)
{
MySqlCommand Command = new MySqlCommand(MySqlCommandType.INSERT);
Command.Insert("pt_arsenal_inscribed")
.Insert("uid", uid)
.Insert("name", name)
.Insert("iten_id", i_uid)
.Insert("iten_atype", (byte)aid)
.Insert("syn_id", sid)
.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: createhouse
public static void createhouse(Client.GameState client)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("house").Insert("id", client.Entity.UID).Insert("mapdoc", "3024").Insert("type", "7").Insert("weather", "0").Insert("owner", client.Entity.UID).Insert("HouseLevel", "1");
cmd.Execute();
//PhoenixProject.Database.MapsTable.MapInformation info = new PhoenixProject.Database.MapsTable.MapInformation();
// info.ID = (ushort)client.Entity.UID;
// info.BaseID = 601;
//info.Status = 7;
// info.Weather = 0;
//info.Owner = client.Entity.UID;
//info.HouseLevel = 1;
//PhoenixProject.Database.MapsTable.MapInformations.Add(info.ID, info);
bool Success = DMaps.CreateDynamicMap2(client.Entity.UID, 1765, (uint)client.Entity.UID, 1);
return;
}
示例12: AddQuest
public static bool AddQuest(Client.GameState h, HeroQuest q)
{
if (h.Quests.TryAdd(q.Identifier, q))
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("heroquests").Insert("hero", h.Entity.UID).Insert("quest", q.Identifier)
.Insert("npc", "0").Insert("flag", (uint)q.CompleteFlag).Insert("step", q.Step)
.Insert("time", "0")
.Insert("daily", "0").Execute();
QuestInfoPacket info = new QuestInfoPacket(0x10)
{
Type = 1,
QuestIdentifier = q.Identifier,
QuestType = QuestCompleteTypes.Accepted
};
h.Send((byte[])info);
}
return false;
}
示例13: 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);
cmd.Execute();
new Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("rates").Set("LastItem", PhoenixProject.Client.AuthState.nextID).Where("Coder", "kimo").Execute();
}
catch
{
again:
PhoenixProject.Client.AuthState.nextID++;
Item.UID = PhoenixProject.Client.AuthState.nextID;
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);
cmd.Execute();
new Database.MySqlCommand(Database.MySqlCommandType.UPDATE).Update("rates").Set("LastItem", PhoenixProject.Client.AuthState.nextID).Where("Coder", "kimo").Execute();
}
}
示例14: 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();
}
示例15: AddMentor
public static void AddMentor(Mentor mentor, PhoenixProject.Game.ConquerStructures.Society.Apprentice appr)
{
MySqlCommand cmd = new MySqlCommand(MySqlCommandType.INSERT);
cmd.Insert("apprentice").Insert("mentorid", mentor.ID).Insert("apprenticeid", appr.ID)
.Insert("mentorname", mentor.Name).Insert("apprenticename", appr.Name).Insert("enroledate", appr.EnroleDate).Execute();
}