Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
critical snap bug
  • Loading branch information
evolutionleo committed Dec 1, 2020
1 parent 391122e commit 4b32d03
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 24 deletions.
10 changes: 4 additions & 6 deletions EmptyClient/EmptyClient.yyp

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion EmptyClient/notes/ProjectStructure/ProjectStructure.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Here's how the project's organized
TL;DR:
- handle input in HandlePacket() script
- handle output using network_write()
- change ip/port in __NetworkingConfig
- change ip/port in __NetworkingConfig (or input it in-game)
- don't worry about internal stuff

- best practice would to define all your
Expand Down
1 change: 1 addition & 0 deletions EmptyClient/objects/oClient/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ socket = network_create_socket(network_socket_tcp)
network_connect_raw_async(socket, IP, real(PORT));

// This can be used to initiate the server interaction
// (send the first packet)
onConnect = function() {
sendHello()
sendHello2()
Expand Down
12 changes: 6 additions & 6 deletions EmptyClient/options/windows/options_windows.yy

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions EmptyClient/scripts/HandlePacket/HandlePacket.gml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
function handlePacket(pack) {
var data = snap_from_messagepack(pack) // Deserialize msgpack into a struct
var cmd = string_lower(data.cmd) // you can get rid of this,
var data = snap_from_messagepack(pack) // Deserialize/unpack msgpack into a struct
var cmd = string_lower(data.cmd) // you can get rid of this line,
// i just like the commands being lowercase

trace("Received cmd: %", cmd)
Expand All @@ -15,7 +15,7 @@ function handlePacket(pack) {
trace(data.str)
break
case "message":
show_message_async(data.msg)
show_message_async(data.msg+"\n (c) Server")
break
// Add your custom commands here:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
//#macro PORT "1337"

// Debug
#macro IP "127.0.0.1"
#macro IP "127.0.0.1" // localhost
#macro PORT "1338"

// Allow up to 4000 ping (YYG recommends ~1000 for LAN-only games)
Expand Down
14 changes: 7 additions & 7 deletions EmptyClient/scripts/snap_to_messagepack/snap_to_messagepack.gml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
///
/// @param struct/array The data to be encoded. Can contain structs, arrays, strings, and numbers. N.B. Will not encode ds_list, ds_map etc.
///
/// @jujuadams 2020-09-13
/// @jujuadams 2020-11-06

//In the general case, functions/methods cannot be deserialised so we default to preventing their serialisation to begin with
//If you'd like to throw an error whenever this function tries to serialise a function/method, set SNAP_MESSAGEPACK_SERIALISE_FUNCTION_NAMES to -1
Expand Down Expand Up @@ -199,17 +199,17 @@ function __snap_to_messagepack_parser(_ds) constructor
else if (_value <= 0xffff)
{
buffer_write(buffer, buffer_u8, 0xcd);
buffer_write_little(buffer_u8, _value);
buffer_write_little(buffer_u16, _value);
}
else if (_value <= 0xffffffff)
{
buffer_write(buffer, buffer_u8, 0xce);
buffer_write_little(buffer_u8, _value);
buffer_write_little(buffer_u32, _value);
}
else
{
buffer_write(buffer, buffer_u8, 0xcf);
buffer_write_little(buffer_u8, _value);
buffer_write_little(buffer_u64, _value);
}
}
else if (_value == 0)
Expand All @@ -235,18 +235,18 @@ function __snap_to_messagepack_parser(_ds) constructor
else if (_value <= 0xffff)
{
buffer_write(buffer, buffer_u8, 0xd1);
buffer_write_little(buffer_u8, _value);
buffer_write_little(buffer_u16, _value);
}
else if (_value <= 0xffffffff)
{
buffer_write(buffer, buffer_u8, 0xd2);
buffer_write_little(buffer_u8, _value);
buffer_write_little(buffer_u32, _value);
}
else
{
//!!! No signed 64-bit integer read in GameMaker so this might be redundant
buffer_write(buffer, buffer_u8, 0xd3);
buffer_write_little(buffer_u8, _value);
buffer_write_little(buffer_u64, _value);
}
}
}
Expand Down
Binary file added Release/EmptyServer.zip
Binary file not shown.
Binary file added Release/OnlineFramework.yymps
Binary file not shown.
2 changes: 2 additions & 0 deletions desktop.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[LocalizedFileNames]
OnlineFramework.yymps[email protected],0

0 comments on commit 4b32d03

Please sign in to comment.