SteamBot.Trade.Trade C# (CSharp) Метод

Trade() публичный Метод

public Trade ( SteamID me, SteamID other, string sessionId, string token, string apiKey, TradeListener listener = null ) : System
me SteamKit2.SteamID
other SteamKit2.SteamID
sessionId string
token string
apiKey string
listener TradeListener
Результат System
		public Trade (SteamID me, SteamID other, string sessionId, string token, string apiKey, TradeListener listener = null) {
			meSID = me;
			otherSID = other;

			trades = new HashSet<ulong>[] { MyTrade, OtherTrade };
			Otrades = new HashSet<ulong>[] { OMyTrade, OOtherTrade };

			this.sessionId = sessionId;
			steamLogin = token;
			this.apiKey = apiKey;

			AddListener (listener);

			baseTradeURL = String.Format (SteamTradeUrl, otherSID.ConvertToUInt64 ());

			// try to poll for the first time
			try {
				Poll ();
			} catch (Exception) {
				PrintConsole ("Failed to connect to Steam!", ConsoleColor.Red);

				if (OnError != null)
					OnError(0);
			}

			try {
				SendMessage("Fetching data");

				// fetch the other player's inventory
				OtherItems = GetInventory (otherSID);
				if (OtherItems == null || OtherItems.success != "true") {
					throw new Exception ("Could not fetch other player's inventory via Trading!");
				}
				
				// fetch our inventory
				MyItems = GetInventory (meSID);
				if (MyItems == null || MyItems.success != "true") {
					throw new Exception ("Could not fetch own inventory via Trading!");
				}
				
				// fetch other player's inventory from the Steam API.
				OtherInventory = Inventory.FetchInventory(otherSID.ConvertToUInt64(), apiKey);
				if (OtherInventory == null) {
					throw new Exception ("Could not fetch other player's inventory via Steam API!");
				}
				
				// fetch our inventory from the Steam API.
				MyInventory = Inventory.FetchInventory(meSID.ConvertToUInt64(), apiKey);
				if (MyInventory == null) {
					throw new Exception ("Could not fetch own inventory via Steam API!");
				}

				SendMessage("Ready");
				inventories = new Inventory[] { MyInventory, OtherInventory };

				if (OnAfterInit != null)
					OnAfterInit();

			} catch (Exception e) {
				if (OnError != null)
					OnError(3);
				Console.WriteLine (e);
				throw e;
			}

		}