0 votes

This issue is extremely strange to me. I've been working in Godot on an online game and using TCP StreamPeer for about 2 years now.

In this scenario I'm placing two concepts, objecttype and objectid into my connection stream using the following code:

func send_get_options_packet(_event, object_type, object_id):
var conn = ConnectionHandler.Connection #StreamPeerTCP object here
conn.put_u16(301) # Don't mind this input
conn.put_u16(object_type) # Currently set to 1
conn.put_u32(object_id) # This number varies. It works to send to server on the input 9, 11, 100 etc.. 

On the last conn.putu32(objectid). If the integer == 10 the payload is not sent to my server. I've manually put in integers to this and tested. Lo and behold 9 works, 11 works, 100 works. Anything I put in seems to send over except the integer 10.

Any ideas what might be happening? Is it confusing the input somehow? Any help is very much appreciated.

For extra intel here is my server log output I print out whenever I receive a TCP payload on the server side:

Normal Proper Paylod with 9 as the input on object_id

 Payload: [45 1 1 0 9 0 0 0 10]

Invalid Payload when the integer 10 is written as object_id

Payload: [45 1 1 0 10]

You can clearly see the payload is not writing the 4 bytes that normally would be included on the u32.

Godot version 3.4.4
in Engine by (14 points)

Please log in or register to answer this question.

Welcome to Godot Engine Q&A, where you can ask questions and receive answers from other members of the community.

Please make sure to read Frequently asked questions and How to use this Q&A? before posting your first questions.
Social login is currently unavailable. If you've previously logged in with a Facebook or GitHub account, use the I forgot my password link in the login box to set a password for your account. If you still can't access your account, send an email to [email protected] with your username.