-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
23f959f
commit 5115818
Showing
29 changed files
with
343 additions
and
302 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/// @description attempt to connect | ||
|
||
status = "Connecting."; | ||
connecting = true; | ||
net_connect("127.0.0.1", 3001); | ||
alarm[1] = 20; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/// @description | ||
if (connecting) { | ||
status += "."; | ||
alarm[1] = 20; | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,48 @@ | ||
/// @description | ||
/// @description set up | ||
net_init(); | ||
|
||
playerId = "Unregistered"; | ||
username = "Unnamed"; | ||
registered = false; | ||
messageOfTheDay = "No MotD"; | ||
status = "Idle"; | ||
connecting = false; | ||
|
||
net_cmd_add_handler("register", function(data) { | ||
playerId = data[? "playerId"]; | ||
username = data[? "username"]; | ||
registered = data[? "registered"]; | ||
status = "Registered. Press <space> to disconnect."; | ||
}); | ||
|
||
net_cmd_add_handler("joined", function(data) { | ||
net_cmd_add_handler("welcome", function(data) { | ||
messageOfTheDay = data[? "motd"]; | ||
|
||
show_message("Message of the day:\n" + messageOfTheDay); | ||
var username = get_string("Connected! Enter a username.", "Player 1"); | ||
status = "Registering..."; | ||
|
||
var cmd = net_cmd_init("register"); | ||
cmd[? "username"] = username; | ||
net_cmd_send(cmd); | ||
}); | ||
|
||
net_cmd_add_handler("disconnected", function() { | ||
status = "Gracefully disconnected."; | ||
}); | ||
|
||
net_cmd_add_handler("dropped", function() { | ||
status = "Connection abruptly dropped."; | ||
}); | ||
|
||
net_cmd_add_handler("connectFailed", function() { | ||
status = "Failed to connect."; | ||
connecting = false; | ||
}); | ||
|
||
net_cmd_add_handler("connected", function() { | ||
connecting = false; | ||
status = "Connected."; | ||
}); | ||
|
||
|
||
alarm[0] = 10; | ||
|
||
net_connect("127.0.0.1", 3001); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,5 @@ | ||
/// @description | ||
draw_text(10, 10, playerId); | ||
draw_text(10, 30, "Message of the day: " + messageOfTheDay); | ||
/// @description draw info | ||
draw_text(10, 10, username); | ||
draw_text(10, 30, "Registration status: " + string(registered)); | ||
draw_text(10, 50, "Message of the day: " + messageOfTheDay); | ||
draw_text(10, 70, status); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
/// @description disconnect | ||
status = "Disconnecting..."; | ||
net_disconnect(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1 @@ | ||
/// @description | ||
net_cmd_resolve(); | ||
net_resolve(); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
18 changes: 0 additions & 18 deletions
18
src/patchwire-gm/scripts/net_cmd_add_handler/net_cmd_add_handler.gml
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
38 changes: 0 additions & 38 deletions
38
src/patchwire-gm/scripts/net_cmd_resolve/net_cmd_resolve.gml
This file was deleted.
Oops, something went wrong.
12 changes: 0 additions & 12 deletions
12
src/patchwire-gm/scripts/net_cmd_resolve/net_cmd_resolve.yy
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.