// Token: 0x06000601 RID: 1537 RVA: 0x0004A540 File Offset: 0x00048740
    public void perform(int idAction, object p)
    {
        switch (idAction)
        {
        case 8000:
            Cout.LogError("perform chat 8000");
            if (this.parentScreen != null)
            {
                long num = mSystem.currentTimeMillis();
                if (num - this.lastChatTime < 1000L)
                {
                    return;
                }
                this.lastChatTime = num;
                this.parentScreen.onChatFromMe(this.tfChat.getText(), this.to);
                this.tfChat.setText(string.Empty);
                this.right.caption = mResources.CLOSE;
                this.tfChat.clearKb();
            }
            break;

        case 8001:
            Cout.LogError("perform chat 8001");
            if (this.tfChat.getText().Equals(string.Empty))
            {
                this.isShow = false;
                this.parentScreen.onCancelChat();
            }
            this.tfChat.clear();
            break;
        }
    }
Exemplo n.º 2
0
    // Token: 0x0600018A RID: 394 RVA: 0x0000EB60 File Offset: 0x0000CD60
    public int getWidthExactOf(string s)
    {
        int result;

        try
        {
            result = (int)new GUIStyle
            {
                font = this.myFont
            }.CalcSize(new GUIContent(s)).x / mGraphics.zoomLevel;
        }
        catch (Exception ex)
        {
            Cout.LogError(string.Concat(new string[]
            {
                "GET WIDTH OF ",
                s,
                " FAIL.\n",
                ex.Message,
                "\n",
                ex.StackTrace
            }));
            result = this.getWidthNotExactOf(s);
        }
        return(result);
    }
Exemplo n.º 3
0
    // Token: 0x060003DE RID: 990 RVA: 0x0001E0A0 File Offset: 0x0001C2A0
    public void readImage()
    {
        int num = 0;

        try
        {
            DataInputStream dataInputStream = new DataInputStream(Rms.loadRMS("NR_image"));
            short           num2            = dataInputStream.readShort();
            SmallImage.smallImg = new int[(int)num2][];
            for (int i = 0; i < SmallImage.smallImg.Length; i++)
            {
                SmallImage.smallImg[i] = new int[5];
            }
            for (int j = 0; j < (int)num2; j++)
            {
                num++;
                SmallImage.smallImg[j][0] = dataInputStream.readUnsignedByte();
                SmallImage.smallImg[j][1] = (int)dataInputStream.readShort();
                SmallImage.smallImg[j][2] = (int)dataInputStream.readShort();
                SmallImage.smallImg[j][3] = (int)dataInputStream.readShort();
                SmallImage.smallImg[j][4] = (int)dataInputStream.readShort();
            }
        }
        catch (Exception ex)
        {
            Cout.LogError3(string.Concat(new object[]
            {
                "Loi readImage: ",
                ex.ToString(),
                "i= ",
                num
            }));
        }
    }
Exemplo n.º 4
0
    // Token: 0x0600003D RID: 61 RVA: 0x00007EF0 File Offset: 0x000060F0
    private static Image _createImage(int w, int h)
    {
        if (Image.status != 0)
        {
            Cout.LogError("CANNOT CREATE IMAGE(w,h) WHEN CREATING OTHER IMAGE");
            return(null);
        }
        Image.imgTemp = null;
        Image.wtemp   = w;
        Image.htemp   = h;
        Image.status  = 6;
        int i;

        for (i = 0; i < 500; i++)
        {
            Thread.Sleep(5);
            if (Image.status == 0)
            {
                break;
            }
        }
        if (i == 500)
        {
            Cout.LogError("TOO LONG FOR CREATE IMAGE(w,h)");
            Image.status = 0;
        }
        return(Image.imgTemp);
    }
