Compare commits
4 Commits
a7db3817a6
...
v4.0.1
| Author | SHA1 | Date | |
|---|---|---|---|
| ba9d5563df | |||
| 7676f1c809 | |||
| dc8598a5c9 | |||
| 51c57cd932 |
@@ -75,6 +75,7 @@
|
|||||||
<Compile Include="RamoSphere.cs" />
|
<Compile Include="RamoSphere.cs" />
|
||||||
<Compile Include="Rocket.cs" />
|
<Compile Include="Rocket.cs" />
|
||||||
<Compile Include="SeaData.cs" />
|
<Compile Include="SeaData.cs" />
|
||||||
|
<Compile Include="SemVer.cs" />
|
||||||
<Compile Include="Settings.cs" />
|
<Compile Include="Settings.cs" />
|
||||||
<Compile Include="Skidmarks.cs" />
|
<Compile Include="Skidmarks.cs" />
|
||||||
<Compile Include="SoundEffect.cs" />
|
<Compile Include="SoundEffect.cs" />
|
||||||
|
|||||||
@@ -1099,7 +1099,8 @@ public class Game : MonoBehaviour
|
|||||||
veh.isBot ? 1 : 0,
|
veh.isBot ? 1 : 0,
|
||||||
veh.isIt,
|
veh.isIt,
|
||||||
veh.score,
|
veh.score,
|
||||||
veh.specialInput ? 1 : 0);
|
veh.specialInput ? 1 : 0,
|
||||||
|
veh.zorbBall);
|
||||||
veh.networkView.RPC(
|
veh.networkView.RPC(
|
||||||
"sC",
|
"sC",
|
||||||
player,
|
player,
|
||||||
@@ -1108,8 +1109,7 @@ public class Game : MonoBehaviour
|
|||||||
veh.vehicleColor.b,
|
veh.vehicleColor.b,
|
||||||
veh.vehicleAccent.r,
|
veh.vehicleAccent.r,
|
||||||
veh.vehicleAccent.g,
|
veh.vehicleAccent.g,
|
||||||
veh.vehicleAccent.b,
|
veh.vehicleAccent.b);
|
||||||
veh.zorbBall);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Sync Server Prefs
|
//Sync Server Prefs
|
||||||
@@ -1876,6 +1876,7 @@ public class Game : MonoBehaviour
|
|||||||
plyVeh.zorbBall = zorbBall;
|
plyVeh.zorbBall = zorbBall;
|
||||||
|
|
||||||
if (viewID.isMine && isBot == 0) Player = plyObj;
|
if (viewID.isMine && isBot == 0) Player = plyObj;
|
||||||
|
if (plyVeh.isIt == 1) QuarryVeh = plyVeh;
|
||||||
}
|
}
|
||||||
|
|
||||||
[RPC]
|
[RPC]
|
||||||
@@ -2055,7 +2056,7 @@ public class Game : MonoBehaviour
|
|||||||
}
|
}
|
||||||
|
|
||||||
[RPC]
|
[RPC]
|
||||||
public void sSH(string sname, string sworld, string swelcome, string sblacklist, string spassword, float gVersion, bool shidden, NetworkMessageInfo info)
|
public void sSH(string sname, string sworld, string swelcome, string sblacklist, string spassword, SemVer gVersion, bool shidden, NetworkMessageInfo info)
|
||||||
{
|
{
|
||||||
serverName = sname;
|
serverName = sname;
|
||||||
Settings.serverWelcome = swelcome;
|
Settings.serverWelcome = swelcome;
|
||||||
|
|||||||
@@ -4,7 +4,8 @@ using UnityEngine;
|
|||||||
[Serializable]
|
[Serializable]
|
||||||
public class GameData : MonoBehaviour
|
public class GameData : MonoBehaviour
|
||||||
{
|
{
|
||||||
public static float gameVersion = 4.0f;
|
//public static float gameVersion = 4.0f;
|
||||||
|
public static SemVer gameVersion = new SemVer("4.0.1");
|
||||||
public static float serverVersion = 0.2f;
|
public static float serverVersion = 0.2f;
|
||||||
public static string gameName = "marsxplr";
|
public static string gameName = "marsxplr";
|
||||||
public static string userName = "";
|
public static string userName = "";
|
||||||
|
|||||||
@@ -136,11 +136,8 @@ public class Lobby : MonoBehaviour
|
|||||||
String[] val = tmp.ToArray();
|
String[] val = tmp.ToArray();
|
||||||
|
|
||||||
if (
|
if (
|
||||||
val[0] == "v" &&
|
val[0] == "sv" &&
|
||||||
float.Parse(
|
SemVer.Parse(val[1]) > GameData.gameVersion)
|
||||||
val[1],
|
|
||||||
CultureInfo.InvariantCulture.NumberFormat
|
|
||||||
) > (float)GameData.gameVersion)
|
|
||||||
{
|
{
|
||||||
outdated = val[1];
|
outdated = val[1];
|
||||||
}
|
}
|
||||||
@@ -907,7 +904,7 @@ public class Lobby : MonoBehaviour
|
|||||||
HostData[] data = MasterServer.PollHostList();
|
HostData[] data = MasterServer.PollHostList();
|
||||||
|
|
||||||
String[] serverData;
|
String[] serverData;
|
||||||
float gameVersion;
|
SemVer gameVersion;
|
||||||
float serverVersion;
|
float serverVersion;
|
||||||
|
|
||||||
//Precull Data
|
//Precull Data
|
||||||
@@ -922,13 +919,13 @@ public class Lobby : MonoBehaviour
|
|||||||
if (filterNATHosts && element.useNat) continue;
|
if (filterNATHosts && element.useNat) continue;
|
||||||
|
|
||||||
serverData = element.comment.Split(";"[0]);
|
serverData = element.comment.Split(";"[0]);
|
||||||
gameVersion = 0.0f;
|
gameVersion = new SemVer(0);
|
||||||
serverVersion = 0.0f;
|
serverVersion = 0.0f;
|
||||||
foreach (String dat in serverData)
|
foreach (String dat in serverData)
|
||||||
{
|
{
|
||||||
if (dat == "") continue;
|
if (dat == "") continue;
|
||||||
vals = dat.Split("="[0]);
|
vals = dat.Split("="[0]);
|
||||||
if (vals[0] == "v") gameVersion = float.Parse(vals[1]);
|
if (vals[0] == "v") gameVersion = SemVer.Parse(vals[1]);
|
||||||
if (vals[0] == "d") serverVersion = float.Parse(vals[1]);
|
if (vals[0] == "d") serverVersion = float.Parse(vals[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -961,7 +958,7 @@ public class Lobby : MonoBehaviour
|
|||||||
masterServerConFailures = 0;
|
masterServerConFailures = 0;
|
||||||
masterServerMessage = "";
|
masterServerMessage = "";
|
||||||
serverData = element.comment.Split(";"[0]);
|
serverData = element.comment.Split(";"[0]);
|
||||||
gameVersion = 0.0f;
|
gameVersion = new SemVer(0);
|
||||||
serverVersion = 0.0f;
|
serverVersion = 0.0f;
|
||||||
String serverWorld = "";
|
String serverWorld = "";
|
||||||
String serverPlayers = "";
|
String serverPlayers = "";
|
||||||
@@ -973,7 +970,7 @@ public class Lobby : MonoBehaviour
|
|||||||
{
|
{
|
||||||
if (dat == "") continue;
|
if (dat == "") continue;
|
||||||
vals = dat.Split("="[0]);
|
vals = dat.Split("="[0]);
|
||||||
if (vals[0] == "v") gameVersion = float.Parse(vals[1]);
|
if (vals[0] == "v") gameVersion = SemVer.Parse(vals[1]);
|
||||||
if (vals[0] == "d") serverVersion = float.Parse(vals[1]);
|
if (vals[0] == "d") serverVersion = float.Parse(vals[1]);
|
||||||
else if (vals[0] == "w") serverWorld = vals[1];
|
else if (vals[0] == "w") serverWorld = vals[1];
|
||||||
else if (vals[0] == "p") serverPlayers = vals[1];
|
else if (vals[0] == "p") serverPlayers = vals[1];
|
||||||
|
|||||||
@@ -0,0 +1,115 @@
|
|||||||
|
using System;
|
||||||
|
|
||||||
|
public class SemVer
|
||||||
|
{
|
||||||
|
public byte maj;
|
||||||
|
public byte min;
|
||||||
|
public byte patch;
|
||||||
|
|
||||||
|
public SemVer(byte mj, byte mn, byte pt)
|
||||||
|
{
|
||||||
|
maj = mj;
|
||||||
|
min = mn;
|
||||||
|
patch = pt;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SemVer(byte mj, byte mn)
|
||||||
|
{
|
||||||
|
maj = mj;
|
||||||
|
min = mn;
|
||||||
|
patch = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SemVer(byte mj)
|
||||||
|
{
|
||||||
|
maj = mj;
|
||||||
|
min = 0;
|
||||||
|
patch = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public SemVer(String str)
|
||||||
|
{
|
||||||
|
SemVer sv = SemVer.Parse(str);
|
||||||
|
maj = sv.maj;
|
||||||
|
min = sv.min;
|
||||||
|
patch = sv.patch;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator ==(SemVer a, SemVer b)
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
a.maj == b.maj &&
|
||||||
|
a.min == b.min &&
|
||||||
|
a.patch == b.patch);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator !=(SemVer a, SemVer b)
|
||||||
|
{
|
||||||
|
return (
|
||||||
|
a.maj != b.maj ||
|
||||||
|
a.min != b.min ||
|
||||||
|
a.patch != b.patch);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator >(SemVer a, SemVer b)
|
||||||
|
{
|
||||||
|
return a.maj > b.maj ? true :
|
||||||
|
a.min > b.min ? true :
|
||||||
|
a.patch > b.patch ? true :
|
||||||
|
false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator >=(SemVer a, SemVer b)
|
||||||
|
{
|
||||||
|
return a.maj >= b.maj ? true :
|
||||||
|
a.min >= b.min ? true :
|
||||||
|
a.patch >= b.patch ? true :
|
||||||
|
false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator <=(SemVer a, SemVer b)
|
||||||
|
{
|
||||||
|
return b > a;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static bool operator <(SemVer a, SemVer b)
|
||||||
|
{
|
||||||
|
return b >= a;
|
||||||
|
}
|
||||||
|
|
||||||
|
public override string ToString()
|
||||||
|
{
|
||||||
|
if (patch == 0) return maj.ToString() + "." + min.ToString();
|
||||||
|
return maj.ToString() + "." + min.ToString() + "." + patch.ToString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static SemVer Parse(String str)
|
||||||
|
{
|
||||||
|
String[] sv = str.Split("."[0]);
|
||||||
|
if (sv.Length == 3) return new SemVer(
|
||||||
|
byte.Parse(sv[0]),
|
||||||
|
byte.Parse(sv[1]),
|
||||||
|
byte.Parse(sv[2]));
|
||||||
|
if (sv.Length == 2) return new SemVer(
|
||||||
|
byte.Parse(sv[0]),
|
||||||
|
byte.Parse(sv[1]));
|
||||||
|
if (sv.Length == 1) return new SemVer(
|
||||||
|
byte.Parse(sv[0]));
|
||||||
|
throw new FormatException();
|
||||||
|
}
|
||||||
|
|
||||||
|
public override int GetHashCode()
|
||||||
|
{
|
||||||
|
return maj.GetHashCode() ^ (min.GetHashCode() << 2) ^ (patch.GetHashCode() >> 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
public override bool Equals(object other)
|
||||||
|
{
|
||||||
|
if (!(other is SeaData)) return false;
|
||||||
|
SemVer osv = (SemVer)other;
|
||||||
|
return (
|
||||||
|
osv.maj == maj &&
|
||||||
|
osv.min == min &&
|
||||||
|
osv.patch == patch);
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -43,7 +43,7 @@
|
|||||||
>
|
>
|
||||||
<Tool
|
<Tool
|
||||||
Name="VCNMakeTool"
|
Name="VCNMakeTool"
|
||||||
BuildCommandLine="s"
|
BuildCommandLine="if exist "$(SolutionDir)\marsxplr_build\Mars Explorer_Data\lib" rd /S /Q "$(SolutionDir)marsxplr_build\Mars Explorer_Data\lib"
if exist "$(SolutionDir)marsxplr_build\Mars Explorer_Data" rd /S /Q "$(SolutionDir)marsxplr_build\Mars Explorer_Data"
md $(SolutionDir)marsxplr_build
md "$(SolutionDir)marsxplr_build\Mars Explorer_Data"
md "$(SolutionDir)marsxplr_build\Mars Explorer_Data\lib""
|
||||||
ReBuildCommandLine=""
|
ReBuildCommandLine=""
|
||||||
CleanCommandLine=""
|
CleanCommandLine=""
|
||||||
Output=""
|
Output=""
|
||||||
|
|||||||
Reference in New Issue
Block a user