Coder Social home page Coder Social logo

bnet's People

Contributors

jyggen avatar localheinz avatar morloderex avatar sasin91 avatar sk9 avatar tehmufifnman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bnet's Issues

Bump minimum PHP version to 7.0

Thoughts? It would allow us to use all the lovely new features. The minimum version should at least be bumped to 5.6 since 5.5 goes EOL in 4 days.

Caching for requests that doesn't have the last-modified header

@jyggen I have noticed that not every request on blizzards end currently returns a Last-Modified status like for instance the data endpoints for wow.

What would be your preferred way of handling this?
Could it be as simple as caching the request for x number of days or hours at a time?

What is your thoughts on this?

Guild entity members (Convert to character entities if member field is set)

Hello :)

I have tried to loop through a guilds individual inside the GuildEntity class of course members array using the member field in the querystring

my idea is to return the CharacterEntity for the array instead of the normal array, so that it stays consistent in responses.

But i just cannot find out how to do that:

if(array_key_exists('members', $this->attributes))    {
    foreach($this->attributes['members'] as $key => $value)    {
        $value['character'] = new CharacterEntity($value['character']);
    }
}

This is what i have tried (i have of course made an test to back it up)

And here is a sample of what i'm trying to do:

 "members": [{
        "character": {
            "name": "Tiando",
            "realm": "Zenedar",
            "battlegroup": "Cruelty / Crueldad",
            "class": 3,
            "race": 10,
            "gender": 0,
            "level": 94,
            "achievementPoints": 11900,
            "thumbnail": "internal-record-3657/67/95364163-avatar.jpg",
            "spec": {
                "name": "Marksmanship",
                "role": "DPS",
                "backgroundImage": "bg-hunter-marksman",
                "icon": "ability_hunter_focusedaim",
                "description": "A master archer or sharpshooter who excels in bringing down enemies from afar.",
                "order": 1
            },
            "guild": "Vita Nova",
            "guildRealm": "Frostwhisper",
            "lastModified": 0
        },
        "rank": 3
    }]

As you can see with the members field option you will get a character array back but i want that array to be a Character Entity class.

I know it's possible but how.

The problem is that it does not set the character key so my test for it is failing:

public function testFindCharacters()
    {
        $request = new GuildRequest(new TestClient('wow'));

        $request->on('Auchindoun');

        $response = $request->find('Dyslectic Defnenders', ['members']);

        $this->assertInstanceOf('\Pwnraid\Bnet\Warcraft\Guilds\GuildEntity' ,$response);

        $this->assertInstanceOf('\Pwnraid\Bnet\Warcraft\Characters\CharacterEntity', $response->members[0]['character']);
    }

This is my test for it (fixture is also updated for it)

upgrade to support Oauth2 client?

Hello Pwnraid

I just wanted to make a heads up on this project, because Oauth client library has finally released a 1.x version :)

And the tests are failing :P

So you might want to revisit this package :)

Make PSR-6 implementation optional

Hello @jyggen

I'm trying to make an adapter from Laravel cache facilities to the psr 6 interfaces. It's going great at the moment.

My question is this: Should this package not include some kind of concrete implementation of these interfaces as per default? like you did beforehand usingtedivm/stash?

CodeIgniter

Thoughts on getting this to work in CodeIgniter? By default, Codeigniter doesn't utilize any namespaces...

API Wrapper occasionally hanging while communicating with Blizzard

I noticed some of my scripts appeared to be locked up, so I set about investigating.

My steps:
Retrieved the processId of my script
Then ran "strace -p " which showed it stuck on "fd 10"
"lsof -p " shows all fds for my process, and 10 is a TCP connection from my server to an IP address owned by Blizzard Paris (which I am assuming is me downloading auction data from an EU server).

The API wrapper function call that is hanging is:
$this->apiClient->auctions()->download($auctionIndex);

This is called with an appropriately verified $auctionIndex, since I compare it to a stored index in my DB to check if new data is available from Blizzard.

This happens extremely rarely, but when it does it manages to hard-lock my script for some reason.

Any ideas?

Thanks and keep up the amazing work!

Migrate to develop.battle.net

Blizzard have moved to a new API platform, and with that some breaking changes have been introduced (intended and unintended).

  • Rewrite fetch-api-docs to support develop.battle.net.
  • Rewrite generate-metadata to support the new API definition files.
  • Rewrite generate-classes in case changes to the metadata format is needed.

implement the 6.0.3 changes to the bnet package

Hello @jyggen

As of 6.0.2 (Warlords of Dreanor), the API has been updated with Item changes e.g. Item Contexts

As an example try to get the item with an ID of 113978 that will return a base site with all available contexts, but no data for that item, also new to the items while we are here, is the bl query string which indicates bonuses on the item.

Take a look at this link for the changes.

Is it possible that these changes to the API can be implemented to the package @jyggen?

Invalid conversion of WoW guild members to character entities

In GuildEntity.php the member-to-character conversion uses full member record (with character and rank properties) instead of character property, leading to invalid character entity (for example, $character->character['name'] instead of $character->name).

Fix should be something like this:
In line 25 of GuildEntity.php:
$this->attributes['members'][$key]['character'] = new CharacterEntity($member);
should be changed to:
$this->attributes['members'][$key]['character'] = new CharacterEntity($member['character']);

Suggestions

Hello Jyggen

should we make some function to help the developer to convert for instance: blizzard's classes and races for wow from their integer representations to their string representations.

And I would love to immpliment /wow/mount endpoint but where do that go under?

Laravel

Hey again @jyggen

One more question, is this package compatible with the framework laravel for instance?

Sense it is using some symfony dependencies and i know laravel is also using them ๐Ÿ‘

Does not handle invalid API Key gracefully

Have been enjoying the elegance of your code. While doing some edge testing I found an issue:
...
$factory = new \Pwnraid\Bnet\ClientFactory('xyz');
$client = $factory->warcraft(new \Pwnraid\Bnet\Region(\Pwnraid\Bnet\Region::US));
$realms = $client->realms()->all();

Results in:
Fatal error: Call to undefined method GuzzleHttp\Psr7\Response::json() in pwnraid\bnet\src\Core\AbstractClient.php on line 201

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.