Coder Social home page Coder Social logo

bot4dofus / datafus Goto Github PK

View Code? Open in Web Editor NEW
45.0 5.0 13.0 327.18 MB

📚🥚 The Dofus database and socket events in JSON files. Includes the source code and more...

Home Page: https://discord.gg/kNHsFcbUGp

License: MIT License

Python 0.11% Shell 0.01% ActionScript 99.88%
dofus data database json build game craft sidekicks consumables equipments

datafus's People

Contributors

ledouxm avatar lucberge 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

datafus's Issues

[A2] Missing events in `events.json` and different result on Linux/windows

  • data/A/DofusInvoker/scripts/com/ankamagames/dofus/network/messages/game/startup/StartupActionsAllAttributionMessage.as
  • data/A/DofusInvoker/scripts/com/ankamagames/dofus/network/types/game/shortcut/ShortcutObjectIdolsPreset.as
  • data/A/DofusInvoker/scripts/com/ankamagames/dofus/network/messages/game/prism/PrismsListUpdateMessage.as
  • ... many more

Actions:

  • List diffs on linux/windows
  • Debug why linux does not see those files as events

api requests

salut, je voudrai savoir si c'est possible d'avoir les https pour les requests dofus pour les hotels de ventes.

[RESTFUL API] Add home page

Add an index.html file as home of the GitHub pages and RESTFULL API. This file should contain :

  • A description of the API
  • List all the endpoints
  • A try section

Exemple d'un envoi d'event via socket

Bonjour,

Merci pour ce très beau travail.

Auriez vous un exemple d'un envoi de ces évenements via une socket ?

Je cherche à comprendre comment envoyer ces évenements.

[A2] Add `TypeId` information for `Vector.<...>`

In ChatServerWithObjectMessage.as there is an attribute called objects of type Vector.<ObjectItem>. It is serialzed this way:

         output.writeShort(this.objects.length);
         for(var _i1:uint = 0; _i1 < this.objects.length; _i1++)
         {
            (this.objects[_i1] as ObjectItem).serializeAs_ObjectItem(output);
         }

The type must be Vector<Short,ObjectItem>


In ObjectItem.as there is an attribute called effects of type Vector.<ObjectEffect>. It is serialzed this way:

         output.writeShort(this.effects.length);
         for(var _i3:uint = 0; _i3 < this.effects.length; _i3++)
         {
            output.writeShort((this.effects[_i3] as ObjectEffect).getTypeId());
            (this.effects[_i3] as ObjectEffect).serialize(output);
         }

The type must include the fact that the TypeId is serialized before ObjectEffect.


In events.json, the attribute type must include this information.
Something like:

  • Vector<Short,Short,ObjectEffect>
  • TypeIdVector<Short,Short,ObjectEffect>
  • TypeIdVector<Short,ObjectEffect>

TypeId is always serialized as a Short.

Fix workflow

Use actions/upload-artifact@v3 and actions/download-artifact@v3 to pass files between jobs A, B and C to Publish.

[B1] Clean output directory

There is 164 d2o files but 168 json files.
This is because the enties_json directory is never cleaned.
B1 script must clean it at the beginning

[A2] Fix `ByteArray` type

In RawDataMessage.as, the field content is of type ByteArray.

It is serialized like a vector:

      public function serializeAs_RawDataMessage(output:ICustomDataOutput) : void
      {
         output.writeVarInt(this.content.length);
         for(var _i1:uint = 0; _i1 < this.content.length; _i1++)
         {
            output.writeByte(this.content[_i1]);
         }
      }

So it must be Vector<VarInt,Byte>.

[B1] Unknown fields type for entities

In the enties files, the field type are negative numbers. Display the type in string instead of the number.

-1 : integer
-2 : boolean
-3 : utf (string)
-4 : double
-5 : i18n
-6 : unsigned_integer (id of entity)
-99 : list

Rewrite the D2oReader class

[Job A] Update parse event arguments

Small script to do it.

class_ = "MapComplementaryInformationsDataMessage"
file = class_ + ".as"
constructor_substring = "public function init" + class_

with open(file, 'r') as f:
    lines = f.readlines()
    
    for line in lines:
        if(constructor_substring in line):
            begin_index = line.find("(")
            end_index = line.rfind(")")
            args = line[begin_index+1:end_index]
            args = args.split(', ')
            args = [arg.split(' = ')[0] for arg in args]
            args = [{arg.split(':')[0]:arg.split(':')[1]} for arg in args]
            print(args)
            break

[A2] Wrong attributes order

In the file https://github.com/bot4dofus/Datafus/blob/master/data/A/DofusInvoker/scripts/com/ankamagames/dofus/network/messages/connection/IdentificationMessage.as#L119

The correct serialization order is:

  1. autoconnect
  2. useCertificate
  3. useLoginToken
  4. version
  5. lang
  6. credentials
  7. serverId
  8. sessionOptionalSalt
  9. failedAttempts

Current order is (based on attributes declaration):

  1. version
  2. lang
  3. credentials
  4. serverId
  5. autoconnect
  6. useCertificate
  7. useLoginToken
  8. sessionOptionalSalt
  9. failedAttempts

events.json content:

	"IdentificationMessage": {
		"file": "data/A/DofusInvoker/scripts/com/ankamagames/dofus/network/messages/connection/IdentificationMessage.as",
		"id": "7755",
		"superclass": "NetworkMessage",
		"interfaces": [
			"INetworkMessage"
		],
		"attributes": {
			"version": "Version",
			"lang": "String",
			"credentials": "Vector<VarInt,Byte>",
			"serverId": "Short",
			"autoconnect": "Boolean",
			"useCertificate": "Boolean",
			"useLoginToken": "Boolean",
			"sessionOptionalSalt": "VarLong",
			"failedAttempts": "Vector<Short,VarShort>"
		}
	},

[A2] Distinction between boolean and flags

In the file https://github.com/bot4dofus/Datafus/blob/master/data/A/DofusInvoker/scripts/com/ankamagames/dofus/network/messages/connection/IdentificationMessage.as#L119

  • autoconnect is the first bit of the byte
  • useCertificate the second bit
  • useLoginToken the third bit

Those booleans are flags.

We should be able to distinguish them from regular booleans like in https://github.com/bot4dofus/Datafus/blob/master/data/A/DofusInvoker/scripts/com/ankamagames/dofus/network/messages/game/basic/BasicWhoIsRequestMessage.as#L120

Content of events.json:

 "IdentificationMessage": {
        "file": "data/A/DofusInvoker/scripts/com/ankamagames/dofus/network/messages/connection/IdentificationMessage.as",
        "id": "7755",
        "superclass": "NetworkMessage",
        "interfaces": [
            "INetworkMessage"
        ],
        "attributes": {
            "version": "Version",
            "lang": "String",
            "credentials": "Vector<VarInt,Byte>",
            "serverId": "Short",
            "autoconnect": "Boolean",
            "useCertificate": "Boolean",
            "useLoginToken": "Boolean",
            "sessionOptionalSalt": "VarLong",
            "failedAttempts": "Vector<Short,VarShort>"
        }
    },

[A2] Check `uint` and `int` serialized type for vectors

In HouseOnMapInformations.as there is an attribut called doorsOnMap which is a Vector.<uint>. In the serialize method, it is serialized as an Int.

In UpdatedStorageTabInformation.as there is an attribut called dropTypeLimitation which is a Vector.<uint>. In the serialize method, it is serialized as a VarInt.

Vector.<uint> and Vector.<int> must be check just like uint and int attributs.

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.