This thread is about the emulator, not a packetlogger - and if it helps him in development, then who cares if its not 100% done right?
Lol, whatever it is, i cracked it ;D
---------- Post added at 09:21 PM ---------- Previous post was at 09:19 PM ----------
Have a look @ this:
Code:using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace SpeedEmulator.Messages { class Response { private readonly int HeaderId; public StringBuilder Builder = new StringBuilder(); private int LenghtBuilder = new int(); public Response(int HeaderId) { this.HeaderId = HeaderId; } public void AppendInt16(short i) { byte[] Bytes = BitConverter.GetBytes(i); for (int e = 1; e > -1; e--) { Builder.Append((char)Bytes[e]); } LenghtBuilder += 2; } public void AppendInt32(int i) { byte[] Bytes = BitConverter.GetBytes(i); for (int e = 3; e > -1; e--) { Builder.Append((char)Bytes[e]); } LenghtBuilder += 4; } public void AppendChar(int i) { byte Byte = BitConverter.GetBytes(i)[0]; Builder.Append((char)Byte); LenghtBuilder++; } public void AppendShortBoolean(bool Bool) { byte Byte = BitConverter.GetBytes((Bool) ? 1 : 0)[0]; Builder.Append((char)Byte); LenghtBuilder++; } public void AppendBoolean(bool Bool) { AppendInt32((Bool) ? 1 : 0); } public void AppendStringWithBreak(string i) { AppendInt16((short)i.Length); Builder.Append(i); LenghtBuilder += i.Length; } public byte[] GetBytes() { StringBuilder Merge = new StringBuilder(); var LenghtBytes = BitConverter.GetBytes((LenghtBuilder + 2)); for (int i = 3; i > -1; i--) // All 4 bytes :D { Merge.Append((char)LenghtBytes[i]); } var Headerbytes = BitConverter.GetBytes(HeaderId); for (int i = 1; i > -1; i--) // First 2 Bytes :o { Merge.Append((char)Headerbytes[i]); } foreach (char c in Builder.ToString().ToCharArray()) // Content Bytes { Merge.Append(c); } return Encoding.UTF8.GetBytes(Merge.ToString()); } } }
---------- Post added at 09:21 PM ---------- Previous post was at 09:21 PM ----------
Ok, guys back to the development ;D
Exactly.
Brickemulator pic that ive assumed (Like a pie chart or whatever):
Note: I did the picture quick and i assume thats what its having. Wired has three Top is trigger Middle is effects and bottum is conditions. I did this pic quick so dont flame me for it.
Basically im assuming it will have all games all marketplace coding everywhere (good coding) Wired going to be added in and a good cata :P I WANNA TEST IT :O
brickDevelopment Application
Snapshot
Download Brickdevelopment.exe
Yup thats right.
---------- Post added at 02:07 PM ---------- Previous post was at 01:55 PM ----------
Or just goto: Twitter
Verifying Wall Position:
Code:public string VerifyWallPosition(string Position) { if (string.IsNullOrEmpty(Position)) { return null; } if (Position.Contains(Convert.ToChar(13)) || Position.Contains(Convert.ToChar(9))) { return null; } string Filtered = Position.Replace(":", string.Empty).ToLower(); string[] Split = Filtered.Split(' '); if (Split.Length != 3) { return null; } string[] WidthRaw = Split[0].Replace("l", string.Empty).Split(','); int[] WidthInts = new int[2]; foreach (string raw in WidthRaw) { int Out = -1; if (!int.TryParse(raw, out Out)) { return null; } if (Out < 0 || Out > 200) { return null; } WidthInts[Array.IndexOf(WidthRaw, raw)] = Out; } string[] LenghtRaw = Split[1].Replace("l", string.Empty).Split(','); int[] LenghtInts = new int[2]; foreach (string raw in LenghtRaw) { int Out = -1; if (!int.TryParse(raw, out Out)) { return null; } if (Out < 0 || Out > 200) { return null; } LenghtInts[Array.IndexOf(LenghtRaw, raw)] = Out; } char WallCharacter = Split[2][0]; if (!WallCharacter.Equals('l') && !WallCharacter.Equals('r')) { return null; } return string.Format(":{0} {1} {2}", string.Format("{0}={1},{2}", 'w', WidthInts[0], WidthInts[1]), string.Format("{0}={1},{2}", 'l', LenghtInts[0], LenghtInts[1]), WallCharacter); }