Code Monkey home page Code Monkey logo

protohx's People

Contributors

bmfs avatar d0rc avatar dependabot[bot] avatar nitrobin 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  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  avatar

protohx's Issues

proto can't parse int64 correctly

When i received a message from java server(long type).I found that the Int64 field is a negative number,like -948372833,the correct value should be 30 Billion or larger.

is that a bug?

Backward compatibility with haxe <3.2

0.4.3 isn't compling with haxe 3.1.3 because of lack of Int64.is which is used in MessageUtils.hx. Here is conditional compilation workaround:

diff --git a/protohx/MessageUtils.hx b/protohx/MessageUtils.hx
index dcec9eb..68c6a56 100644
--- a/protohx/MessageUtils.hx
+++ b/protohx/MessageUtils.hx
@@ -18,7 +18,7 @@ class MessageUtils {
             return value;
         } else if (Std.is(value, Bytes)) {
             return cast(value, Bytes).toHex();
-        } else if (Int64.is(value)) {
+        } else if #if haxe_320 (Int64.is(value)) #else (Std.is(value,Int64)) #end {
             return Int64.toStr(cast(value, Int64));
         } else if (Std.is(value, protohx.Message)) {
             var m:Dynamic = {};

Comparing Int and Uint

In flash, you get the error:

haxe: Comparison of Int and UInt might lead to unexpected results

when trying to perform the operation

var tag:PT_UInt = protohx.ReadUtils.read__TYPE_UINT32(input);
switch (tag >> 3) {

tag >> 3 is causing the problem

decode from c# bytes error

message Test{
	
	required uint32 test=1;
 	optional string resultPath=2;
	required uint32 test2=3;
	
}
 var msg = new ProtocolMessage();
        msg.type = ProtocolMessage.MsgType.TEST;
        var lrq = new samples.Test();
        
        lrq.test = 0;
        lrq.resultPath = "1";
        lrq.test2 = 0;
        msg.test = lrq;

such like same proto

c#
bytes: 086a4200

haxe:
byts 08707720a080012043139393931863

the size is not same and each language can be decode right by theirself ,what's wrong?

Package Uint to Int errors (on flash compiles)

The following proto:

message MMMonster {
optional MMMonsterCard monsterCard = 1;
repeated uint32 modifiersUsed = 2 [packed=true];
repeated uint32 modifiers = 3 [packed=true]; // list of scroll IDs
repeated uint32 equippedGear = 4 [packed=true]; // list of equipped gear ids
}

Generates (cut sample):

    if (this.modifiersUsed != null && this.modifiersUsed.length > 0) {
        protohx.WriteUtils.writeTag(output, protohx.WireType.LENGTH_DELIMITED, 2);
        protohx.WriteUtils.writePackedRepeated(output, protohx.WriteUtils.write__TYPE_UINT32, this.modifiersUsed);

Which is causing:

Warning:(107, 89) haxe: Array<protohx.PT_UInt> should be Array<protohx.PT_Int>
Warning:(107, 89) haxe: Type parameters are invariant
Warning:(107, 89) haxe: UInt should be protohx.PT_Int
Warning:(107, 89) haxe: UInt should be Int
Warning:(107, 89) haxe: For function argument 'value'

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.