• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Buffer Problem

Alituma

Member
Hello. I have a buffer error that i do not know how to fix it since i know how to fix a buffer problem when the error tells me which line has the problem but this problem is because of slow internet here is the error

___________________________________________

############################################################################################

ERROR in

action number 1

of Async Event: Networking

for object oServer:



Attempting to read from outside the buffer, returning 0

at gml_Script_server_handle_message

############################################################################################

--------------------------------------------------------------------------------------------

stack frame is

gml_Script_server_handle_message (line 0)

gml_Object_oServer_Other_68



tried to use gml_release_mode but it does not work I do not know why the errors keep appearing also I do not want to use clumsy because I export the game for android

Im using Gamemaker 1.4.1760 also tried Gamemaker 1.4.9999

Please help this problem is aching my head I just do not want this error to show as if its appeared on the android I cant ignore it only can abort it
 

FrostyCat

Redemption Seeker
You don't just have slow connection, you have a packet-dropping, low-quality connection. You can mitigate this by measures such as sending+verifying a checksum along with every message or checking the length of the message against known sizes.
 

Alituma

Member
You don't just have slow connection, you have a packet-dropping, low-quality connection. You can mitigate this by measures such as sending+verifying a checksum along with every message or checking the length of the message against known sizes.
Well I tried to check buffer sizes but they looks they get larger and larger while the game adds more instances also when a player join i do not know what name he wants to type so i can't check for buffer size or buffer tell as Im not sure the size of the name.
but you said sending+verifying a checksum? how do i do that or can you give me an example?
also this problem not matter if it fixed or not just I do not want an error show in the middle of the game and go to restart it again no matter about losing packets a newer will be sent but if there is no other ways to stop show that error so I want to fix it.
do you know why gml_release_mode not working? I put that code gml_release_mode(true) with the start game event and it did not work errors still show. also tried in create and step event in the object still not work.
Thanks.
 

FrostyCat

Redemption Seeker
Going off the far end of a buffer is always a crash condition, gml_release_mode(true) won't help with that.

Checksums work like this: https://en.wikipedia.org/wiki/Crypt...n#/media/File:Cryptographic_Hash_Function.svg

