From 8cc5918275b2362227f325d49dcec6c5227ec84c Mon Sep 17 00:00:00 2001 From: milesthenerd Date: Wed, 6 Jan 2021 13:35:13 -0600 Subject: [PATCH] Update to oClient to comment out F3 code --- README.md | 2 +- objects/oClient.object.gmx | 22 ++++++++++++++++++++-- 2 files changed, 21 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index fed28ed..78e0b9d 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ # AM2R-Community-Updates ## Co-op Changes -The source code here has the same requirements as the original repo in order for it to work. Only the code and my changes have been included. Also, the string compression scripts are by Homunculus: https://marketplace.yoyogames.com/assets/4560/strict . +The source code here has the same requirements as the original repo in order for it to work. Only the code and my changes have been included. Also, the string compression scripts are by Homunculus: https://marketplace.yoyogames.com/assets/4560/strict Currently syncs all items, metroids, events, and power-ups. diff --git a/objects/oClient.object.gmx b/objects/oClient.object.gmx index 0fd2c2c..665d7f1 100644 --- a/objects/oClient.object.gmx +++ b/objects/oClient.object.gmx @@ -25,8 +25,10 @@ 1 - strict_init("dictionary.json"); + network_set_config(network_config_connect_timeout, 5000); +strict_init("dictionary.json"); canSend = false; +connected = false; alarm[1] = 300; var type; type = network_socket_tcp; @@ -85,6 +87,9 @@ alarm[0] = 5; buffer_delete(buffer); ds_grid_destroy(global.onlineList); ds_grid_destroy(global.onlineSend); +if(connected){ + display_itemmsg("Disconnected", "", "", ""); +} @@ -228,7 +233,17 @@ if(!canSend){ 1 - if(keyboard_check_pressed(vk_f2)){ + if(!connected){ + if(isConnected >= 0){ + connected = true; + display_itemmsg("Connected", "", "", ""); + } else { + instance_destroy(); + display_itemmsg("Failed to connect", "Please try again", "", ""); + } +} + +if(keyboard_check_pressed(vk_f2)){ instance_destroy(); } @@ -313,6 +328,9 @@ switch(type_event){ buffer_delete(buffer); ds_grid_destroy(global.onlineList); ds_grid_destroy(global.onlineSend); +if(connected){ + display_itemmsg("Disconnected", "", "", ""); +}