using System;
using System.Text;
using UnityEngine;

public class mSystem
{
	public const bool isDirect = false;

	public static int JAVA = 1;

	public static int ANDROID = 2;

	public static int IP_JB = 3;

	public static int PC = 4;

	public static int IP_APPSTORE = 5;

	public static int WINDOWS_PHONE = 6;

	public static int GOOGLE_PLAY = 7;

	public static int clientType = 4;

	public static int transColor = 16777215;

	public static bool isDrawRGB = true;

	public static bool isPC = Main.isPC;

	public static bool isSmartPhone = true;

	public static bool isIphone = false;

	public static bool disableSound;

	public static bool isAppStore = Main.clientType == 5;

	public static int yMoney = 9;

	public static string publicID;

	public static string strAdmob;

	public static bool loadAdOk;

	public static Image imgCircle_30;

	public static Image imgCircle_20;

	public static Image imgCircle_0;

	public static Image imgCircle_45;

	public static void showQuangCao(bool isShow)
	{
	}

	public static void createAdmob()
	{
	}

	public static void checkAdComlete()
	{
	}

	public static void arraycopy(sbyte[] scr, int scrPos, sbyte[] dest, int destPos, int lenght)
	{
		Array.Copy(scr, scrPos, dest, destPos, lenght);
	}

	public static void arraycopy(int[] scr, int scrPos, int[] dest, int destPos, int lenght)
	{
		Array.Copy(scr, scrPos, dest, destPos, lenght);
	}

	public static void arrayReplace(sbyte[] scr, int scrPos, ref sbyte[] dest, int destPos, int lenght)
	{
		if (scr != null && dest != null && scrPos + lenght <= scr.Length)
		{
			sbyte[] array = new sbyte[dest.Length + lenght];
			for (int i = 0; i < destPos; i++)
			{
				array[i] = dest[i];
			}
			for (int j = destPos; j < destPos + lenght; j++)
			{
				array[j] = scr[scrPos + j - destPos];
			}
			for (int k = destPos + lenght; k < array.Length; k++)
			{
				array[k] = dest[destPos + k - lenght];
			}
		}
	}

	public static long currentTimeMillis()
	{
		DateTime dateTime = new DateTime(1970, 1, 1, 0, 0, 0, DateTimeKind.Utc);
		return (DateTime.UtcNow.Ticks - dateTime.Ticks) / 10000;
	}

	public static void freeData()
	{
		Resources.UnloadUnusedAssets();
		GC.Collect();
	}

	public static sbyte[] convertToSbyte(byte[] scr)
	{
		sbyte[] array = new sbyte[scr.Length];
		for (int i = 0; i < scr.Length; i++)
		{
			array[i] = (sbyte)scr[i];
		}
		return array;
	}

	public static sbyte[] convertToSbyte(string scr)
	{
		ASCIIEncoding aSCIIEncoding = new ASCIIEncoding();
		byte[] bytes = aSCIIEncoding.GetBytes(scr);
		return convertToSbyte(bytes);
	}

	public static byte[] convetToByte(sbyte[] scr)
	{
		byte[] array = new byte[scr.Length];
		for (int i = 0; i < scr.Length; i++)
		{
			if (scr[i] > 0)
			{
				array[i] = (byte)scr[i];
			}
			else
			{
				array[i] = (byte)(scr[i] + 256);
			}
		}
		return array;
	}

	public static char[] ToCharArray(sbyte[] scr)
	{
		char[] array = new char[scr.Length];
		for (int i = 0; i < scr.Length; i++)
		{
			array[i] = (char)scr[i];
		}
		return array;
	}

	public static int currentHour()
	{
		return DateTime.Now.Hour;
	}

	public static void println(object str)
	{
		Debug.Log(str);
	}

	public static void gcc()
	{
		Resources.UnloadUnusedAssets();
		GC.Collect();
	}

	public static void createMap()
	{
		if (GameScr.mm != null)
		{
			GameScr.mm.update();
		}
	}

	public static void mNotify()
	{
		CRes.outz("notify");
		MessageHandler.isStopReadMessage = false;
	}

	public static void mNotifyAll()
	{
		CRes.outz("notify all");
		MessageHandler.isStopReadMessage = false;
	}

	public static void mWait()
	{
		CRes.outz("lock");
		MessageHandler.isStopReadMessage = true;
	}

	public static void loadImage()
	{
		imgCircle_30 = CCanvas.loadImage("/circle_60.png");
		imgCircle_20 = CCanvas.loadImage("/circle_70.png");
		imgCircle_0 = CCanvas.loadImage("/circle_90.png");
		imgCircle_45 = CCanvas.loadImage("/circle_135.png");
	}

	public static void onConnectFail()
	{
		if (CCanvas.curScr == CCanvas.serverScreen)
		{
			ServerListScreen.testConnect = 0;
		}
		else
		{
			CCanvas.startOKDlg(L.connectFail(), new Command(string.Empty, GameLogicHandler.gI(), 2000, null));
		}
	}

	public static void onConnectOK()
	{
		CCanvas.serverScreen.connectOk();
	}

	public static void onDisconnect()
	{
		if (CCanvas.curScr != CCanvas.serverScreen)
		{
			CCanvas.startOKDlg(L.serverDis(), new Command(string.Empty, GameLogicHandler.gI(), 2001, null));
		}
		if (InfoDlg.isShow)
		{
			InfoDlg.hide();
		}
		if (CCanvas.panel.isShow)
		{
			CCanvas.panel.hide();
		}
	}

	public static void onLoginFail(string reason)
	{
		CCanvas.startOKDlg(reason, new Command(L.ok(), GameLogicHandler.gI(), 5000, null));
	}

	public static string getIMEI()
	{
		string text;
		try
		{
			text = Main.IMEI;
		}
		catch (Exception)
		{
			text = string.Empty;
		}
		return (text != null) ? text : string.Empty;
	}

	public static void gc()
	{
	}
}
