public async Task <object> NearAsync(NearRequest request) { BO2 bo2 = await this.GetBOAsync(request.BOT, request.BO); if (bo2 == null) { return(null); } FilterRequest filterRequest = new FilterRequest(); filterRequest.Query = JObject.Parse($"{{bot:'{bo2.BOT}',bo:{{$ne:'{request.BO}'}},location:{{$near:{{$geometry:{bo2.Location.ToJson()},$maxDistance:{request.Distince}}}}}}}"); filterRequest.Fields = JObject.Parse("{bo:1}"); filterRequest.Limit = request.Top; List <BO2> nearestBOList = await this.FilterBOsAsync(filterRequest); return((nearestBOList == null || nearestBOList.Count == 0) ? null : nearestBOList.Select(bo => bo.BO).ToList()); }
static void Main(string[] args) { var p = new BO2(); p.FindGame(); string cmd; Console.WriteLine("Please enter your config's url"); string url = Console.ReadLine(); //Console.WriteLine("Please enter your second config's url (leave blank if you do not wish to have a second config)"); //string url2 = Console.ReadLine(); int cVersion = 1; int oVersion; string XMLFileLocation = "https://raw.githubusercontent.com/odysollo/new/master/version.xml"; bool debug = false; XDocument doc = XDocument.Load(XMLFileLocation); var VersionElement = doc.Descendants("Version"); oVersion = Convert.ToInt32(string.Concat(VersionElement.Nodes())); ConsoleKeyInfo keyinfo = Console.ReadKey(); //if (keyinfo.Key == ConsoleKey.F10) //{ //bool debug = false; //} //else //{ //bool debug = true; //} if (cVersion < oVersion) { Process.Start("http://consol.cf/update.php"); return; } for (; ;) { if (debug) { Console.WriteLine("Please type in a command"); cmd = Console.ReadLine(); p.Send(cmd); } else { //string configselect; Console.WriteLine("Press enter to execute config"); //Console.WriteLine("Press type in your configs number (ie. 1 or 2) and then press enter to execute config"); Console.ReadLine(); //configselect = Console.ReadLine(); WebConfigReader conf = new WebConfigReader(url); string[] tokens = Regex.Split(conf.ReadString(), @"\r?\n|\r"); foreach (string s in tokens) //ConsoleConfig cons = new ConsoleConfig(); { p.Send(s); //p.Send(test); } } } }
public VM2(BO2 item) { Item = item; }