How do I send and receive an image file

Posted by david134652
How do I send and receive an image file, so that the client replaces sprites??
Greetings from venezuela =)

Replies (2)

Last message on 6 Jun 2018

Size43 (Administrator) on 27 May 2018, 16:39:06
This is not supported by GameMaker Server at the moment.
Snowland on 6 Jun 2018, 03:00:49
This is actually supported by Game Maker Server(I've tried it myself). It's basically involves in;
*Creating a surface and drawing the image onto it.
*Passing the surface as a buffer : buffer_get_surface(buff, image_surface, 0, 0, 0);
*Encoding the buffer and converting it into a string var b_str = buffer_base64_encode(.....)

+Send it through Game Maker Serve gms_p2p_send...
+Receive the string and buffer_base64_decode(.....)
+Write the buffer onto surface with buffer_set_surface(......)
+Draw the surface draw_surface(...)

You can send screenshots or drawings to other users by this method. It's not very efficient, but it's the only way :)