Skip to content

Commit

Permalink
v4.0 pre-release! (Merge pull request #7 from evolutionleo/feature/ssp)
Browse files Browse the repository at this point in the history
Server-Side Physics (TypeScript)
  • Loading branch information
evolutionleo authored Nov 11, 2021
2 parents bf2c005 + 896f25f commit ee27413
Show file tree
Hide file tree
Showing 160 changed files with 47,134 additions and 402 deletions.
1 change: 1 addition & 0 deletions .gitignore.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
server_log.txt
69 changes: 42 additions & 27 deletions EmptyClient/EmptyClient.yyp

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

6 changes: 5 additions & 1 deletion EmptyClient/extensions/WinDev/WinDev.yy

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

4 changes: 2 additions & 2 deletions EmptyClient/notes/ProjectStructure/ProjectStructure.yy

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

2 changes: 1 addition & 1 deletion EmptyClient/objects/btnButton/btnButton.yy

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

2 changes: 1 addition & 1 deletion EmptyClient/objects/btnLogin/btnLogin.yy

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

2 changes: 1 addition & 1 deletion EmptyClient/objects/btnRegister/btnRegister.yy

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

2 changes: 1 addition & 1 deletion EmptyClient/objects/btnToLobbies/btnToLobbies.yy

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

2 changes: 1 addition & 1 deletion EmptyClient/objects/btnToLogin/btnToLogin.yy

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

2 changes: 1 addition & 1 deletion EmptyClient/objects/btnToMenu/btnToMenu.yy

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

11 changes: 11 additions & 0 deletions EmptyClient/objects/oBox/Step_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
/// @description Insert description here
// You can write your code in this editor
if (place_meeting(x + spd.x, y, oWall)) {
spd.x = 0
}
x += spd.x

if (place_meeting(x, y + spd.y, oWall)) {
spd.y = 0
}
y += spd.y
39 changes: 39 additions & 0 deletions EmptyClient/objects/oBox/oBox.yy

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

24 changes: 18 additions & 6 deletions EmptyClient/objects/oClient/Create_0.gml
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,28 @@

#region Connect!

socket = network_create_socket(network_socket_tcp)
// Async = Don't crash the game if the server is down
network_connect_raw_async(socket, IP, real(PORT));
connect = function() {
// if a packet is split in half, we use this
// -1 if no half-pack, a buffer otherwise
connecting = true
connected = false
halfpack = -1

alarm[0] = CONNECT_TIMEOUT

socket = network_create_socket(network_socket_tcp)
// Async = Don't crash the game if the server is down
network_connect_raw_async(socket, IP, real(PORT));
}

// connect/disconnect events defined in __NetworkingConfig.gml
onConnect = global.onConnect
onDisconnect = global.onDisconnect

#endregion

// if a packet is split in half, we use this
// -1 if no half-pack, a buffer otherwise
halfpack = -1

connecting = false
connected = false

connect()
4 changes: 4 additions & 0 deletions EmptyClient/objects/oClient/KeyPress_82.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/// @description Ctrl+R to reconnect

if (keyboard_check(vk_control))
connect()
4 changes: 4 additions & 0 deletions EmptyClient/objects/oClient/Other_68.gml
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,14 @@ switch(type) {
case network_type_non_blocking_connect:
case network_type_connect:
trace("Connected to the server!")
connected = true
connecting = false
onConnect()
break
case network_type_disconnect:
trace("Disconnected from the server!")
connected = false
connecting = false
onDisconnect()
break
}
6 changes: 6 additions & 0 deletions EmptyClient/objects/oClient/Step_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/// @description Reconnect

if (!connected and !connecting) {
trace("reconnecting...")
connect()
}
4 changes: 3 additions & 1 deletion EmptyClient/objects/oClient/oClient.yy

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

4 changes: 2 additions & 2 deletions EmptyClient/objects/oDemo/oDemo.yy

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

2 changes: 1 addition & 1 deletion EmptyClient/objects/oDualInstance/oDualInstance.yy

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

3 changes: 3 additions & 0 deletions EmptyClient/objects/oEntity/Create_0.gml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// @description This is the parent object for entities

use_uuid()
33 changes: 33 additions & 0 deletions EmptyClient/objects/oEntity/oEntity.yy

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

Loading

0 comments on commit ee27413

Please sign in to comment.