Exemple #1
0
        // Token: 0x06000156 RID: 342 RVA: 0x0000C974 File Offset: 0x0000AB74
        private Message readMessage2(sbyte cmd)
        {
            int num  = (int)Session_ME.readKey(Session_ME.dis.ReadSByte()) + 128;
            int num2 = (int)Session_ME.readKey(Session_ME.dis.ReadSByte()) + 128;
            int num3 = (int)Session_ME.readKey(Session_ME.dis.ReadSByte()) + 128;
            int num4 = (num3 * 256 + num2) * 256 + num;

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

            Session_ME.strRecvByteCount = string.Concat(new object[]
            {
                num5 / 1024,
                ".",
                num5 % 1024 / 102,
                "Kb"
            });
            if (Session_ME.getKeyComplete)
            {
                for (int i = 0; i < array.Length; i++)
                {
                    array[i] = Session_ME.readKey(array[i]);
                }
            }
            return(new Message(cmd, array));
        }
 // Token: 0x06000416 RID: 1046 RVA: 0x00005949 File Offset: 0x00003B49
 public void backToRegister()
 {
     Session_ME.gI().close();
     GameCanvas.panel.hide();
     GameCanvas.loginScr.actRegister();
     GameCanvas.loginScr.switchToMe();
 }
Exemple #3
0
 // Token: 0x06000152 RID: 338 RVA: 0x0000C6A8 File Offset: 0x0000A8A8
 public void run()
 {
     while (Session_ME.connected)
     {
         try
         {
             if (Session_ME.getKeyComplete)
             {
                 while (this.sendingMessage.Count > 0)
                 {
                     Message m = this.sendingMessage[0];
                     Session_ME.doSendMessage(m);
                     this.sendingMessage.RemoveAt(0);
                 }
             }
             try
             {
                 Thread.Sleep(5);
             }
             catch (Exception ex)
             {
                 Cout.LogError(ex.ToString());
             }
         }
         catch (Exception)
         {
             Res.outz("error send message! ");
         }
     }
 }