Exemplo n.º 5
0
    // Token: 0x060001BF RID: 447 RVA: 0x00010918 File Offset: 0x0000EB18
    public static Image blend(Image img0, float level, int rgb)
    {
        int   num   = rgb & 255;
        int   num2  = rgb >> 8 & 255;
        int   num3  = rgb >> 16 & 255;
        float num4  = (float)num / 256f;
        float num5  = (float)num2 / 256f;
        float num6  = (float)num3 / 256f;
        Color color = new Color(num6, num5, num4);

        Color[] pixels = img0.texture.GetPixels();
        float   num7   = color.r;
        float   num8   = color.g;
        float   num9   = color.b;

        for (int i = 0; i < pixels.Length; i++)
        {
            Color color2 = pixels[i];
            if (mGraphics.isNotTranColor(color2))
            {
                float num10 = (num7 - color2.r) * level + color2.r;
                float num11 = (num8 - color2.g) * level + color2.g;
                float num12 = (num9 - color2.b) * level + color2.b;
                if (num10 > 255f)
                {
                    num10 = 255f;
                }
                if (num10 < 0f)
                {
                    num10 = 0f;
                }
                if (num11 > 255f)
                {
                    num11 = 255f;
                }
                if (num11 < 0f)
                {
                    num11 = 0f;
                }
                if (num12 < 0f)
                {
                    num12 = 0f;
                }
                if (num12 > 255f)
                {
                    num12 = 255f;
                }
                pixels[i].r = num10;
                pixels[i].g = num11;
                pixels[i].b = num12;
            }
        }
        Image image = Image.createImage(img0.getRealImageWidth(), img0.getRealImageHeight());

        image.texture.SetPixels(pixels);
        Image.setTextureQuality(image.texture);
        image.texture.Apply();
        Cout.LogError2("BLEND ----------------------------------------------------");
        return(image);
    }
Exemplo n.º 6
0
    // Token: 0x0600003B RID: 59 RVA: 0x00007DD0 File Offset: 0x00005FD0
    private static Image _createImage(byte[] imageData)
    {
        if (Image.status != 0)
        {
            Cout.LogError("CANNOT CREATE IMAGE(FromArray) WHEN CREATING OTHER IMAGE");
            return(null);
        }
        Image.imgTemp  = null;
        Image.datatemp = imageData;
        Image.status   = 4;
        int i;

        for (i = 0; i < 500; i++)
        {
            Thread.Sleep(5);
            if (Image.status == 0)
            {
                break;
            }
        }
        if (i == 500)
        {
            Cout.LogError("TOO LONG FOR CREATE IMAGE(FromArray)");
            Image.status = 0;
        }
        return(Image.imgTemp);
    }
Exemplo n.º 7
0
    // Token: 0x0600003C RID: 60 RVA: 0x00007E50 File Offset: 0x00006050
    private static Image _createImage(Image src, int x, int y, int w, int h, int transform)
    {
        if (Image.status != 0)
        {
            Cout.LogError("CANNOT CREATE IMAGE(FromSrcPart) WHEN CREATING OTHER IMAGE");
            return(null);
        }
        Image.imgTemp       = null;
        Image.imgSrcTemp    = src;
        Image.xtemp         = x;
        Image.ytemp         = y;
        Image.wtemp         = w;
        Image.htemp         = h;
        Image.transformtemp = transform;
        Image.status        = 5;
        int i;

        for (i = 0; i < 500; i++)
        {
            Thread.Sleep(5);
            if (Image.status == 0)
            {
                break;
            }
        }
        if (i == 500)
        {
            Cout.LogError("TOO LONG FOR CREATE IMAGE(FromSrcPart)");
            Image.status = 0;
        }
        return(Image.imgTemp);
    }
Exemplo n.º 8
0
    // Token: 0x06000039 RID: 57 RVA: 0x00007CC0 File Offset: 0x00005EC0
    private static Image _createEmptyImage()
    {
        if (Image.status != 0)
        {
            Cout.LogError("CANNOT CREATE EMPTY IMAGE WHEN CREATING OTHER IMAGE");
            return(null);
        }
        Image.imgTemp = null;
        Image.status  = 2;
        int i;

        for (i = 0; i < 500; i++)
        {
            Thread.Sleep(5);
            if (Image.status == 0)
            {
                break;
            }
        }
        if (i == 500)
        {
            Cout.LogError("TOO LONG FOR CREATE EMPTY IMAGE");
            Image.status = 0;
        }
        return(Image.imgTemp);
    }
