Updating logic for checking updates.
This commit is contained in:
parent
0dc7e3db06
commit
46cf4cd83c
8 changed files with 8 additions and 6 deletions
BIN
Terraria.suo
BIN
Terraria.suo
Binary file not shown.
|
|
@ -9,7 +9,7 @@ namespace Terraria
|
||||||
{
|
{
|
||||||
class ShankShock
|
class ShankShock
|
||||||
{
|
{
|
||||||
private static string version = "1";
|
private static int version = 1;
|
||||||
private static bool shownVersion = false;
|
private static bool shownVersion = false;
|
||||||
|
|
||||||
public static bool enableGuide = true;
|
public static bool enableGuide = true;
|
||||||
|
|
@ -48,10 +48,13 @@ namespace Terraria
|
||||||
{
|
{
|
||||||
string updateVersion = client.DownloadString("http://shankshock.com/tshock.txt");
|
string updateVersion = client.DownloadString("http://shankshock.com/tshock.txt");
|
||||||
string[] changes = updateVersion.Split(',');
|
string[] changes = updateVersion.Split(',');
|
||||||
float[] color = { 255, 255, 0 };
|
float[] color = { 255, 255, 000 };
|
||||||
if (updateVersion != version)
|
Console.WriteLine(changes.Length);
|
||||||
|
Console.WriteLine(changes[0]);
|
||||||
|
Console.WriteLine(changes[1]);
|
||||||
|
if (Convert.ToInt32(changes[0]) > version)
|
||||||
{
|
{
|
||||||
sendMessage(ply, "This server is out of date. Version " + updateVersion + " is out.", color);
|
sendMessage(ply, "This server is out of date. Version " + changes[0] + " is out.", color);
|
||||||
sendMessage(ply, changes[1], color);
|
sendMessage(ply, changes[1], color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1 @@
|
||||||
|
192.168.0.150
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
[Shank] [192.168.0.150]
|
|
||||||
[Shank] [192.168.0.150]
|
|
||||||
Binary file not shown.
Binary file not shown.
Loading…
Add table
Add a link
Reference in a new issue