public override global::System.Data.DataTable Clone() { AccountDataTable cln = ((AccountDataTable)(base.Clone())); cln.InitVars(); return(cln); }
public void Save() { this.Friends = ""; foreach (KeyValuePair <int, String> Key in this.FriendsList) { this.Friends += Key.Key + "|" + Key.Value + ";"; } this.Ennemys = ""; foreach (KeyValuePair <int, String> Key in this.EnnemyList) { this.Ennemys += Key.Key + "|" + Key.Value + ";"; } this.Bank = ""; foreach (KeyValuePair <long, InventoryItemModel> KeyPair in this.bankItems) { this.Bank += KeyPair.Key + ";"; InventoryItemTable.Update(KeyPair.Value); } this.Stables = ""; foreach (KeyValuePair <int, Mount> KeyPair in this.Mounts) { this.Stables += KeyPair.Key + ";"; } AccountDataTable.Update(this); }
private void InitClass() { this.DataSetName = "UserPassDateSetCLS"; this.Prefix = ""; this.Namespace = "http://tempuri.org/UserPassDateSetCLS.xsd"; this.EnforceConstraints = true; this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; this.tableAccount = new AccountDataTable(); base.Tables.Add(this.tableAccount); }
internal void InitVars(bool initTable) { this.tableAccount = ((AccountDataTable)(base.Tables["Account"])); if ((initTable == true)) { if ((this.tableAccount != null)) { this.tableAccount.InitVars(); } } }
private void InitClass() { this.DataSetName = "AccountDataSet"; this.Prefix = ""; this.Namespace = "http://tempuri.org/Account.xsd"; this.Locale = new global::System.Globalization.CultureInfo("en"); this.EnforceConstraints = true; this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; this.tableAccount = new AccountDataTable(); base.Tables.Add(this.tableAccount); }
public Boolean BuyObject(int LineID, int Count, long Price, Player Character) { Boolean possible = true; try { if (Character.Kamas < Price) { return(false); } var Line = getLine(LineID); var ObjectToBuy = Line.Have(Count, Price); Character.InventoryCache.SubstractKamas(Price); if (ObjectToBuy.Owner != -1) { var OwnerClient = Network.WorldServer.Clients.Find(x => x.Account != null && x.Account.ID == ObjectToBuy.Owner); if (OwnerClient != null) { OwnerClient.Account.Data.BankKamas += ObjectToBuy.Price; OwnerClient.Send(new TextInformationMessage(TextInformationTypeEnum.INFO, 65, new String[] { Price.ToString(), ObjectToBuy.Item.TemplateID.ToString(), 1 + "" })); } else { AccountDataTable.UpdateKamas(ObjectToBuy.Price, ObjectToBuy.Owner); //TODO Cache vous IM MSG } } Character.Send(new AccountStatsMessage(Character)); var OldItem = ObjectToBuy.Item; Character.InventoryCache.Add(OldItem); OldItem.Template.newSold(ObjectToBuy.getQuantity(true), Price); DestroyObject(ObjectToBuy); BidHouseTable.Delete(ObjectToBuy.Item.ID); if (ObjectToBuy.Owner == -1) { InventoryItemTable.Add(OldItem); } ObjectToBuy = null; } catch (Exception e) { possible = false; } return(possible); }
public void loadData() { Data = AccountDataTable.Get(ID); if (Data == null) { Data = new AccountDataModel() { Guid = this.ID, Bank = "", BankKamas = 0, Stables = "", Friends = "", Ennemys = "", showFriendConnection = false, }; AccountDataTable.Add(Data); } else { Data.Initialize(); } }
private static void BuyRequest(WorldClient Client, string Packet) { Client.Send(new GameRideMessage("v")); MountPark MP = Client.Character.myMap.mountPark; if (MP == null) { Client.Send(new BasicNoOperationMessage()); return; } if (MP.get_owner() == -1) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.ERREUR, 96)); return; } if (MP.get_price() == 0) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.ERREUR, 97)); return; } if (!Client.Character.HasGuild()) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.ERREUR, 135)); return; } if (Client.GetCharacter().getCharacterGuild().GradeType != GuildGradeEnum.GRADE_BOSS) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.ERREUR, 98)); return; } byte enclosMax = (byte)Math.Floor((double)Client.Character.GetGuild().Level / 10); byte TotalEncloGuild = (byte)MountParkTable.CountByGuild(Client.Character.GetGuild().ID); if (TotalEncloGuild >= enclosMax) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.ERREUR, 103)); return; } if (Client.Character.Kamas < MP.get_price()) { Client.Send(new TextInformationMessage(TextInformationTypeEnum.ERREUR, 82)); return; } Client.GetCharacter().InventoryCache.SubstractKamas(MP.get_price()); if (MP.get_owner() > 0) { var Owner = CharacterTable.GetCharacter(MP.get_owner()); if (Owner != null && Owner.Account.curPlayer != null) { Owner.Send(new ChatGameMessage("Un enclo a ete vendu a " + MP.get_price() + ".", "CC0000")); Owner.Account.Data.BankKamas += MP.get_price(); Owner.Account.Data.Save(); } else { AccountDataTable.Update(MP.get_price(), MP.get_owner()); } } MP.set_price(0); MP.set_owner(Client.Character.ID); MP.set_guild(Client.Character.GetGuild()); MountParkTable.Update(MP); CharacterTable.Update(Client.Character); Client.GetCharacter().myMap.SendToMap(new MapMountParkMessage(MP)); }
internal AccountRow(global::System.Data.DataRowBuilder rb) : base(rb) { this.tableAccount = ((AccountDataTable)(this.Table)); }
private void InitClass() { this.DataSetName = "Account_DS"; this.Prefix = ""; this.Namespace = "http://tempuri.org/Account_DS.xsd"; this.EnforceConstraints = true; this.SchemaSerializationMode = global::System.Data.SchemaSerializationMode.IncludeSchema; this.tableAccount = new AccountDataTable(); base.Tables.Add(this.tableAccount); }
private void InitClass() { this.DataSetName = "ATM"; this.Prefix = ""; this.Namespace = "http://tempuri.org/ATM.xsd"; this.EnforceConstraints = true; this.SchemaSerializationMode = System.Data.SchemaSerializationMode.IncludeSchema; this.tableCustomer = new CustomerDataTable(); base.Tables.Add(this.tableCustomer); this.tableTransaction = new TransactionDataTable(); base.Tables.Add(this.tableTransaction); this.tableAccount = new AccountDataTable(); base.Tables.Add(this.tableAccount); this.relationAccountTransaction = new System.Data.DataRelation("AccountTransaction", new System.Data.DataColumn[] { this.tableAccount.AccountNumberColumn}, new System.Data.DataColumn[] { this.tableTransaction.AccountNumberColumn}, false); this.Relations.Add(this.relationAccountTransaction); this.relationCustomerAccount = new System.Data.DataRelation("CustomerAccount", new System.Data.DataColumn[] { this.tableCustomer.CustomerNumberColumn}, new System.Data.DataColumn[] { this.tableAccount.CustomerNumberColumn}, false); this.Relations.Add(this.relationCustomerAccount); }
internal void InitVars(bool initTable) { this.tableCustomer = ((CustomerDataTable)(base.Tables["Customer"])); if ((initTable == true)) { if ((this.tableCustomer != null)) { this.tableCustomer.InitVars(); } } this.tableTransaction = ((TransactionDataTable)(base.Tables["Transaction"])); if ((initTable == true)) { if ((this.tableTransaction != null)) { this.tableTransaction.InitVars(); } } this.tableAccount = ((AccountDataTable)(base.Tables["Account"])); if ((initTable == true)) { if ((this.tableAccount != null)) { this.tableAccount.InitVars(); } } this.relationAccountTransaction = this.Relations["AccountTransaction"]; this.relationCustomerAccount = this.Relations["CustomerAccount"]; }