Exemplo n.º 9
0
    // Token: 0x0600003A RID: 58 RVA: 0x00007D3C File Offset: 0x00005F3C
    private static Image _createImage(string filename)
    {
        if (Image.status != 0)
        {
            Cout.LogError("CANNOT CREATE IMAGE " + filename + " WHEN CREATING OTHER IMAGE");
            return(null);
        }
        Image.imgTemp      = null;
        Image.filenametemp = filename;
        Image.status       = 3;
        int i;

        for (i = 0; i < 500; i++)
        {
            Thread.Sleep(5);
            if (Image.status == 0)
            {
                break;
            }
        }
        if (i == 500)
        {
            Cout.LogError("TOO LONG FOR CREATE IMAGE " + filename);
            Image.status = 0;
        }
        return(Image.imgTemp);
    }
Exemplo n.º 10
0
        // Token: 0x06000172 RID: 370 RVA: 0x0000D4A8 File Offset: 0x0000B6A8
        private Message readMessage2(sbyte cmd)
        {
            int num  = (int)Session_ME2.readKey(Session_ME2.dis.ReadSByte()) + 128;
            int num2 = (int)Session_ME2.readKey(Session_ME2.dis.ReadSByte()) + 128;
            int num3 = (int)Session_ME2.readKey(Session_ME2.dis.ReadSByte()) + 128;
            int num4 = (num3 * 256 + num2) * 256 + num;

            Cout.LogError("SIZE = " + num4);
            sbyte[] array = new sbyte[num4];
            byte[]  src   = Session_ME2.dis.ReadBytes(num4);
            Buffer.BlockCopy(src, 0, array, 0, num4);
            Session_ME2.recvByteCount += 5 + num4;
            int num5 = Session_ME2.recvByteCount + Session_ME2.sendByteCount;

            Session_ME2.strRecvByteCount = string.Concat(new object[]
            {
                num5 / 1024,
                ".",
                num5 % 1024 / 102,
                "Kb"
            });
            if (Session_ME2.getKeyComplete)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    array[i] = Session_ME2.readKey(array[i]);
                }
            }
            return(new Message(cmd, array));
        }
Exemplo n.º 11
0
    static void Main(String[] args)
    {
        var s = new SortedSet <int>();
        int n = Cin.NextInt();

        for (int i = 0; i < n; i++)
        {
            int c = Cin.NextInt();
            if (c == 3)
            {
                Cout.Print(s.Min);
            }
            else
            {
                int oph = Cin.NextInt();
                if (c == 1)
                {
                    s.Add(oph);
                }
                else
                {
                    s.Remove(oph);
                }
            }
        }
    }
Exemplo n.º 12
0
    // Token: 0x060000F7 RID: 247 RVA: 0x0000B530 File Offset: 0x00009730
    public static int Check()
    {
        if (Application.platform == RuntimePlatform.IPhonePlayer)
        {
            return(iOSPlugins.checkCanSendSMS());
        }
        iOSPlugins.devide = iPhoneSettings.generation.ToString();
        string a = string.Empty + iOSPlugins.devide[2];

        if (a == "h" && iOSPlugins.devide.Length > 6)
        {
            iOSPlugins.Myname = SystemInfo.operatingSystem.ToString();
            string a2 = string.Empty + iOSPlugins.Myname[10];
            if (a2 != "2" && a2 != "3")
            {
                return(0);
            }
            return(1);
        }
        else
        {
            Cout.println(iOSPlugins.devide + "  loai");
            if (iOSPlugins.devide == "Unknown" && ScaleGUI.WIDTH * ScaleGUI.HEIGHT < 786432f)
            {
                return(0);
            }
            return(-1);
        }
    }