Assume that you form your message by writing the ID followed by other content like this:
GML:
buffer_write(buffer, buffer_u8, 7);
/* Write other content here */
The checksum-protected version blocks out a section for the checksum, writes the ID and other content, then writes the hash of the ID+content section where the block is:
GML:
buffer_write(buffer, buffer_string, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
buffer_write(buffer, buffer_u8, 7);
/* Write other content here */
var finalPosition = buffer_tell(buffer);
var hashOfData = buffer_sha1(buffer, 40, finalPosition-40);
buffer_seek(buffer, buffer_seek_start, 0);
buffer_write(buffer, buffer_string, hashOfData);
buffer_seek(buffer, buffer_seek_start, finalPosition);
The receiving end validates the content by hashing that remaining section and comparing it against the original:
GML:
// Too small for hash = reject
if (buffer_get_size(buffer) < 40) exit;
// Reject on hash mismatch
var hashOfData = buffer_sha1(buffer, 40, buffer_get_size(buffer)-40);
var hash = buffer_read(buffer, buffer_string);
if (hash != hashOfData) exit;
/* OK to continue reading */
 

Alituma

Member
Going off the far end of a buffer is always a crash condition, gml_release_mode(true) won't help with that.

Checksums work like this: https://en.wikipedia.org/wiki/Crypt...n#/media/File:Cryptographic_Hash_Function.svg

Assume that you form your message by writing the ID followed by other content like this:
GML:
buffer_write(buffer, buffer_u8, 7);
/* Write other content here */
The checksum-protected version blocks out a section for the checksum, writes the ID and other content, then writes the hash of the ID+content section where the block is:
GML:
buffer_write(buffer, buffer_string, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
buffer_write(buffer, buffer_u8, 7);
/* Write other content here */
var finalPosition = buffer_tell(buffer);
var hashOfData = buffer_sha1(buffer, 40, finalPosition-40);
buffer_seek(buffer, buffer_seek_start, 0);
buffer_write(buffer, buffer_string, hashOfData);
buffer_seek(buffer, buffer_seek_start, finalPosition);
The receiving end validates the content by hashing that remaining section and comparing it against the original:
GML:
// Too small for hash = reject
if (buffer_get_size(buffer) < 40) exit;
// Reject on hash mismatch
var hashOfData = buffer_sha1(buffer, 40, buffer_get_size(buffer)-40);
var hash = buffer_read(buffer, buffer_string);
if (hash != hashOfData) exit;
/* OK to continue reading */
I understood how checksum works but tried your code it did not work its exiting the message as(hash != hashOfData). I think because they are not in the right place. its just like this : when you write message then in the last you take its checksum but when receiving it its checksum will be different from the sent checksum. is your code right? if so do you know how its order should be in at least one message in my Server and Client code? here is my codes

Server Script
GML:
///server_handle_message(socket_id,buffer);

var
socket_id = argument0,
buffer = argument1,
clientObject = clientmap[? string(socket_id)],
client_id_current = clientObject.client_id;

while(true)
{

    var
    message_id = buffer_read(buffer, buffer_u8);
    
    switch(message_id)
    {

            case MESSAGE_SELFID:

            buffer_seek(send_buffer, buffer_seek_start, 0);
            buffer_write(send_buffer, buffer_u8, MESSAGE_SELFID);
            buffer_write(send_buffer, buffer_s16, client_id_current);
            
            with(oServerClient){
            
                if(client_id = client_id_current){
                    network_send_raw(self.socket_id, other.send_buffer, buffer_tell(other.send_buffer)); //self and other
                }
            
            }
                
        break;
        case MESSAGE_MOVE:
        
            var
            xx = buffer_read(buffer, buffer_s16);
            yy = buffer_read(buffer, buffer_s16);
            dd = buffer_read(buffer, buffer_s16);
            xxt = buffer_read(buffer, buffer_s16);
            yyt = buffer_read(buffer, buffer_s16);
            imt = buffer_read(buffer, buffer_s16);
            cid = buffer_read(buffer, buffer_s16);
            
            clientObject.x = xx;
            clientObject.y = yy;
            clientObject.direction = dd;
            if cid = true{
            with(clientObject){
            with(oServerClient_Turret)if clientid = clientObject.client_id
            {x = oServer.xxt
            y = oServer.yyt
            image_angle = oServer.imt}}}
            
            buffer_seek(send_buffer, buffer_seek_start, 0);
            buffer_write(send_buffer, buffer_u8, MESSAGE_MOVE);
            buffer_write(send_buffer, buffer_s16, client_id_current);
            buffer_write(send_buffer, buffer_s16, xx);
            buffer_write(send_buffer, buffer_s16, yy);
            buffer_write(send_buffer, buffer_s16, dd);
            buffer_write(send_buffer, buffer_s16, xxt);
            buffer_write(send_buffer, buffer_s16, yyt);
            buffer_write(send_buffer, buffer_s16, imt);
            buffer_write(send_buffer, buffer_s16, cid);
            
            with(oServerClient){
            
                if(client_id != client_id_current){
                    network_send_raw(self.socket_id, other.send_buffer, buffer_tell(other.send_buffer)); //self and other
                }
            
            }
                
        break;
        case MESSAGE_JOIN:
        
            var
            username = buffer_read(buffer, buffer_string);
            
            clientObject.name = username;
            clientObject.clientid = client_id_current;
            usernamemsg = username;
            
            buffer_seek(send_buffer, buffer_seek_start, 0);
            buffer_write(send_buffer, buffer_u8, MESSAGE_JOIN);
            buffer_write(send_buffer, buffer_s16, client_id_current);
            buffer_write(send_buffer, buffer_string, username);
            buffer_write(send_buffer, buffer_s16, true);
            oSClient.otherusername = username
            oSClient.drawmsgtimer = 200
            oSClient.drawjoinmsg = true
            //send the new joined client name to other
            with(oServerClient){
                if(client_id != client_id_current){
                    network_send_raw(self.socket_id, other.send_buffer, buffer_tell(other.send_buffer)); //self and other
                }
            
            }
            //send the other clients name to the new joined client
            with(oServerClient){
                if(client_id != client_id_current){
                    buffer_seek(other.send_buffer, buffer_seek_start, 0);
                    buffer_write(other.send_buffer, buffer_u8, MESSAGE_JOIN);
                    buffer_write(other.send_buffer, buffer_s16, client_id);
                    buffer_write(other.send_buffer, buffer_s16, name);
                    buffer_write(other.send_buffer, buffer_s16, false);
                    network_send_raw(socket_id, other.send_buffer, buffer_tell(other.send_buffer)); //self and other
                }
            
            }            
                
        break;
        case MESSAGE_CREATE:
        
            var
            xx = buffer_read(buffer, buffer_s16);
            yy = buffer_read(buffer, buffer_s16);
            imt = buffer_read(buffer, buffer_s16);
            clientid = buffer_read(buffer, buffer_s16);
            type = buffer_read(buffer, buffer_s16);
            if type = 1{
            with(oServerClient){
            if oServer.clientid = clientid{
                ammo-=1;
                with(instance_nearest(x,y,oServerClient_Turret)){
                audio_play_sound_at(snd_Fire,x,y,0,100,20,0.5,false,1)
                B = instance_create(x + lengthdir_x(70,image_angle),y + lengthdir_y(70,image_angle),oBullet);
                B.direction = image_angle ;
                B.speed = 20;
                B.clientid = oServer.clientid;
                objectid = B.id
                }}}
            }
            
            buffer_seek(send_buffer, buffer_seek_start, 0);
            buffer_write(send_buffer, buffer_u8, MESSAGE_CREATE);
            buffer_write(send_buffer, buffer_s16, xx);
            buffer_write(send_buffer, buffer_s16, yy);
            
            with(oServerClient){
            
                if(client_id != client_id_current){
                    network_send_raw(self.socket_id, other.send_buffer, buffer_tell(other.send_buffer)); //self and other
                }
            
            }
            
        break;
        case MESSAGE_REPAIR:
        
            var
            oke = buffer_read(buffer, buffer_s16);
            repairedid = buffer_read(buffer, buffer_s16);
            
            with(oServerClient){
            if oServer.repairedid = -1{with(oSClient){HP=50};wrenchs-=1}
            if clientid = oServer.repairedid{with(instance_nearest_notme(x,y,oServerClient)){HP=50};wrenchs-=1}
            }
        break;

     
    }

    if(buffer_tell(buffer) == buffer_get_size(buffer)){
        break;
    }
    
}
Client Script
GML:
///client_handle_message(buffer);

var
buffer = argument0;


while(true)
{

    var
    message_id = buffer_read(buffer, buffer_u8);


   
    switch(message_id)
    {
    
        case CONNECTION_CHECKER:
        
        lastingtimer = buffer_read(buffer, buffer_s16);
        break;
        case MESSAGE_SELFID:
        
        clientid = buffer_read(buffer, buffer_s16);
        break;
        case MESSAGE_STATS:
        var
        myclientid = buffer_read(buffer, buffer_s16);
        clientname = buffer_read(buffer, buffer_string);
        clienthp = buffer_read(buffer, buffer_s16);
        clientammo = buffer_read(buffer, buffer_s16);
        clientwrenchs = buffer_read(buffer, buffer_s16);
        gs = buffer_read(buffer, buffer_s16);
        ec = buffer_read(buffer, buffer_s16);
        
        gamestarted=gs
        enemycounter=ec
        
        if (clientid = myclientid){
        HP = clienthp
        ammo = clientammo
        wrenchs = clientwrenchs
        }
        else 
        with(oOtherClient){
        if (myclientid = clientid){
        name = oClient.clientname
        HP = oClient.clienthp
        }}

        break;
        case MESSAGE_MMOVE:
            var
            xx = buffer_read(buffer, buffer_s16);
            yy = buffer_read(buffer, buffer_s16);
            dd = buffer_read(buffer, buffer_s16);
            xxt = buffer_read(buffer, buffer_s16);
            yyt = buffer_read(buffer, buffer_s16);
            imt = buffer_read(buffer, buffer_s16);
            masterusername = buffer_read(buffer, buffer_string);
            masterhp = buffer_read(buffer, buffer_s16);
            
            oMasterClient.x = xx
            oMasterClient.y = yy
            oMasterClient.direction = dd
            oMasterClient.name = masterusername
            oMasterClient.HP = masterhp
            with(oMasterClient){
            with(instance_nearest(x,y,oMasterClient_Turret))
            {x = oClient.xxt
            y = oClient.yyt
            image_angle = oClient.imt}}
            
            
        break;
        case MESSAGE_MOVE:
        
            var
            client = buffer_read(buffer, buffer_s16);
            xx = buffer_read(buffer, buffer_s16);
            yy = buffer_read(buffer, buffer_s16);
            dd = buffer_read(buffer, buffer_s16);
            xxt = buffer_read(buffer, buffer_s16);
            yyt = buffer_read(buffer, buffer_s16);
            imt = buffer_read(buffer, buffer_s16);
            nothing = buffer_read(buffer, buffer_s16);
            clientObject = client_get_object(client);
            cid = client;

            clientObject.x = xx;
            clientObject.y = yy;
            clientObject.direction = dd;
            with(oOtherClient_Turret)
            {if clientid = oClient.cid
            {x = oClient.xxt
            y = oClient.yyt
            image_angle = oClient.imt}}

            with(oServerClient){
                if(client_id != client_id_current){
                    network_send_raw(self.socket_id, other.send_buffer, buffer_tell(other.send_buffer));
                }
            }
        break;
        case MESSAGE_JOIN:
        
            var
            client = buffer_read(buffer, buffer_s16);
            otherusername = buffer_read(buffer, buffer_string);
            usernamemsg = buffer_read(buffer, buffer_s16);
            clientObject = client_get_object(client);
            if usernamemsg = true{
            drawmsgtimer = 200
            drawjoinmsg=true
            drawleavemsg=false}
            
            clientObject.name = otherusername;
            clientObject.clientid = client;

            with(oServerClient){
                if(client_id != client_id_current){
                    network_send_raw(self.socket_id, other.send_buffer, buffer_tell(other.send_buffer));
                }
            }

        break; 
        case MESSAGE_LEAVE:
        
            var
            client = buffer_read(buffer, buffer_s16);
            tempObject = client_get_object(client)
            otherusername = tempObject.name
            drawmsgtimer = 200
            drawleavemsg = true
            drawjoinmsg=false
            
            with(tempObject){
                instance_destroy();}

        break;
        case MESSAGE_POSITION:
            var
            objecttype = buffer_read(buffer, buffer_s16);
            xx = buffer_read(buffer, buffer_s16);
            yy = buffer_read(buffer, buffer_s16);
            dd = buffer_read(buffer, buffer_s16);
            objid = buffer_read(buffer, buffer_s16);
            objectdestroy = buffer_read(buffer, buffer_s16);           
            clientidid = buffer_read(buffer, buffer_s16);
            objectHP = buffer_read(buffer, buffer_s16);
            
            if objecttype = 1
            {client_create_object(oBullet,2,xx,yy,dd,objid,objectdestroy,clientidid,objectHP)}
            if objecttype = 2
            {client_create_object(oBullet_Enemy,1,xx,yy,dd,objid,objectdestroy,clientidid,objectHP)}
            if objecttype = 3
            {client_create_object(oEnemy,3,xx,yy,dd,objid,objectdestroy,clientidid,objectHP)}
            if objecttype = 4
            {client_create_object(oEnemyTurret,3,xx,yy,dd,objid,objectdestroy,clientidid,objectHP)}
            if objecttype = 5
            {client_create_object(oBox,3,xx,yy,dd,objid,objectdestroy,clientidid,objectHP)}
            if objecttype = 6
            {client_create_object(oItem,4,xx,yy,dd,objid,objectdestroy,clientidid,objectHP)}

            bz=buffer_tell(buffer)
        break;
        case MESSAGE_INCREASE_SCORE:
        var
        clientidid = buffer_read(buffer, buffer_s16);
        
        if clientidid = clientid{
        scorepoints +=1}
    
        break;
        
        case MESSAGE_CREATE:
        
        var
        xx = buffer_read(buffer, buffer_s16);
        yy = buffer_read(buffer, buffer_s16);
        audio_play_sound_at(snd_Fire,xx,yy,0,100,20,0.5,false,1)    
        break;
    }


    if(buffer_tell(buffer) == buffer_get_size(buffer)){
        break;
    }
    
}
 

FrostyCat

Redemption Seeker
I'm not hashing the entire outgoing buffer, I'm only hashing the part after the hash. This is probably the part you got wrong.

The outgoing buffer looks like this when finished:
  • 0-39: SHA1 hash of positions 40 through end (starts as xxxxxxxxxxxxxxxxxxxx, but overwritten afterwards by actual SHA1 hash)
  • 40: Null terminator for hash string
  • 41...end: Body
When you receive the message, the incoming buffer should have the same format if it arrived intact. You validate it by checking that it's big enough for a hash (at least 40 bytes) and then reading that hash, then comparing it against the SHA1 hash of the section from position 40 through the end. If it matches, you can continue reading the buffer as usual, starting with your message ID followed by the corresponding additional message fields.
 

Alituma

Member
I'm not hashing the entire outgoing buffer, I'm only hashing the part after the hash. This is probably the part you got wrong.

The outgoing buffer looks like this when finished:
  • 0-39: SHA1 hash of positions 40 through end (starts as xxxxxxxxxxxxxxxxxxxx, but overwritten afterwards by actual SHA1 hash)
  • 40: Null terminator for hash string
  • 41...end: Body
When you receive the message, the incoming buffer should have the same format if it arrived intact. You validate it by checking that it's big enough for a hash (at least 40 bytes) and then reading that hash, then comparing it against the SHA1 hash of the section from position 40 through the end. If it matches, you can continue reading the buffer as usual, starting with your message ID followed by the corresponding additional message fields.
First I put the code you give me for the server on one message without putting the code that is for client and the game works fine without problems even ("xxxxxxxxxxxxxx") message before the message id I do not know how the game still works then tried to read the hash using buffer_read(async_load[? "buffer"],buffer_string) I get an empty string. when change hash position in the message by putting it after message id and change buffer seek offset from 0 to 4. then read it after reading the message id. finally its reading the sent hash BUT its not the same as the buffer hashing. tried to change the offset and sizes to make it hashing the last message while in game. neither that work they still not same what is going on with my code? I tried lots of things like changing all the code, replacing somethings and putting it before messages. they still not work. do you have a project that contains that checksum checking? because all ideas are end of my mind for what to do. also I do not think I will fix it with only some tips or commands as I do not know why they do not work with me even when putting them in the right place.
 

Alituma

Member
I do not have game maker studio 2 can you export the files in .gmez or .gmx for me please?
 
Last edited:

Alituma

Member
Your code is working only with one message ID. I saw your project and made my code almost like it and saw that the hash does not match with the sent hash but when removed all messages ID and keep one message ID the hash match with the sent hash. well not sure but if I have to build a game on only one message ID its hard and might be so laggy. maybe the way I made networking in my project is different that make it does not work with your code I do not know. I just followed this Tutorial but I have added some other things. but if your code works with more than one message ID then I do not know what to do. I made you tired with me sorry for inconvenience and thank you.
 

FrostyCat

Redemption Seeker
The number of message IDs is not the point of my example, just add more cases for other message IDs. The important thing is that you do all of the following:
  • Use buffer_start_signed before writing anything to the outbound buffer
  • Use buffer_end_signed after you are done writing to the outbound buffer, but before you send the message
  • DO NOT write anything more to the outbound buffer after you call buffer_end_signed (or you'll invalidate the signature)
  • Check buffer_check_signed once when you receive an incoming buffer, before you even attempt to read the ID or the rest of the message body
Here is what one of your message-sending fragments will look like:
GML:
buffer_start_signed(send_buffer);
buffer_write(send_buffer, buffer_u8, MESSAGE_SELFID);
buffer_write(send_buffer, buffer_s16, client_id_current);
buffer_end_signed(send_buffer);
with (oServerClient) {
    if (client_id = client_id_current) {
        network_send_raw(self.socket_id, other.send_buffer, buffer_tell(other.send_buffer)); //self and other
    }
}
And what your client-side message-receiving code will look like:
GML:
if (buffer_check_signed(buffer)) {
    var message_id = buffer_read(buffer, buffer_u8);
    switch (message_id) {
        case CONNECTION_CHECKER:
            lastingtimer = buffer_read(buffer, buffer_s16);
        break;
        case MESSAGE_SELFID:
            clientid = buffer_read(buffer, buffer_s16);
        break;
        ...
    }
}
 

Alituma

Member
Looks like Im going to give up now I copied the code and put it in my project and it showed an error attempting to read from outside the buffer on that var hash = buffer_read(argument0,buffer_string)When putting buffer_check_signed in the script. And if I put it in the networking event in client instead of putting it in the client script nothing being received. Well there is only one thing to fix this but I do not want to annoy you with me and its not that important but just if you want... do you want me to upload my project for you and see whats going on and whats wrong? its not problem if you do not want and thanks so much for your help really appreciate that. I might try what I got from you.
 

Alituma

Member
Well I think I resolved the problem but it will take somewhat long time to finish rebuilding the messages. what I have done is adding 2 more arguments to your buffer_check_signed script
GML:
///buffer_check_signed(buffer,offset,size)
var bufferSize = buffer_get_size(argument0);
if (bufferSize < 40) return false;
var hash = buffer_read(argument0, buffer_string);
var hashOfData = buffer_sha1(argument0, argument1, bufferSize-argument2);
return hash == hashOfData;
the two arguments are for the offset to choose when adding more messages IDs with content you should specific the offset for every new message. The second argument is for size as you need to change it for all messages every time you add new message ID as you do not know what message would you add as well as it's size. Here is two messages that working with that in the client script (nevermind about offset 41 that's because I moved the buffer_start_signed after the message ID and changed that in the script also)
GML:
///client_handle_message(buffer);

var
buffer = argument0;


while(true)
{

    var
    message_id = buffer_read(buffer, buffer_u8);



    switch(message_id)
    {
 
        case CONNECTION_CHECKER:
        if buffer_check_signed(buffer,41,101){
        lastingtimer = buffer_read(buffer, buffer_s16);}
        break;
        case MESSAGE_MMOVE:
        if buffer_check_signed(buffer,85,41){
            var
            xx = buffer_read(buffer, buffer_s16);
            yy = buffer_read(buffer, buffer_s16);
            dd = buffer_read(buffer, buffer_s16);
            xxt = buffer_read(buffer, buffer_s16);
            yyt = buffer_read(buffer, buffer_s16);
            imt = buffer_read(buffer, buffer_s16);
            masterusername = buffer_read(buffer, buffer_string);
            masterhp = buffer_read(buffer, buffer_s16);
         
            oMasterClient.x = xx
            oMasterClient.y = yy
            oMasterClient.direction = dd
            oMasterClient.name = masterusername
            oMasterClient.HP = masterhp
            with(oMasterClient){
            with(instance_nearest(x,y,oMasterClient_Turret))
            {x = oClient.xxt
            y = oClient.yyt
            image_angle = oClient.imt}}}
         
         
        break;
    }


    if(buffer_tell(buffer) == buffer_get_size(buffer)){
        break;
    }

}
but still not sure if it works with the buffers that send lots of instances positions and its stats like enemy health with every instance. anyway thanks so much for your help
 
Last edited:

Alituma

Member
The number of message IDs is not the point of my example, just add more cases for other message IDs. The important thing is that you do all of the following:
  • Use buffer_start_signed before writing anything to the outbound buffer
  • Use buffer_end_signed after you are done writing to the outbound buffer, but before you send the message
  • DO NOT write anything more to the outbound buffer after you call buffer_end_signed (or you'll invalidate the signature)
  • Check buffer_check_signed once when you receive an incoming buffer, before you even attempt to read the ID or the rest of the message body
Here is what one of your message-sending fragments will look like:
GML:
buffer_start_signed(send_buffer);
buffer_write(send_buffer, buffer_u8, MESSAGE_SELFID);
buffer_write(send_buffer, buffer_s16, client_id_current);
buffer_end_signed(send_buffer);
with (oServerClient) {
    if (client_id = client_id_current) {
        network_send_raw(self.socket_id, other.send_buffer, buffer_tell(other.send_buffer)); //self and other
    }
}
And what your client-side message-receiving code will look like:
GML:
if (buffer_check_signed(buffer)) {
    var message_id = buffer_read(buffer, buffer_u8);
    switch (message_id) {
        case CONNECTION_CHECKER:
            lastingtimer = buffer_read(buffer, buffer_s16);
        break;
        case MESSAGE_SELFID:
            clientid = buffer_read(buffer, buffer_s16);
        break;
        ...
    }
}
I pull my words I gave up might change to another game engine. The problem in codes was solved until i tested the game in an android and connected to the PC server on same router and its work good until the same error that I done all this to solve showed what happened? I made the checksum and sizes correctly why is that? also I draw the size variable in the room and saw that it is going bigger than usual. its size should be constant at 104 but it sometimes became 104 and sometimes became larger like 312 why is that I think game maker is broken so might change on another engine.
 
Top