-
Notifications
You must be signed in to change notification settings - Fork 1
Home
gnysek edited this page Aug 7, 2023
·
4 revisions
Welcome to the gm_boomers_networking
wiki!
- no
39dll.dll
file. - creating/closing sockets and network connections is done in a native GameMaker way, so no
tcpconnect(), tcplisten(), tcpaccept()
-
while (receivemessage(socket)) {}
is no more; instead, useGM Async - Networking
in normal way, and to getasync_load[? "buffer"]
intoglobal.buffer
which is default buffer here (created on game start), useseize_buffer(async_load[? "buffer"]);
- no
resetbuffer_target(), setbuffer(), freebuffer(), peekmessage(), setformat(), lastip(), setsync(), closesocket(), socklasterror(), myhost(), compareip(), sockexit(), sockstart(), hostip(), setsockopt(), getsockopt(), lastport(), getsockid(), tcpip(), setnagle(), tcpconnected(), alder32(), getmacaddress(), iptouint(), uinttoip(), netconnected()
- no
udpconnect()
- it's replaced by GM native UDP socket +sendmessage_udp(socket, ip, port, ...)
- no
bufferencrypt(), bufferdecrypt()
but if you reeaaaly need it: Reading old encoded files - no
fileopen, fileclose, filewrite, fileread, filepos, filesetpos, filesize
- as most of them can be done with native GM buffer functions, or with existing a'la 39dll functions - no
md5string(), md5buffer()
- no
dllinit(), dllfree()
;) - if you read more data than buffer, game will crash. I may try to add checking for reading more data than buffer have, but I need to make benchmarking first to ensure it's worth.
-
clearbuffer()
- it clearsglobal.buffer
(or any other given buffer), same as 39dll was doing it -
sendmessage(socket)
- it sends data from buffer to selected socket -
writebyte()/readbyte()
- same as in 39dll it writes/read UNSIGNED 1-byte (8-bit) -0 - 255
-
writeXXXX()/readXXXX()
- same as in 39dll it writes/read SIGNED data, where XXXX is:-
short
- 2-bytes integer-32_768 to +32_767
-
int
- 4-bytes integer-2_147_483_648 to +2_147_483_647
-
float
- 4-bytes decimal number~ -16_777_216.0 to +16_777_216.0
-
double
- 8-bytes decimal number
-
-
writeuXXXX()/readuXXXX()
- same as in 39dll it writes/read UNSIGNED data, where XXXX is:-
short
- 2-bytes integer0 to +65_536
-
int
- 4-bytes integer0 to +4_294_967_296
-
-
writestring()/readstring()
- for writing/reading strings, which are terminated withnull
-termiated aka0b0000_0000
aka0x00
-
writechars()/readchars()
- for writing/reading strings, but not terminated, so you need to know their length when reading (or add it to a buffer... which makes them less useful than null-terminated ones, except sending just few letters) -
getpos()
- returns position in buffer (alias tobuffer_tell()
) -
setpos()
- sets position in buffer (alias tobuffer_seek()
) -
buffsize()
- gets size of buffer (alias tobuffer_get_size()
) -
bytesleft()
- returns how many bytes left until end of buffer
-
seize_buffer
- to copyasync_load[? "buffer"]
intoglobal.buffer
-
write_sbyte()/read_sbyte()
- as for byte, 39dll by default was reading/writing UNSIGNED numbers, and for others SIGNED so they have theur u versions to write/read unsigned number too, I wanted to add sth similar for bytes to write signed numbers < 0 and >= 128. I choose to add underscore in those function names, aswritesbyte/readsbyte
would just sound like plural version of their names. Also, since 39dll didn't followed rules for this one function, why should I? ;)