Exemplo n.º 13
0
        protected virtual int CreateDefectNow(Dictionary <string, string> defectInfos)
        {
            string newDefectId = Integrator.CreateDefect(defectInfos);

            Cout.Write(newDefectId);
            return(0);
        }
Exemplo n.º 14
0
 // Token: 0x06000170 RID: 368 RVA: 0x0000D284 File Offset: 0x0000B484
 public void run()
 {
     try
     {
         while (Session_ME2.connected)
         {
             Message message = this.readMessage();
             if (message == null)
             {
                 break;
             }
             try
             {
                 if ((int)message.command == -27)
                 {
                     this.getKey(message);
                 }
                 else
                 {
                     Session_ME2.onRecieveMsg(message);
                 }
             }
             catch (Exception)
             {
                 Cout.println("LOI NHAN  MESS THU 1");
             }
             try
             {
                 Thread.Sleep(5);
             }
             catch (Exception)
             {
                 Cout.println("LOI NHAN  MESS THU 2");
             }
         }
     }
     catch (Exception ex)
     {
         Debug.Log("error read message!");
         Debug.Log(ex.Message.ToString());
     }
     if (Session_ME2.connected)
     {
         if (Session_ME2.messageHandler != null)
         {
             if (Session_ME2.currentTimeMillis() - Session_ME2.timeConnected > 500)
             {
                 Session_ME2.messageHandler.onDisconnected(Session_ME2.isMainSession);
             }
             else
             {
                 Session_ME2.messageHandler.onConnectionFail(Session_ME2.isMainSession);
             }
         }
         if (Session_ME2.sc != null)
         {
             Session_ME2.cleanNetwork();
         }
     }
 }
Exemplo n.º 15
0
 // Token: 0x0600016E RID: 366 RVA: 0x0000D1DC File Offset: 0x0000B3DC
 public void run()
 {
     while (Session_ME2.connected)
     {
         try
         {
             if (Session_ME2.getKeyComplete)
             {
                 while (this.sendingMessage.Count > 0)
                 {
                     Message m = this.sendingMessage[0];
                     Session_ME2.doSendMessage(m);
                     this.sendingMessage.RemoveAt(0);
                 }
             }
             try
             {
                 Thread.Sleep(5);
             }
             catch (Exception ex)
             {
                 Cout.LogError(ex.ToString());
             }
         }
         catch (Exception)
         {
             Res.outz("error send message! ");
         }
     }
 }
Exemplo n.º 16
0
 // Token: 0x06000091 RID: 145 RVA: 0x00008BBC File Offset: 0x00006DBC
 public static void clearAll()
 {
     Cout.LogError3("clean rms");
     foreach (FileInfo fileInfo in new DirectoryInfo(Rms.GetiPhoneDocumentsPath() + "/").GetFiles())
     {
         fileInfo.Delete();
     }
 }
Exemplo n.º 17
0
 // Token: 0x0600007D RID: 125 RVA: 0x00003A95 File Offset: 0x00001C95
 public static void connectHTTP(string link, Command h)
 {
     if (Net.www != null)
     {
         Cout.LogError("GET HTTP BUSY");
     }
     Net.www = new WWW(link);
     Net.h   = h;
 }
Exemplo n.º 18
0
 // Token: 0x06000095 RID: 149 RVA: 0x00008CB4 File Offset: 0x00006EB4
 public static void deleteRecord(string name)
 {
     try
     {
         PlayerPrefs.DeleteKey(name);
     }
     catch (Exception ex)
     {
         Cout.println("loi xoa RMS --------------------------" + ex.ToString());
     }
 }
Exemplo n.º 19
0
 // Token: 0x0600087C RID: 2172 RVA: 0x00007033 File Offset: 0x00005233
 public virtual void switchToMe()
 {
     GameCanvas.clearKeyPressed();
     GameCanvas.clearKeyHold();
     if (GameCanvas.currentScreen != null)
     {
         GameCanvas.currentScreen.unLoad();
     }
     GameCanvas.currentScreen = this;
     Cout.LogError3("cur Screen: " + GameCanvas.currentScreen);
 }
