// 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); }
// 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); }
// 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); }
// 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); }
// 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); }
// 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! "); } } }
// 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)); }
// 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; } }
// 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); }
// 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; }
// 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); }
// 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); }
// 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); }
// 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)); }
// Token: 0x06000040 RID: 64 RVA: 0x0000806C File Offset: 0x0000626C private static Image __createImage(byte[] imageData) { if (imageData == null || imageData.Length == 0) { Cout.LogError("Create Image from byte array fail"); return(null); } Image image = new Image(); try { image.texture.LoadImage(imageData); image.w = image.texture.width; image.h = image.texture.height; Image.setTextureQuality(image); } catch (Exception ex) { Cout.LogError("CREAT IMAGE FROM ARRAY FAIL \n" + Environment.StackTrace); } return(image); }
// Token: 0x06000613 RID: 1555 RVA: 0x0004AFDC File Offset: 0x000491DC public static void loadMapFromResource(sbyte[] mapID) { Res.outz("newwwwwwwwww ============="); for (int i = 0; i < mapID.Length; i++) { DataInputStream dataInputStream = MyStream.readFile("/mymap/" + mapID[i]); MapTemplate.tmw[i] = (int)((ushort)dataInputStream.read()); MapTemplate.tmh[i] = (int)((ushort)dataInputStream.read()); Cout.LogError(string.Concat(new object[] { "Thong TIn : ", MapTemplate.tmw[i], "::", MapTemplate.tmh[i] })); MapTemplate.maps[i] = new int[dataInputStream.available()]; Cout.LogError("lent= " + MapTemplate.maps[i].Length); for (int j = 0; j < MapTemplate.tmw[i] * MapTemplate.tmh[i]; j++) { MapTemplate.maps[i][j] = dataInputStream.read(); } MapTemplate.types[i] = new int[MapTemplate.maps[i].Length]; } }
// Token: 0x060000C1 RID: 193 RVA: 0x00009788 File Offset: 0x00007988 private static void _load(string filename, int pos) { if (Sound.status != 0) { Cout.LogError("CANNOT LOAD AUDIO " + filename + " WHEN LOADING " + Sound.filenametemp); return; } Sound.filenametemp = filename; Sound.postem = pos; Sound.status = 2; int i; for (i = 0; i < 100; i++) { Thread.Sleep(5); if (Sound.status == 0) { break; } } if (i == 100) { Cout.LogError("TOO LONG FOR LOAD AUDIO " + filename); } else { Cout.Log(string.Concat(new object[] { "Load Audio ", filename, " done in ", i * 5, "ms" })); } }
// Token: 0x0600018C RID: 396 RVA: 0x0000EC08 File Offset: 0x0000CE08 public int getHeight() { if (mGraphics.zoomLevel == 1) { return(this.height); } if (this.height > 0) { return(this.height / mGraphics.zoomLevel); } GUIStyle guistyle = new GUIStyle(); guistyle.font = this.myFont; try { this.height = (int)guistyle.CalcSize(new GUIContent("Adg")).y + 2; } catch (Exception ex) { Cout.LogError("FAIL GET HEIGHT " + ex.StackTrace); this.height = 20; } return(this.height / mGraphics.zoomLevel); }
// Token: 0x0600060F RID: 1551 RVA: 0x0004AC84 File Offset: 0x00048E84 public CreateCharScr() { try { if (!GameCanvas.lowGraphic) { CreateCharScr.loadMapFromResource(new sbyte[] { 39, 40, 41 }); } this.loadMapTableFromResource(new sbyte[] { 39, 40, 41 }); } catch (Exception ex) { Cout.LogError("Tao char loi " + ex.ToString()); } if (GameCanvas.w <= 200) { GameScr.setPopupSize(128, 100); GameScr.popupX = (GameCanvas.w - 128) / 2; GameScr.popupY = 10; this.cy += 15; this.dy -= 15; } CreateCharScr.indexGender = 1; CreateCharScr.tAddName = new TField(); CreateCharScr.tAddName.width = GameCanvas.loginScr.tfUser.width; if (GameCanvas.w < 200) { CreateCharScr.tAddName.width = 60; } CreateCharScr.tAddName.height = mScreen.ITEM_HEIGHT + 2; if (GameCanvas.w < 200) { CreateCharScr.tAddName.x = GameScr.popupX + 45; CreateCharScr.tAddName.y = GameScr.popupY + 12; } else { CreateCharScr.tAddName.x = GameCanvas.w / 2 - CreateCharScr.tAddName.width / 2; CreateCharScr.tAddName.y = 35; } if (!GameCanvas.isTouch) { CreateCharScr.tAddName.isFocus = true; } CreateCharScr.tAddName.setIputType(TField.INPUT_TYPE_ANY); CreateCharScr.tAddName.showSubTextField = false; CreateCharScr.tAddName.strInfo = mResources.char_name; if (CreateCharScr.tAddName.getText().Equals("@")) { CreateCharScr.tAddName.setText(GameCanvas.loginScr.tfUser.getText().Substring(0, GameCanvas.loginScr.tfUser.getText().IndexOf("@"))); } CreateCharScr.tAddName.name = mResources.char_name; CreateCharScr.indexGender = 1; CreateCharScr.indexHair = 0; this.center = new Command(mResources.NEWCHAR, this, 8000, null); this.left = new Command(mResources.BACK, this, 8001, null); if (!GameCanvas.isTouch) { this.right = CreateCharScr.tAddName.cmdClear; } this.yBegin = CreateCharScr.tAddName.y; }
// Token: 0x06000614 RID: 1556 RVA: 0x0004B0F0 File Offset: 0x000492F0 public void loadMapTableFromResource(sbyte[] mapID) { if (GameCanvas.lowGraphic) { return; } DataInputStream dataInputStream = null; try { for (int i = 0; i < mapID.Length; i++) { dataInputStream = MyStream.readFile("/mymap/mapTable" + mapID[i]); Cout.LogError("mapTable : " + mapID[i]); short num = dataInputStream.readShort(); MapTemplate.vCurrItem[i] = new MyVector(); Res.outz("nItem= " + num); for (int j = 0; j < (int)num; j++) { short id = dataInputStream.readShort(); short num2 = dataInputStream.readShort(); short num3 = dataInputStream.readShort(); if (TileMap.getBIById((int)id) != null) { BgItem bibyId = TileMap.getBIById((int)id); BgItem bgItem = new BgItem(); bgItem.id = (int)id; bgItem.idImage = bibyId.idImage; bgItem.dx = bibyId.dx; bgItem.dy = bibyId.dy; bgItem.x = (int)num2 * (int)TileMap.size; bgItem.y = (int)num3 * (int)TileMap.size; bgItem.layer = bibyId.layer; MapTemplate.vCurrItem[i].addElement(bgItem); if (!BgItem.imgNew.containsKey(bgItem.idImage + string.Empty)) { try { Image image = GameCanvas.loadImage("/mapBackGround/" + bgItem.idImage + ".png"); if (image == null) { BgItem.imgNew.put(bgItem.idImage + string.Empty, Image.createRGBImage(new int[1], 1, 1, true)); Service.gI().getBgTemplate(bgItem.idImage); } else { BgItem.imgNew.put(bgItem.idImage + string.Empty, image); } } catch (Exception ex) { Image image2 = GameCanvas.loadImage("/mapBackGround/" + bgItem.idImage + ".png"); if (image2 == null) { image2 = Image.createRGBImage(new int[1], 1, 1, true); Service.gI().getBgTemplate(bgItem.idImage); } BgItem.imgNew.put(bgItem.idImage + string.Empty, image2); } BgItem.vKeysLast.addElement(bgItem.idImage + string.Empty); } if (!BgItem.isExistKeyNews(bgItem.idImage + string.Empty)) { BgItem.vKeysNew.addElement(bgItem.idImage + string.Empty); } bgItem.changeColor(); } else { Res.outz("item null"); } } } } catch (Exception ex2) { Cout.println("LOI TAI loadMapTableFromResource" + ex2.ToString()); } }
// Token: 0x0600025F RID: 607 RVA: 0x00012DBC File Offset: 0x00010FBC public void readData(myReader iss) { int num = 0; int num2 = 0; int num3 = 0; int num4 = 0; try { sbyte b = iss.readByte(); this.imgInfo = new ImageInfo[(int)b]; for (int i = 0; i < (int)b; i++) { this.imgInfo[i] = new ImageInfo(); this.imgInfo[i].ID = (int)iss.readByte(); this.imgInfo[i].x0 = (int)iss.readByte(); this.imgInfo[i].y0 = (int)iss.readByte(); this.imgInfo[i].w = (int)iss.readByte(); this.imgInfo[i].h = (int)iss.readByte(); } short num5 = iss.readShort(); this.frame = new Frame[(int)num5]; for (int j = 0; j < (int)num5; j++) { this.frame[j] = new Frame(); sbyte b2 = iss.readByte(); this.frame[j].dx = new short[(int)b2]; this.frame[j].dy = new short[(int)b2]; this.frame[j].idImg = new sbyte[(int)b2]; for (int k = 0; k < (int)b2; k++) { this.frame[j].dx[k] = iss.readShort(); this.frame[j].dy[k] = iss.readShort(); this.frame[j].idImg[k] = iss.readByte(); if (j == 0) { if (num > (int)this.frame[j].dx[k]) { num = (int)this.frame[j].dx[k]; } if (num2 > (int)this.frame[j].dy[k]) { num2 = (int)this.frame[j].dy[k]; } if (num3 < (int)this.frame[j].dx[k] + this.imgInfo[(int)this.frame[j].idImg[k]].w) { num3 = (int)this.frame[j].dx[k] + this.imgInfo[(int)this.frame[j].idImg[k]].w; } if (num4 < (int)this.frame[j].dy[k] + this.imgInfo[(int)this.frame[j].idImg[k]].h) { num4 = (int)this.frame[j].dy[k] + this.imgInfo[(int)this.frame[j].idImg[k]].h; } this.width = num3 - num; this.height = num4 - num2; } } } short num6 = iss.readShort(); this.arrFrame = new short[(int)num6]; for (int l = 0; l < (int)num6; l++) { this.arrFrame[l] = iss.readShort(); } } catch (Exception ex) { Cout.LogError("LOI TAI readData cua EffectDAta" + ex.ToString()); } }