6 Commits

6 changed files with 136 additions and 146 deletions
@@ -75,6 +75,7 @@
<Compile Include="RamoSphere.cs" />
<Compile Include="Rocket.cs" />
<Compile Include="SeaData.cs" />
<Compile Include="SemVer.cs" />
<Compile Include="Settings.cs" />
<Compile Include="Skidmarks.cs" />
<Compile Include="SoundEffect.cs" />
+10 -6
View File
@@ -1099,7 +1099,8 @@ public class Game : MonoBehaviour
veh.isBot ? 1 : 0,
veh.isIt,
veh.score,
veh.specialInput ? 1 : 0);
veh.specialInput ? 1 : 0,
veh.zorbBall);
veh.networkView.RPC(
"sC",
player,
@@ -1108,8 +1109,7 @@ public class Game : MonoBehaviour
veh.vehicleColor.b,
veh.vehicleAccent.r,
veh.vehicleAccent.g,
veh.vehicleAccent.b,
veh.zorbBall);
veh.vehicleAccent.b);
}
//Sync Server Prefs
@@ -1876,6 +1876,7 @@ public class Game : MonoBehaviour
plyVeh.zorbBall = zorbBall;
if (viewID.isMine && isBot == 0) Player = plyObj;
if (plyVeh.isIt == 1) QuarryVeh = plyVeh;
}
[RPC]
@@ -2055,7 +2056,7 @@ public class Game : MonoBehaviour
}
[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;
Settings.serverWelcome = swelcome;
@@ -2147,9 +2148,12 @@ public class Game : MonoBehaviour
public static string LanguageFilter(string str)
{
string patternMild = " crap | prawn |d4mn| damn | turd ";
/*string patternMild = " crap | prawn |d4mn| damn | turd ";
str = Regex.Replace(str, patternMild, ".", RegexOptions.IgnoreCase);
string pattern = "anus|ash0le|ash0les|asholes| ass |Ass Monkey|Assface|assh0le|assh0lez|bastard|bastards|bastardz|basterd|suka|asshole|assholes|assholz|asswipe|azzhole|bassterds|basterdz|Biatch|bitch|bitches|Blow Job|blowjob|in bed|butthole|buttwipe|c0ck|c0cks|c0k|Clit|cnts|cntz|cockhead| cock |cock-head|CockSucker|cock-sucker| cum |cunt|cunts|cuntz|dick|dild0|dild0s|dildo|dildos|dilld0|dilld0s|dominatricks|dominatrics|dominatrix|f.u.c.k|f u c k|f u c k e r|fag|fag1t|faget|fagg1t|faggit|faggot|fagit|fags|fagz|faig|faigs|fuck|fucker|fuckin|mother fucker|fucking|fucks|Fudge Packer|fuk|Fukah|Fuken|fuker|Fukin|Fukk|Fukkah|Fukken|Fukker|Fukkin|gay|gayboy|gaygirl|gays|gayz|God-dam|God dam|h00r|h0ar|h0re|jackoff|jerk-off|jizz|kunt|kunts|kuntz|Lesbian|Lezzian|Lipshits|Lipshitz|masochist|masokist|massterbait|masstrbait|masstrbate|masterbaiter|masterbate|masterbates|Motha Fucker|Motha Fuker|Motha Fukkah|Motha Fukker|Mother Fucker|Mother Fukah|Mother Fuker|Mother Fukkah|Mother Fukker|mother-fucker|Mutha Fucker|Mutha Fukah|Mutha Fuker|Mutha Fukkah|Mutha Fukker|orafis|orgasim|orgasm|orgasum|oriface|orifice|orifiss|packi|packie|packy|paki|pakie|peeenus|peeenusss|peenus|peinus|pen1s|penas|penis|penis-breath|penus|penuus|Phuc|Phuck|Phuk|Phuker|Phukker|polac|polack|polak|Poonani|pr1c|pr1ck|pr1k|pusse|pussee|pussy|puuke|puuker|queer|queers|queerz|qweers|qweerz|qweir|recktum|rectum|retard|sadist|scank|schlong|screwing| sex |sh1t|sh1ter|sh1ts|sh1tter|sh1tz|shit|shits|shitter|Shitty|Shity|shitz|Shyt|Shyte|Shytty|Shyty|skanck|skank|skankee| sob |skankey|skanks|Skanky|slut|sluts|Slutty|slutz|son-of-a-bitch|va1jina|vag1na|vagiina|vagina|vaj1na|vajina|vullva|vulva|xxx|b!+ch|bitch|blowjob|clit|arschloch|fuck|shit|asshole|b!tch|b17ch|b1tch|bastard|bi+ch|boiolas|buceta|c0ck|cawk|chink|clits|cunt|dildo|dirsa|ejakulate|fatass|fcuk|fuk|fux0r|l3itch|lesbian|masturbate|masterbat*|motherfucker|s.o.b.|mofo|nigga|nigger|n1gr|nigur|niiger|niigr|nutsack|phuck|blue balls|blue_balls|blueballs|pussy|scrotum|shemale|sh!t|slut|smut|teets|tits|boobs|b00bs|testical|testicle|titt|jackoff|whoar|whore|fuck|shit|arse|bi7ch|bitch|bollock|breasts|cunt|dick|fag |feces|fuk|futkretzn|gay|jizz|masturbat*|piss|poop|porn|p0rn|pr0n|shiz|splooge|b00b|testicle|titt|wank";
return Regex.Replace(str, pattern, "#", RegexOptions.IgnoreCase);
return Regex.Replace(str, pattern, "#", RegexOptions.IgnoreCase);*/
// the kids that played this game back then are no longer kids. little need to babysit them anymore
return str;
}
}
+2 -1
View File
@@ -4,7 +4,8 @@ using UnityEngine;
[Serializable]
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 string gameName = "marsxplr";
public static string userName = "";
+7 -138
View File
@@ -86,22 +86,6 @@ public class Lobby : MonoBehaviour
private bool dedicatedNAT;
// /*UNUSED*/ private int dedicatedHostAttempts;
private bool showAds = false;
adDesc[] gameAds;
class adDesc : UnityEngine.Object
{
public String url = "";
public String title = "";
public String desc = "";
public adDesc(String u, String t, String d)
{
this.url = u;
this.title = t;
this.desc = d;
}
}
public void Awake()
{
QualitySettings.currentLevel = QualityLevel.Fantastic;
@@ -111,9 +95,6 @@ public class Lobby : MonoBehaviour
public IEnumerator Start()
{
String adBrightUrl = "";
String adSenseUrl = "";
userPassword = PlayerPrefs.GetString("userPassword", "");
userCode = PlayerPrefs.GetString("userCode", "");
userRemembered = (PlayerPrefs.GetInt("userRemembered", 0) == 1 ? true : false);
@@ -155,11 +136,8 @@ public class Lobby : MonoBehaviour
String[] val = tmp.ToArray();
if (
val[0] == "v" &&
float.Parse(
val[1],
CultureInfo.InvariantCulture.NumberFormat
) > (float)GameData.gameVersion)
val[0] == "sv" &&
SemVer.Parse(val[1]) > GameData.gameVersion)
{
outdated = val[1];
}
@@ -167,10 +145,6 @@ public class Lobby : MonoBehaviour
{
hostDedicated = (val[1] == "1" || val[1] == "true");
}
else if (val[0] == "a")
{
showAds = (val[1] == "1" || val[1] == "true");
}
else if (val[0] == "m") msgs.Add(val[1]);
else if (val[0] == "w")
{
@@ -228,14 +202,6 @@ public class Lobby : MonoBehaviour
{
GameData.networkMode = int.Parse(val[1]);
}
else if (val[0] == "adbr")
{
adBrightUrl = val[1];
}
else if (val[0] == "adsn")
{
adSenseUrl = val[1];
}
}
}
else
@@ -247,60 +213,6 @@ public class Lobby : MonoBehaviour
messages = msgs.ToArray();
MasterServer.RequestHostList(gameName);
if (showAds)
{
List<adDesc> ads = new List<adDesc>();
//Adbrite
www = new WWW(adBrightUrl);
yield return www;
if (www.error == null)
{
MatchCollection matches = Regex.Matches(
www.data.Replace(
"\\\"",
"\""),
"<a[^>]*?class=\\\"adHeadline\\\"[^>]*?href=\\\"(.*?)\\\"[^>]*?>(.*?)</a>[^.]*?<a[^>]*?class=\\\"adText\\\"[^>]*?>(.*?)</a>");
foreach (Match match in matches)
{
adDesc ad = new adDesc(
match.Groups[1].ToString(),
htmlDecode(match.Groups[2].ToString()),
htmlDecode(match.Groups[3].ToString()));
if (UnityEngine.Random.value > .5) ads.Add(ad);
else ads.Insert(0, ad);
}
}
//Adsense
www = new WWW(adSenseUrl);
yield return www;
if (www.error == null)
{
MatchCollection matches = Regex.Matches(
www.data.Replace(
"\\\"",
"\""),
"<a[^>]*?class=adt[^>]*?href=\\\"(.*?)\\\"[^>]*?>(.*?)</a>[^.]*?<div[^>]*?class=adb[^>]*?>(.*?)</div>");
foreach (Match match in matches)
{
adDesc ad = new adDesc(
"http://googleads.g.doubleclick.net" +
match.Groups[1].ToString(),
htmlDecode(match.Groups[2].ToString()),
htmlDecode(match.Groups[3].ToString()));
if (ad.url.IndexOf("&nh=1") == -1) ad.url += "&nh=1";
ads.Insert(0, ad);
}
}
//Tally
if (ads.Count > 0)
{
gameAds = ads.ToArray();
}
}
}
public void OnFailedToConnectToMasterServer(NetworkConnectionError info)
@@ -992,7 +904,7 @@ public class Lobby : MonoBehaviour
HostData[] data = MasterServer.PollHostList();
String[] serverData;
float gameVersion;
SemVer gameVersion;
float serverVersion;
//Precull Data
@@ -1007,13 +919,13 @@ public class Lobby : MonoBehaviour
if (filterNATHosts && element.useNat) continue;
serverData = element.comment.Split(";"[0]);
gameVersion = 0.0f;
gameVersion = new SemVer(0);
serverVersion = 0.0f;
foreach (String dat in serverData)
{
if (dat == "") continue;
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]);
}
@@ -1041,40 +953,12 @@ public class Lobby : MonoBehaviour
System.Array.Sort(data, sortHostArray);
int i = 0;
float adCounter = 0.000f;
int adTicker = 0;
foreach (HostData element in data)
{
//Ads
if (showAds)
{
adCounter += (float)gameAds.Length / (float)data.Length;
if ((float)adTicker < adCounter && adTicker < gameAds.Length)
{
if (
GUILayout.Button(
gameAds[adTicker].title +
" ~ " +
gameAds[adTicker].desc,
"lobbyAd"))
{
OpenURL(gameAds[adTicker].url);
}
if (
Event.current.type != EventType.Layout &&
mouseInServerList &&
GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition))
{
serverDetails = "This advertisement helps bring Mars Explorer to you for free!\n\nIf you are interested in one of our sponsor's offers,\nplease be sure to check it out.";
}
adTicker++;
}
}
masterServerConFailures = 0;
masterServerMessage = "";
serverData = element.comment.Split(";"[0]);
gameVersion = 0.0f;
gameVersion = new SemVer(0);
serverVersion = 0.0f;
String serverWorld = "";
String serverPlayers = "";
@@ -1086,7 +970,7 @@ public class Lobby : MonoBehaviour
{
if (dat == "") continue;
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]);
else if (vals[0] == "w") serverWorld = vals[1];
else if (vals[0] == "p") serverPlayers = vals[1];
@@ -1179,21 +1063,6 @@ public class Lobby : MonoBehaviour
(serverVersion != 0.0 ? " (» Dedicated Host Server)" : "");
}
i++;
//"Advertise Here" Ad
if (showAds && i == data.Length)
{
if (GUILayout.Button("» Advertise on Mars Explorer! «", "lobbyAd"))
{
OpenURL("http://www.adbrite.com/mb/commerce/purchase_form.php?opid=1509409&&nr=1");
}
if (Event.current.type != EventType.Layout &&
mouseInServerList &&
GUILayoutUtility.GetLastRect().Contains(Event.current.mousePosition))
{
serverDetails = "That's right - you can bid directly to advertise inside Mars Explorer!\n\nPresent YOUR message to an audience\nof friendly Martians everywhere.";
}
}
}
}
if (activePlayersVisible == 0)
+115
View File
@@ -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);
}
}
+1 -1
View File
@@ -43,7 +43,7 @@
>
<Tool
Name="VCNMakeTool"
BuildCommandLine="s"
BuildCommandLine="if exist &quot;$(SolutionDir)\marsxplr_build\Mars Explorer_Data\lib&quot; rd /S /Q &quot;$(SolutionDir)marsxplr_build\Mars Explorer_Data\lib&quot;&#x0D;&#x0A;if exist &quot;$(SolutionDir)marsxplr_build\Mars Explorer_Data&quot; rd /S /Q &quot;$(SolutionDir)marsxplr_build\Mars Explorer_Data&quot;&#x0D;&#x0A;md $(SolutionDir)marsxplr_build&#x0D;&#x0A;md &quot;$(SolutionDir)marsxplr_build\Mars Explorer_Data&quot;&#x0D;&#x0A;md &quot;$(SolutionDir)marsxplr_build\Mars Explorer_Data\lib&quot;"
ReBuildCommandLine=""
CleanCommandLine=""
Output=""