Exemplo n.º 20
0
        protected virtual int GetInfosForDefectsNow(List <string> crqIds)
        {
            Dictionary <string, string> defectStates = Integrator.GetInfosForDefects(crqIds);

            foreach (KeyValuePair <string, string> kvPair in defectStates)
            {
                string crqId   = kvPair.Key;
                string crqInfo = kvPair.Value;
                Cout.WriteLine(Encode(crqId) + ":" + Encode(crqInfo));
            }
            return(0);
        }
Exemplo n.º 21
0
    // Token: 0x0600009D RID: 157 RVA: 0x00008E8C File Offset: 0x0000708C
    private static int __send(string content, string to)
    {
        int num = iOSPlugins.Check();

        Cout.println("vao sms ko " + num);
        if (num >= 0)
        {
            SMS.f          = true;
            SMS.sendEnable = true;
            iOSPlugins.SMSsend(to, content, num);
            Screen.orientation = ScreenOrientation.AutoRotation;
        }
        return(num);
    }
Exemplo n.º 22
0
    // Token: 0x0600009C RID: 156 RVA: 0x00008D7C File Offset: 0x00006F7C
    private static int _send(string content, string to)
    {
        if (SMS.status != 0)
        {
            for (int i = 0; i < 500; i++)
            {
                Thread.Sleep(5);
                if (SMS.status == 0)
                {
                    break;
                }
            }
            if (SMS.status != 0)
            {
                Cout.LogError("CANNOT SEND SMS " + content + " WHEN SENDING " + SMS._content);
                return(-1);
            }
        }
        SMS._content = content;
        SMS._to      = to;
        SMS._result  = -1;
        SMS.status   = 2;
        int j;

        for (j = 0; j < 500; j++)
        {
            Thread.Sleep(5);
            if (SMS.status == 0)
            {
                break;
            }
        }
        if (j == 500)
        {
            Debug.LogError("TOO LONG FOR SEND SMS " + content);
            SMS.status = 0;
        }
        else
        {
            Debug.Log(string.Concat(new object[]
            {
                "Send SMS ",
                content,
                " done in ",
                j * 5,
                "ms"
            }));
        }
        return(SMS._result);
    }
Exemplo n.º 23
0
 // Token: 0x06000453 RID: 1107 RVA: 0x00035CE4 File Offset: 0x00033EE4
 public static sbyte[] readByteArray(myReader dos)
 {
     try
     {
         int     num    = dos.readInt();
         sbyte[] result = new sbyte[num];
         dos.read(ref result);
         return(result);
     }
     catch (Exception ex)
     {
         Cout.LogError("LOI DOC readByteArray dos  NINJAUTIL");
     }
     return(null);
 }
Exemplo n.º 24
0
 // Token: 0x06000452 RID: 1106 RVA: 0x00035C84 File Offset: 0x00033E84
 public static sbyte[] readByteArray(Message msg)
 {
     try
     {
         int     num    = msg.reader().readInt();
         sbyte[] result = new sbyte[num];
         msg.reader().read(ref result);
         return(result);
     }
     catch (Exception ex)
     {
         Cout.LogError("LOI DOC readByteArray NINJAUTIL");
     }
     return(null);
 }
Exemplo n.º 25
0
    // Token: 0x06000088 RID: 136 RVA: 0x000088C8 File Offset: 0x00006AC8
    public static void saveRMSString(string filename, string data)
    {
        DataOutputStream dataOutputStream = new DataOutputStream();

        try
        {
            dataOutputStream.writeUTF(data);
            Rms.saveRMS(filename, dataOutputStream.toByteArray());
            dataOutputStream.close();
        }
        catch (Exception ex)
        {
            Cout.println(ex.StackTrace);
        }
    }
