Skip to content

Commit

Permalink
Merge pull request #2 from TheGuayeah/lan
Browse files Browse the repository at this point in the history
Lan
  • Loading branch information
jonatanfm authored Jan 8, 2021
2 parents 16ede9e + d916b97 commit 470da5c
Show file tree
Hide file tree
Showing 101 changed files with 3,290 additions and 10,856 deletions.
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/Fonts/Bowlby_One/BowlbyOne-Regular SDF.asset.meta

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

Binary file modified Assets/Materials/Red.mat
Binary file not shown.
6 changes: 1 addition & 5 deletions Assets/Mirror/Runtime/NetworkManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -657,14 +657,13 @@ public virtual void OnApplicationQuit()
if (NetworkClient.isConnected)
{
StopClient();
print("OnApplicationQuit: stopped client");

}

// stop server after stopping client (for proper host mode stopping)
if (NetworkServer.active)
{
StopServer();
print("OnApplicationQuit: stopped server");
}
}

Expand Down Expand Up @@ -696,19 +695,16 @@ bool InitializeSingleton()
{
if (singleton != null)
{
logger.LogWarning("Multiple NetworkManagers detected in the scene. Only one NetworkManager can exist at a time. The duplicate NetworkManager will be destroyed.");
Destroy(gameObject);

// Return false to not allow collision-destroyed second instance to continue.
return false;
}
logger.Log("NetworkManager created singleton (DontDestroyOnLoad)");
singleton = this;
if (Application.isPlaying) DontDestroyOnLoad(gameObject);
}
else
{
logger.Log("NetworkManager created singleton (ForScene)");
singleton = this;
}

Expand Down
9 changes: 3 additions & 6 deletions Assets/Mirror/Runtime/Transport/Telepathy/Server.cs
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ void Listen(int port)
listener.Server.NoDelay = NoDelay;
listener.Server.SendTimeout = SendTimeout;
listener.Start();
Logger.Log("Server: listening port=" + port);

// keep accepting new clients
while (true)
Expand Down Expand Up @@ -160,18 +159,18 @@ void Listen(int port)
{
// UnityEditor causes AbortException if thread is still
// running when we press Play again next time. that's okay.
Logger.Log("Server thread aborted. That's okay. " + exception);
//Logger.Log("Server thread aborted. That's okay. " + exception);
}
catch (SocketException exception)
{
// calling StopServer will interrupt this thread with a
// 'SocketException: interrupted'. that's okay.
Logger.Log("Server Thread stopped. That's okay. " + exception);
//Logger.Log("Server Thread stopped. That's okay. " + exception);
}
catch (Exception exception)
{
// something went wrong. probably important.
Logger.LogError("Server Exception: " + exception);
//Logger.LogError("Server Exception: " + exception);
}
}

Expand All @@ -192,7 +191,6 @@ public bool Start(int port)
// start the listener thread
// (on low priority. if main thread is too busy then there is not
// much value in accepting even more clients)
Logger.Log("Server: Start port=" + port);
listenerThread = new Thread(() => { Listen(port); });
listenerThread.IsBackground = true;
listenerThread.Priority = ThreadPriority.BelowNormal;
Expand All @@ -206,7 +204,6 @@ public void Stop()
if (!Active)
return;

Logger.Log("Server: stopping...");

// stop listening to connections so that no one can connect while we
// close the client connections
Expand Down
3 changes: 0 additions & 3 deletions Assets/Mirror/Runtime/Transport/TelepathyTransport.cs
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,6 @@ void Awake()
client.MaxMessageSize = clientMaxMessageSize;
server.NoDelay = NoDelay;
server.MaxMessageSize = serverMaxMessageSize;

Debug.Log("TelepathyTransport initialized!");
}

public override bool Available()
Expand Down Expand Up @@ -227,7 +225,6 @@ public override string ServerGetClientAddress(int connectionId)
// common
public override void Shutdown()
{
Debug.Log("TelepathyTransport Shutdown()");
client.Disconnect();
server.Stop();
}
Expand Down
Binary file not shown.
8 changes: 8 additions & 0 deletions Assets/_Completed-Assets/InputSystem.meta

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

