public async Task <GateSpinData> SpinGateAsync(GalaxyGate gate, int spinamount) { var spinUrl = string.Format(Urls.SpinGate, Urls.BaseUrl, AccountData.UserId, AccountData.SessionId, (int)gate, gate.GetFullName().ToLower(), spinamount); if (GateData.Samples > 0) { spinUrl = string.Format(Urls.SpinGateSample, Urls.BaseUrl, AccountData.UserId, AccountData.SessionId, (int)gate, gate.GetFullName().ToLower(), spinamount); } var resultString = await _httpClient.GetAsyncNoLimit(spinUrl); var serializer = new XmlSerializer(typeof(GateSpinData)); GateSpinData result; using (var reader = new StringReader(resultString)) { result = (GateSpinData)serializer.Deserialize(reader) as GateSpinData; } EvaluateGateSpin(result, spinamount); return(result); }
public async Task <bool> PlaceGateAsync(GalaxyGate gate) { var placed = await _httpClient.GetAsyncLimit(string.Format(Urls.PlaceGate, Urls.BaseUrl, AccountData.UserId, AccountData.SessionId, (int)gate)); return(!placed.Contains("not_enough_parts")); }
public void CreateExitGate(Player player, GalaxyGate gate, Vector position) { var id = GetNextObjectId(); var baseLocation = player.GetClosestStation(true); AddObject(new ExitGatePortal(gate, id, position, this, baseLocation.Item1, baseLocation.Item2.Id)); }
public int CreateGalaxyGate(GalaxyGate gate) { var id = 0; if (OwnedGates.Count > 0) { foreach (var key in OwnedGates.Keys) { if (OwnedGates[key] == null) { id = key; } else { id++; } } if (OwnedGates.ContainsKey(id)) { id++; } } OwnedGates.TryAdd(id, gate); return(id); }
private bool IsMultiplierAvailable(GalaxyGate gate) { var gateName = gate.GetFullName().ToLower(); var data = GateData.MultiplierInfo.MultiplierInfo.FirstOrDefault(x => x.Mode.ToLower() == gateName); if (data == null) { return(false); } return(data.Value >= 0); }
public async Task <GateSpinData> SpinGateAsync(GalaxyGate gate, bool useMultiplier) { var spinUrl = string.Empty; if (useMultiplier && IsMultiplierAvailable(gate)) { spinUrl = string.Format(Urls.SpinGateMultiplier, Urls.BaseUrl, AccountData.UserId, AccountData.SessionId, (int)gate, gate.GetFullName().ToLower()); if (GateData.Samples > 0) { spinUrl = string.Format(Urls.SpinGateSampleMultiplier, Urls.BaseUrl, AccountData.UserId, AccountData.SessionId, (int)gate, gate.GetFullName().ToLower()); } } else { spinUrl = string.Format(Urls.SpinGate, Urls.BaseUrl, AccountData.UserId, AccountData.SessionId, (int)gate, gate.GetFullName().ToLower()); if (GateData.Samples > 0) { spinUrl = string.Format(Urls.SpinGateSample, Urls.BaseUrl, AccountData.UserId, AccountData.SessionId, (int)gate, gate.GetFullName().ToLower()); } } var resultString = string.Empty; try { resultString = await _httpClient.GetAsyncNoLimit(spinUrl); var serializer = new XmlSerializer(typeof(GateSpinData)); GateSpinData result; using (var reader = new StringReader(resultString)) { result = (GateSpinData)serializer.Deserialize(reader) as GateSpinData; } EvaluateGateSpin(result); return(result); } catch (Exception e) { return(default(GateSpinData)); } }
//GET /flashinput/galaxyGates.php?userID=90140621&sid=9e052481361323b0053243fc39479887&action=saveSpinAmount&value=5 //GET /flashinput/galaxyGates.php?userID=90140621&sid=9e052481361323b0053243fc39479887&action=saveSpinAmount&value=1 //GET /flashinput/galaxyGates.php?userID=90140621&action=multiEnergy&sid=9e052481361323b0053243fc39479887&gateID=7&kappa=1 //GET /flashinput/galaxyGates.php?userID=90140621&action=multiEnergy&sid=0f00ad46cacb5b87aa31ff8b4dff9213&gateID=7&kappa=1 //GET /flashinput/galaxyGates.php?userID=90140621&action=init&sid=8b28d5df019ab57c924253529f9f66ae // /flashinput/galaxyGates.php?userID=90140621&action=multiEnergy&sid=3a82c9e4779e8bf9c4815884ebbde965&gateID=7&kappa=1&spinamount=5 public async Task <HttpResponseMessage> GalaxyGateSpin(GalaxyGate gate, int numberOfSpins) { //await SetGalaxyGatesSpin(); var secondUri = new UriBuilder("https://int7.darkorbit.com/flashinput/galaxyGates.php?" + $"userID={Factory.LoggedAccount.ID}" + "&action=multiEnergy" + $"&sid={Factory.LoggedAccount.DOSID}" + $"&gateID={gate.Id}" + $"&{gate.Name.ToLower()}=1" + $"&spinamount={numberOfSpins}").Uri; await GET(secondUri, "int7.darkorbit.com"); return(response); }
public Gate Get(GalaxyGate gate) { return(Gates.Find(x => x.Id == (int)gate)); }
public ExitGatePortal(GalaxyGate galaxyGate, int id, Vector pos, Spacemap map, Vector destinationPos, int destinationMapId) : base(id, Faction.NONE, pos, map, destinationPos, destinationMapId, true, 0, 0, PortalGraphics.STANDARD_GATE) { GalaxyGate = galaxyGate; }