Exemplo n.º 26
0
 // Token: 0x060000A2 RID: 162 RVA: 0x00009054 File Offset: 0x00007254
 public static void initScaleGUI()
 {
     Cout.println(string.Concat(new object[]
     {
         "Init Scale GUI: Screen.w=",
         Screen.width,
         " Screen.h=",
         Screen.height
     }));
     ScaleGUI.WIDTH       = (float)Screen.width;
     ScaleGUI.HEIGHT      = (float)Screen.height;
     ScaleGUI.scaleScreen = false;
     if (Screen.width > 1200)
     {
     }
 }
Exemplo n.º 27
0
 // Token: 0x06000160 RID: 352 RVA: 0x0000CDA8 File Offset: 0x0000AFA8
 public void doConnect(string host, int port)
 {
     Session_ME2.sc = new TcpClient();
     Session_ME2.sc.Connect(host, port);
     Session_ME2.dataStream = Session_ME2.sc.GetStream();
     Session_ME2.dis        = new BinaryReader(Session_ME2.dataStream, new UTF8Encoding());
     Session_ME2.dos        = new BinaryWriter(Session_ME2.dataStream, new UTF8Encoding());
     new Thread(new ThreadStart(Session_ME2.sender.run)).Start();
     Session_ME2.MessageCollector @object = new Session_ME2.MessageCollector();
     Cout.LogError("new -----");
     Session_ME2.collectorThread = new Thread(new ThreadStart(@object.run));
     Session_ME2.collectorThread.Start();
     Session_ME2.timeConnected = Session_ME2.currentTimeMillis();
     Session_ME2.connecting    = false;
     Session_ME2.doSendMessage(new Message(-27));
 }
Exemplo n.º 28
0
        protected virtual int GetStatesForDefectsNow(List <string> crqIds)
        {
            string xmlString = Integrator.GetDefectDetails(crqIds);

            Cout.WriteLine(xmlString);
            return(0);

#if OLD
            Dictionary <string, string> defectStates = Integrator.GetStatesForDefects(crqIds);
            foreach (KeyValuePair <string, string> kvPair in defectStates)
            {
                string crqId    = kvPair.Key;
                string crqState = kvPair.Value;
                Cout.WriteLine(Encode(crqId) + ":" + Encode(crqState));
            }
            return(0);
#endif
        }
Exemplo n.º 29
0
    static void Main(String[] args)
    {
        int n = Cin.NextInt();
        int k = Cin.NextInt();

        int[] ns = new int[n];
        var   d  = new Dictionary <int, int>();

        for (int i = 0; i < n; i++)
        {
            ns[i] = Cin.NextInt();
            int r = ns[i] % k;
            if (!d.ContainsKey(r))
            {
                d[r] = 0;
            }
            d[r]++;
        }

        int ans = 0;

        for (int i = 1; i < (k + 1) / 2; i++)
        {
            int a     = i;
            int b     = k - i;
            int cnt_a = d.ContainsKey(a)? d[a]: 0;
            int cnt_b = d.ContainsKey(b)? d[b]: 0;

            // Cout.Print($"{a} {b} {cnt_a} {cnt_b}");

            ans += Math.Max(cnt_a, cnt_b);
        }

        if (d.ContainsKey(0))
        {
            ans++;
        }

        if (k % 2 == 0 && d.ContainsKey(k / 2))
        {
            ans++;
        }
        Cout.Print(ans);
    }
Exemplo n.º 30
0
        static void Main(string[] args)
        {
            int n = Cin.NextInt();

            string[] maze = new string[n];
            for (int i = 0; i < n; i++)
            {
                maze[i] = Cin.NextToken();
            }

            int y1 = Cin.NextInt();
            int x1 = Cin.NextInt();
            int y2 = Cin.NextInt();
            int x2 = Cin.NextInt();

            var p1 = new Point(x1, y1);
            var p2 = new Point(x2, y2);

            Cout.Print(Bfs(maze, n, p1, p2));
        }