102 changes: 102 additions & 0 deletions Assets/_Completed-Assets/InputSystem/EnterPlayers.inputactions
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
{
"name": "EnterPlayers",
"maps": [
{
"name": "Player",
"id": "9d6c7dc0-5d18-42db-8f18-d4e5dcbc9875",
"actions": [
{
"name": "P1",
"type": "Button",
"id": "35dc2563-00d1-4c64-8d52-7c3587f8ab9f",
"expectedControlType": "Button",
"processors": "",
"interactions": "Press"
},
{
"name": "P2",
"type": "Button",
"id": "dfa3900b-bc96-47cb-ad82-cdb3bff7f052",
"expectedControlType": "Button",
"processors": "",
"interactions": "Press"
},
{
"name": "P3",
"type": "Button",
"id": "b8204696-f270-46f0-9ff0-13c1d836edf7",
"expectedControlType": "Button",
"processors": "",
"interactions": "Press"
},
{
"name": "P4",
"type": "Button",
"id": "0d9567a3-8fd6-4c4e-8d7a-35a54e71f501",
"expectedControlType": "Button",
"processors": "",
"interactions": "Press"
}
],
"bindings": [
{
"name": "",
"id": "fe480e54-0034-42ec-9bb0-1bdf0e2d7852",
"path": "<Keyboard>/e",
"interactions": "Press",
"processors": "",
"groups": "Keyboard",
"action": "P1",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "64650eec-c6c8-4850-b483-5a2675798063",
"path": "<Keyboard>/rightShift",
"interactions": "Press",
"processors": "",
"groups": "Keyboard",
"action": "P2",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "de994961-398c-4a0e-a791-63f07a9b9c3c",
"path": "<Keyboard>/y",
"interactions": "Press",
"processors": "",
"groups": "Keyboard",
"action": "P3",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "",
"id": "54b5e18f-15b2-4618-8551-e3a3138b361b",
"path": "<Keyboard>/o",
"interactions": "Press",
"processors": "",
"groups": "Keyboard",
"action": "P4",
"isComposite": false,
"isPartOfComposite": false
}
]
}
],
"controlSchemes": [
{
"name": "Keyboard",
"bindingGroup": "Keyboard",
"devices": [
{
"devicePath": "<Keyboard>",
"isOptional": false,
"isOR": false
}
]
}
]
}

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

127 changes: 127 additions & 0 deletions Assets/_Completed-Assets/InputSystem/Tank1.inputactions
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
{
"name": "Tank1",
"maps": [
{
"name": "Player",
"id": "9d6c7dc0-5d18-42db-8f18-d4e5dcbc9875",
"actions": [
{
"name": "MoveTank",
"type": "Value",
"id": "35dc2563-00d1-4c64-8d52-7c3587f8ab9f",
"expectedControlType": "Axis",
"processors": "",
"interactions": ""
},
{
"name": "RotateTank",
"type": "Value",
"id": "0cf73991-5578-48af-ba27-4b1109fe9812",
"expectedControlType": "Axis",
"processors": "",
"interactions": ""
},
{
"name": "ShootTank",
"type": "Value",
"id": "c64fdff5-d619-498a-b1db-7797a59646e3",
"expectedControlType": "Analog",
"processors": "",
"interactions": ""
}
],
"bindings": [
{
"name": "Movement",
"id": "7e1a2779-8c70-4f32-b36b-77295ca85195",
"path": "1DAxis",
"interactions": "Press",
"processors": "",
"groups": "",
"action": "MoveTank",
"isComposite": true,
"isPartOfComposite": false
},
{
"name": "positive",
"id": "f6534a06-32d4-4089-9ab9-0f252f47b675",
"path": "<Keyboard>/#(W)",
"interactions": "",
"processors": "",
"groups": "Keyboard",
"action": "MoveTank",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "negative",
"id": "161c9db7-e1c2-41ff-94f8-1db9bbf7cfc1",
"path": "<Keyboard>/#(S)",
"interactions": "",
"processors": "",
"groups": "Keyboard",
"action": "MoveTank",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "",
"id": "cb6830cc-e6fc-4f1e-836c-a6b329324d32",
"path": "<Keyboard>/space",
"interactions": "Press",
"processors": "",
"groups": "Keyboard",
"action": "ShootTank",
"isComposite": false,
"isPartOfComposite": false
},
{
"name": "Rotate",
"id": "e1a1bce5-6951-45b6-b360-7f1575f5478a",
"path": "1DAxis",
"interactions": "Press",
"processors": "",
"groups": "",
"action": "RotateTank",
"isComposite": true,
"isPartOfComposite": false
},
{
"name": "negative",
"id": "85cf392d-8a7a-4615-b448-a57d6a546602",
"path": "<Keyboard>/#(A)",
"interactions": "",
"processors": "",
"groups": "",
"action": "RotateTank",
"isComposite": false,
"isPartOfComposite": true
},
{
"name": "positive",
"id": "0035b7b9-47db-4705-b51d-141be4c17209",
"path": "<Keyboard>/#(D)",
"interactions": "",
"processors": "",
"groups": "",
"action": "RotateTank",
"isComposite": false,
"isPartOfComposite": true
}
]
}
],
"controlSchemes": [
{
"name": "Keyboard",
"bindingGroup": "Keyboard",
"devices": [
{
"devicePath": "<Keyboard>",
"isOptional": false,
"isOR": false
}
]
}
]
}
14 changes: 14 additions & 0 deletions Assets/_Completed-Assets/InputSystem/Tank1.inputactions.meta

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

Loading

0 comments on commit 470da5c

Please sign in to comment.