Git Product home page Git Product logo

boundlexx's People

Contributors

angellusmortis avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

boundlexx's Issues

Filters for Item API

Request from DreamEvil (Discord DM);

Add filters for:
a) a resource that can be used for the resource count APIs
b) an item that can be used in the item colours API

Update color booleans

  • new_color should only be if it is new for for Sovereign/Perm planets
  • Add new color boolean for new_exo_color, will be Sovereign/Perm/Exo colors
  • Add days_since_transform
  • Add exo_transform
  • Add days_since_exo_transform

Fix Pylint

Fix too-many-lines and too-many-instance-attributes errors

Add World Poll result endpoint that includes all worlds

All worlds per world in 1 request would be cool, or all worlds summed into 1 time series would also be cool. If not I was just going to go with my original plan of using the individual series for each world and just playing with it.

Alwin, forums

part 2:

Add ability to poll buckets of resources for a single world over time.

Poll settlement data

        private async Task DoPlanetSettlements(uint planetId)
        {
            var planet = planets.Data.Where(cur => cur.Id == planetId).FirstOrDefault();

            if (planet == null)
            {
                return;
            }

            var something = JToken.Parse(planet.GameserverJson);
            string apiUrl = something["apiURL"].Value<string>();

            string uri = $"{apiUrl}/planet/16/5";
            var req = WebRequest.Create(uri);

            MemoryStream mo;
            byte[] buffer = new byte[1024];

            await Task.Delay(throttle);

            using (WebResponse response = req.GetResponse())
            using (Stream stream = response.GetResponseStream())
            {
                stream.Read(buffer, 0, 5);
                //var a = ReadFully(stream);

                ZInputStream zi = new ZInputStream(stream);

                mo = new MemoryStream();
                int n;
                while ((n = zi.read(buffer, 0, buffer.Length)) > 0)
                {
                    mo.Write(buffer, 0, n);
                }
            }

            mo.Position = 0;
            mo.Read(buffer, 0, 0x08);

            mo.Read(buffer, 0, 4);
            int settlementCount = BitConverter.ToInt32(buffer, 0);

            List<SettlementRecord> settlements = new List<SettlementRecord>();

            while (mo.Read(buffer, 0, 1) > 0)
            {
                SettlementRecord cur = new SettlementRecord();

                byte length = buffer[0];
                mo.Read(buffer, 0, length);
                cur.Name = Encoding.UTF7.GetString(buffer.Take(length).ToArray());

                mo.Read(buffer, 0, 4);
                cur.Prestege = BitConverter.ToInt32(buffer, 0);

                mo.Read(buffer, 0, 4);
                cur.Something = BitConverter.ToInt32(buffer, 0);

                mo.Read(buffer, 0, 2);
                cur.Worldx = BitConverter.ToInt16(buffer, 0);

                mo.Read(buffer, 0, 2);
                cur.Worldy = BitConverter.ToInt16(buffer, 0);

                settlements.Add(cur);
            }

            if (settlementCount != settlements.Count)
            {
                throw new Exception("length mismatch");
            }

            ulong curRank = 0;
            foreach (var curPlanetSettlement in settlements.OrderByDescending(cur => cur.Prestege))
            {
                curPlanetSettlement.PlanetRank = ++curRank;
            }

            planet.Settlements = settlements;
        }

Ability to access inactive worlds from World API

Request from JyeGuru (via Discord DM):

Ability to access the World API for inactive worlds.

By default, World API should still only shows active worlds (non-expired or locked worlds). i.e. worlds that currently in the game API. Probable implementation is to add a filter ?show_inactive=True or something to reveal inactive worlds.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.