sounds and screens with improved matchmaker
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using Mirror;
|
||||
@@ -10,19 +11,37 @@ public class CupidConnector : MonoBehaviour
|
||||
{
|
||||
#if UNITY_SERVER
|
||||
//Server code
|
||||
string[] args = System.Environment.GetCommandLineArgs();
|
||||
string[] args = Environment.GetCommandLineArgs();
|
||||
int matchId = 0;
|
||||
string dedicatedSecret = "38516e39d3406225b7c3015a66e5d25c54e9b2024c0755212122bdcea3e3a328";
|
||||
string internalApiBase = null;
|
||||
for (int i = 0; i < args.Length; i++)
|
||||
{
|
||||
if (args[i].Contains("-port"))
|
||||
if (args[i].Contains("-port") && i + 1 < args.Length)
|
||||
{
|
||||
Cupid.RoomPort = int.Parse(args[i+1]);
|
||||
Cupid.RoomPort = int.Parse(args[i + 1]);
|
||||
Logger.SetFileName(Cupid.RoomPort.ToString());
|
||||
}
|
||||
}
|
||||
if (i + 1 < args.Length)
|
||||
{
|
||||
if (string.Equals(args[i], "-matchId", StringComparison.OrdinalIgnoreCase)
|
||||
|| string.Equals(args[i], "-matchid", StringComparison.OrdinalIgnoreCase))
|
||||
int.TryParse(args[i + 1], out matchId);
|
||||
else if (string.Equals(args[i], "-dedicatedSecret", StringComparison.OrdinalIgnoreCase))
|
||||
dedicatedSecret = args[i + 1];
|
||||
else if (string.Equals(args[i], "-internalApiBase", StringComparison.OrdinalIgnoreCase))
|
||||
internalApiBase = args[i + 1];
|
||||
}
|
||||
}
|
||||
GameManager.ConfigureDedicatedMatchReporting(matchId);
|
||||
if(Cupid.RoomPort < 0){
|
||||
Logger.Log("Invalid port, Did you pass the -port arguement?");
|
||||
return;
|
||||
}
|
||||
if(matchId <=0){
|
||||
Logger.Log("Invalid match id, Did you pass the -matchId arguement?");
|
||||
return;
|
||||
}
|
||||
transport.Port = (ushort)Cupid.RoomPort;
|
||||
Logger.Log($"Starting server at port {Cupid.RoomPort}");
|
||||
NetworkManager.singleton.StartServer();
|
||||
@@ -47,6 +66,7 @@ public class CupidConnector : MonoBehaviour
|
||||
}else{
|
||||
if(NetworkServer.connections.Count <= 0){
|
||||
Logger.Log("Closing port " + Cupid.RoomPort + " due to no players");
|
||||
GameManager.ReportDedicatedMatchRoomClosed();
|
||||
Application.Quit();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user