Exemple #4
0
 // Token: 0x06000154 RID: 340 RVA: 0x0000C750 File Offset: 0x0000A950
 public void run()
 {
     try
     {
         while (Session_ME.connected)
         {
             Message message = this.readMessage();
             if (message == null)
             {
                 break;
             }
             try
             {
                 if ((int)message.command == -27)
                 {
                     this.getKey(message);
                 }
                 else
                 {
                     Session_ME.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_ME.connected)
     {
         if (Session_ME.messageHandler != null)
         {
             if (Session_ME.currentTimeMillis() - Session_ME.timeConnected > 500)
             {
                 Session_ME.messageHandler.onDisconnected(Session_ME.isMainSession);
             }
             else
             {
                 Session_ME.messageHandler.onConnectionFail(Session_ME.isMainSession);
             }
         }
         if (Session_ME.sc != null)
         {
             Session_ME.cleanNetwork();
         }
     }
 }
 // Token: 0x0600061B RID: 1563 RVA: 0x0004C340 File Offset: 0x0004A540
 public void perform(int idAction, object p)
 {
     if (idAction != 8000)
     {
         if (idAction != 8001)
         {
             if (idAction != 10019)
             {
                 if (idAction == 10020)
                 {
                     GameCanvas.endDlg();
                 }
             }
             else
             {
                 Session_ME.gI().close();
                 GameCanvas.endDlg();
                 GameCanvas.serverScreen.switchToMe();
             }
         }
         else
         {
             if (GameCanvas.loginScr.isLogin2)
             {
                 GameCanvas.startYesNoDlg(mResources.note, new Command(mResources.YES, this, 10019, null), new Command(mResources.NO, this, 10020, null));
                 return;
             }
             if (Main.isWindowsPhone)
             {
                 GameMidlet.isBackWindowsPhone = true;
             }
             Session_ME.gI().close();
             GameCanvas.serverScreen.switchToMe();
         }
     }
     else
     {
         if (CreateCharScr.tAddName.getText().Equals(string.Empty))
         {
             GameCanvas.startOKDlg(mResources.char_name_blank);
             return;
         }
         if (CreateCharScr.tAddName.getText().Length < 5)
         {
             GameCanvas.startOKDlg(mResources.char_name_short);
             return;
         }
         if (CreateCharScr.tAddName.getText().Length > 15)
         {
             GameCanvas.startOKDlg(mResources.char_name_long);
             return;
         }
         InfoDlg.showWait();
         Service.gI().createChar(CreateCharScr.tAddName.getText(), CreateCharScr.indexGender, CreateCharScr.hairID[CreateCharScr.indexGender][CreateCharScr.indexHair]);
     }
 }
Exemple #6
0
 // Token: 0x0600085D RID: 2141 RVA: 0x0007B9A8 File Offset: 0x00079BA8
 public void backToRegister()
 {
     if (GameCanvas.loginScr.isLogin2)
     {
         GameCanvas.startYesNoDlg(mResources.note, new Command(mResources.YES, GameCanvas.panel, 10019, null), new Command(mResources.NO, GameCanvas.panel, 10020, null));
         return;
     }
     GameCanvas.instance.doResetToLoginScr(GameCanvas.loginScr);
     Session_ME.gI().close();
 }
 // Token: 0x0600012E RID: 302 RVA: 0x000040CD File Offset: 0x000022CD
 private void OnApplicationQuit()
 {
     Debug.LogWarning("APP QUIT");
     GameCanvas.bRun = false;
     Session_ME.gI().close();
     Session_ME2.gI().close();
     if (Main.isPC)
     {
         Application.Quit();
     }
 }
Exemple #8
0
 // Token: 0x06000157 RID: 343 RVA: 0x0000CAB0 File Offset: 0x0000ACB0
 private Message readMessage()
 {
     try
     {
         sbyte b = Session_ME.dis.ReadSByte();
         if (Session_ME.getKeyComplete)
         {
             b = Session_ME.readKey(b);
         }
         if ((int)b == -32 || (int)b == -66 || (int)b == 11 || (int)b == -67 || (int)b == -74 || (int)b == -87)
         {
             return(this.readMessage2(b));
         }
         int num;
         if (Session_ME.getKeyComplete)
         {
             sbyte b2 = Session_ME.dis.ReadSByte();
             sbyte b3 = Session_ME.dis.ReadSByte();
             num = (((int)Session_ME.readKey(b2) & 255) << 8 | ((int)Session_ME.readKey(b3) & 255));
         }
         else
         {
             sbyte b4 = Session_ME.dis.ReadSByte();
             sbyte b5 = Session_ME.dis.ReadSByte();
             num = (((int)b4 & 65280) | ((int)b5 & 255));
         }
         sbyte[] array = new sbyte[num];
         byte[]  src   = Session_ME.dis.ReadBytes(num);
         Buffer.BlockCopy(src, 0, array, 0, num);
         Session_ME.recvByteCount += 5 + num;
         int num2 = Session_ME.recvByteCount + Session_ME.sendByteCount;
         Session_ME.strRecvByteCount = string.Concat(new object[]
         {
             num2 / 1024,
             ".",
             num2 % 1024 / 102,
             "Kb"
         });
         if (Session_ME.getKeyComplete)
         {
             for (int i = 0; i < array.Length; i++)
             {
                 array[i] = Session_ME.readKey(array[i]);
             }
         }
         return(new Message(b, array));
     }
     catch (Exception ex)
     {
         Debug.Log(ex.StackTrace.ToString());
     }
     return(null);
 }
 // Token: 0x06000934 RID: 2356 RVA: 0x000838EC File Offset: 0x00081AEC
 public void initGame()
 {
     GameMidlet.instance   = this;
     MotherCanvas.instance = new MotherCanvas();
     Session_ME.gI().setHandler(Controller.gI());
     Session_ME2.gI().setHandler(Controller.gI());
     Session_ME2.isMainSession = false;
     GameMidlet.instance       = this;
     GameMidlet.gameCanvas     = new GameCanvas();
     GameMidlet.gameCanvas.start();
     SplashScr.loadImg();
     SplashScr.loadSplashScr();
     GameCanvas.currentScreen = new SplashScr();
 }
 // Token: 0x0600071E RID: 1822 RVA: 0x0005ED64 File Offset: 0x0005CF64
 public void backToRegister()
 {
     if (GameCanvas.loginScr.isLogin2)
     {
         GameCanvas.startYesNoDlg(mResources.note, new Command(mResources.YES, GameCanvas.panel, 10019, null), new Command(mResources.NO, GameCanvas.panel, 10020, null));
         return;
     }
     if (Main.isWindowsPhone)
     {
         GameMidlet.isBackWindowsPhone = true;
     }
     GameCanvas.instance.resetToLoginScr = false;
     GameCanvas.instance.doResetToLoginScr(GameCanvas.loginScr);
     Session_ME.gI().close();
 }
 // Token: 0x06000125 RID: 293 RVA: 0x0000BBF8 File Offset: 0x00009DF8
 private void OnGUI()
 {
     if (this.count < 10)
     {
         return;
     }
     this.checkInput();
     Session_ME.update();
     Session_ME2.update();
     if (Event.current.type.Equals(EventType.Repaint) && this.paintCount <= this.updateCount)
     {
         GameMidlet.gameCanvas.paint(Main.g);
         this.paintCount++;
         Main.g.reset();
     }
 }
Exemple #12
0
 // Token: 0x06000144 RID: 324 RVA: 0x0000C264 File Offset: 0x0000A464
 public void doConnect(string host, int port)
 {
     Session_ME.sc = new TcpClient();
     Session_ME.sc.Connect(host, port);
     Session_ME.dataStream = Session_ME.sc.GetStream();
     Session_ME.dis        = new BinaryReader(Session_ME.dataStream, new UTF8Encoding());
     Session_ME.dos        = new BinaryWriter(Session_ME.dataStream, new UTF8Encoding());
     new Thread(new ThreadStart(Session_ME.sender.run)).Start();
     Session_ME.MessageCollector @object = new Session_ME.MessageCollector();
     Cout.LogError("new -----");
     Session_ME.collectorThread = new Thread(new ThreadStart(@object.run));
     Session_ME.collectorThread.Start();
     Session_ME.timeConnected = Session_ME.currentTimeMillis();
     Session_ME.connecting    = false;
     Session_ME.doSendMessage(new Message(-27));
 }
Exemple #13
0
 // Token: 0x0600088B RID: 2187 RVA: 0x0007CE5C File Offset: 0x0007B05C
 public void selectServer()
 {
     ServerListScreen.flagServer = 30;
     GameCanvas.startWaitDlg(mResources.PLEASEWAIT);
     if (Session_ME.gI().isConnected())
     {
         Session_ME.gI().close();
     }
     GameMidlet.IP   = ServerListScreen.address[ServerListScreen.ipSelect];
     GameMidlet.PORT = (int)ServerListScreen.port[ServerListScreen.ipSelect];
     if (ServerListScreen.language[ServerListScreen.ipSelect] != mResources.language)
     {
         mResources.loadLanguague(ServerListScreen.language[ServerListScreen.ipSelect]);
     }
     LoginScr.serverName = ServerListScreen.nameServer[ServerListScreen.ipSelect];
     this.initCommand();
     GameCanvas.connect();
 }
 // Token: 0x06000706 RID: 1798 RVA: 0x0005D570 File Offset: 0x0005B770
 public static void getServerLink()
 {
     try
     {
         if (!LoginScr.isTryGetIPFromWap)
         {
             Command    command    = new Command();
             ActionChat actionChat = delegate(string str)
             {
                 try
                 {
                     if (str == null)
                     {
                         return;
                     }
                     if (str == string.Empty)
                     {
                         return;
                     }
                     Rms.saveIP(str);
                     if (!str.Contains(":"))
                     {
                         return;
                     }
                     int    num  = str.IndexOf(":");
                     string text = str.Substring(0, num);
                     string s    = str.Substring(num + 1);
                     GameMidlet.IP   = text;
                     GameMidlet.PORT = int.Parse(s);
                     Session_ME.gI().connect(text, int.Parse(s));
                     LoginScr.isTryGetIPFromWap = true;
                 }
                 catch (Exception ex)
                 {
                 }
             };
             command.actionChat = actionChat;
             Net.connectHTTP("http://27.0.14.75/game/ngocrong031_t.php", command);
         }
     }
     catch (Exception ex)
     {
     }
 }
Exemple #15
0
 // Token: 0x06000146 RID: 326 RVA: 0x0000C324 File Offset: 0x0000A524
 private static void doSendMessage(Message m)
 {
     sbyte[] data = m.getData();
     try
     {
         if (Session_ME.getKeyComplete)
         {
             sbyte value = Session_ME.writeKey(m.command);
             Session_ME.dos.Write(value);
         }
         else
         {
             Session_ME.dos.Write(m.command);
         }
         if (data != null)
         {
             int num = data.Length;
             if (Session_ME.getKeyComplete)
             {
                 int num2 = (int)Session_ME.writeKey((sbyte)(num >> 8));
                 Session_ME.dos.Write((sbyte)num2);
                 int num3 = (int)Session_ME.writeKey((sbyte)(num & 255));
                 Session_ME.dos.Write((sbyte)num3);
             }
             else
             {
                 Session_ME.dos.Write((ushort)num);
             }
             if (Session_ME.getKeyComplete)
             {
                 for (int i = 0; i < data.Length; i++)
                 {
                     sbyte value2 = Session_ME.writeKey(data[i]);
                     Session_ME.dos.Write(value2);
                 }
             }
             Session_ME.sendByteCount += 5 + data.Length;
         }
         else
         {
             if (Session_ME.getKeyComplete)
             {
                 int num4 = 0;
                 int num5 = (int)Session_ME.writeKey((sbyte)(num4 >> 8));
                 Session_ME.dos.Write((sbyte)num5);
                 int num6 = (int)Session_ME.writeKey((sbyte)(num4 & 255));
                 Session_ME.dos.Write((sbyte)num6);
             }
             else
             {
                 Session_ME.dos.Write(0);
             }
             Session_ME.sendByteCount += 5;
         }
         Session_ME.dos.Flush();
     }
     catch (Exception ex)
     {
         Debug.Log(ex.StackTrace);
     }
 }
Exemple #16
0
 // Token: 0x0600014B RID: 331 RVA: 0x000042D6 File Offset: 0x000024D6
 public void close()
 {
     Session_ME.cleanNetwork();
 }
Exemple #17
0
        // Token: 0x0600085A RID: 2138 RVA: 0x0007B670 File Offset: 0x00079870
        public void perform(int idAction, object p)
        {
            switch (idAction)
            {
            case 2000:
                break;

            case 2001:
                if (this.isCheck)
                {
                    this.isCheck = false;
                }
                else
                {
                    this.isCheck = true;
                }
                break;

            case 2002:
                this.doRegister();
                break;

            case 2003:
                this.doMenu();
                break;

            case 2004:
                this.actRegister();
                break;

            default:
                switch (idAction)
                {
                case 1000:
                    try
                    {
                        GameMidlet.instance.platformRequest((string)p);
                    }
                    catch (Exception ex)
                    {
                        ex.StackTrace.ToString();
                    }
                    GameCanvas.endDlg();
                    break;

                case 1001:
                    GameCanvas.endDlg();
                    this.isRes = false;
                    break;

                case 1002:
                    break;

                case 1003:
                    Session_ME.gI().close();
                    GameCanvas.serverScreen.switchToMe();
                    break;

                case 1004:
                    ServerListScreen.doUpdateServer();
                    GameCanvas.serverScreen.switchToMe();
                    break;

                case 1005:
                    try
                    {
                        GameMidlet.instance.platformRequest("http://ngocrongonline.com");
                    }
                    catch (Exception ex2)
                    {
                        ex2.StackTrace.ToString();
                    }
                    break;

                default:
                    if (idAction != 10041)
                    {
                        if (idAction != 10042)
                        {
                            if (idAction != 4000)
                            {
                                if (idAction == 10021)
                                {
                                    this.actRegisterLeft();
                                }
                            }
                            else
                            {
                                this.doRegister(this.tfUser.getText());
                            }
                        }
                    }
                    break;
                }
                break;

            case 2008:
                if (this.tfNgay.getText().Equals(string.Empty) || this.tfThang.getText().Equals(string.Empty) || this.tfNam.getText().Equals(string.Empty) || this.tfDiachi.getText().Equals(string.Empty) || this.tfCMND.getText().Equals(string.Empty) || this.tfNgayCap.getText().Equals(string.Empty) || this.tfNoiCap.getText().Equals(string.Empty) || this.tfSodt.getText().Equals(string.Empty) || this.tfUser.getText().Equals(string.Empty))
                {
                    GameCanvas.startOKDlg("Vui lòng điền đầy đủ thông tin");
                }
                else
                {
                    GameCanvas.startOKDlg(mResources.PLEASEWAIT);
                    Service.gI().charInfo(this.tfNgay.getText(), this.tfThang.getText(), this.tfNam.getText(), this.tfDiachi.getText(), this.tfCMND.getText(), this.tfNgayCap.getText(), this.tfNoiCap.getText(), this.tfSodt.getText(), this.tfUser.getText());
                }
                break;
            }
        }
 // Token: 0x06000713 RID: 1811 RVA: 0x0005DE14 File Offset: 0x0005C014
 public override void update()
 {
     if (Main.isWindowsPhone && this.isRegistering)
     {
         if (this.t < 0)
         {
             GameCanvas.endDlg();
             Session_ME.gI().close();
             GameCanvas.serverScreen.switchToMe();
             this.isRegistering = false;
         }
         else
         {
             this.t--;
         }
     }
     if (LoginScr.timeLogin > 0)
     {
         GameCanvas.startWaitDlg();
         LoginScr.currTimeLogin = mSystem.currentTimeMillis();
         if (LoginScr.currTimeLogin - LoginScr.lastTimeLogin >= 1000L)
         {
             LoginScr.timeLogin -= 1;
             if (LoginScr.timeLogin == 0)
             {
                 Session_ME.gI().close();
                 GameCanvas.loginScr.doLogin();
             }
             LoginScr.lastTimeLogin = LoginScr.currTimeLogin;
         }
     }
     if (this.isLogin2 && !this.isRes)
     {
         this.tfUser.name          = (((int)mResources.language != 2) ? (mResources.phone + "/") : string.Empty) + mResources.email;
         this.tfPass.name          = mResources.password;
         this.tfUser.isPaintCarret = false;
         this.tfPass.isPaintCarret = false;
         this.tfUser.update();
         this.tfPass.update();
     }
     else
     {
         this.tfUser.name = (((int)mResources.language != 2) ? (mResources.phone + "/") : string.Empty) + mResources.email;
         this.tfPass.name = mResources.password;
         this.tfUser.update();
         this.tfPass.update();
     }
     if (TouchScreenKeyboard.visible)
     {
         mGraphics.addYWhenOpenKeyBoard = 50;
     }
     for (int i = 0; i < Effect2.vEffect2.size(); i++)
     {
         Effect2 effect = (Effect2)Effect2.vEffect2.elementAt(i);
         effect.update();
     }
     if (LoginScr.isUpdateAll && !LoginScr.isUpdateData && !LoginScr.isUpdateItem && !LoginScr.isUpdateMap && !LoginScr.isUpdateSkill)
     {
         LoginScr.isUpdateAll = false;
         mSystem.gcc();
         Service.gI().finishUpdate();
     }
     GameScr.cmx++;
     if (GameScr.cmx > GameCanvas.w * 3 + 100)
     {
         GameScr.cmx = 100;
     }
     if (ChatPopup.currChatPopup != null)
     {
         return;
     }
     GameCanvas.debug("LGU1", 0);
     GameCanvas.debug("LGU2", 0);
     GameCanvas.debug("LGU3", 0);
     this.updateLogo();
     GameCanvas.debug("LGU4", 0);
     GameCanvas.debug("LGU5", 0);
     if (this.g >= 0)
     {
         this.ylogo += this.dir * this.g;
         this.g     += this.dir * this.v;
         if (this.g <= 0)
         {
             this.dir *= -1;
         }
         if (this.ylogo > 0)
         {
             this.dir *= -1;
             this.g   -= 2 * this.v;
         }
     }
     GameCanvas.debug("LGU6", 0);
     if (this.tipid >= 0 && GameCanvas.gameTick % 100 == 0)
     {
         this.doChangeTip();
     }
     if (this.isLogin2 && !this.isRes)
     {
         this.tfUser.isPaintCarret = false;
         this.tfPass.isPaintCarret = false;
         this.tfUser.update();
         this.tfPass.update();
     }
     else
     {
         this.tfUser.name = (((int)mResources.language != 2) ? (mResources.phone + "/") : string.Empty) + mResources.email;
         this.tfPass.name = mResources.password;
         this.tfUser.update();
         this.tfPass.update();
     }
     if (GameCanvas.isTouch)
     {
         if (this.isRes)
         {
             this.center = this.cmdRes;
             this.left   = this.cmdBackFromRegister;
         }
         else
         {
             this.center = this.cmdOK;
             this.left   = this.cmdFogetPass;
         }
     }
     else if (this.isRes)
     {
         this.center = this.cmdRes;
         this.left   = this.cmdBackFromRegister;
     }
     else
     {
         this.center = this.cmdOK;
         this.left   = this.cmdFogetPass;
     }
     if (!Main.isPC && !TouchScreenKeyboard.visible && !Main.isMiniApp && !Main.isWindowsPhone)
     {
         string text  = this.tfUser.getText().ToLower().Trim();
         string text2 = this.tfPass.getText().ToLower().Trim();
         if (!text.Equals(string.Empty) && !text2.Equals(string.Empty))
         {
             this.doLogin();
         }
         Main.isMiniApp = true;
     }
     this.updateTfWhenOpenKb();
 }