static private void addProps(string chrs, PROP props) { for (int c = 0; c < chrs.Length; ++c) { sems[chrs[c]] |= props; } }
public Obstacle(PROP properties, int x, int y, int z, uint radius, int dir) { this.Properties = properties; this.X = x; this.Y = y; this.Z = z; this.Radius = radius; this.Dir = dir; }
public Example(Type type, bool useCustomIcon, string notes, string funFact, PROP prop, Style[] presets = null) { this.Type = type; this.UseCustomIcon = useCustomIcon; this.Notes = notes; this.FunFact = funFact; this.Prop = prop; this.Presets = presets; var iconFileName = (useCustomIcon) ? DisplayName : "Misc"; Icon = new BitmapImage(new System.Uri($"Resources/Menu-{iconFileName}.png", UriKind.Relative)); }
public void UplinkData(string hccu_id, string _EP_ID, string _PROPERTY_COLLECTION) { string skraw = "HCCU_ID=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(hccu_id) + "&EP_ID=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(_EP_ID) + "&PROPERTY_COLLECTION=" + COS_SECURITY_TOOL.SECURITY_ContentEncrypt(_PROPERTY_COLLECTION); string sk = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(skraw); PROP p = new PROP(); p.EP_PROPERTYDATA_Uplink(COS_SECURITY_TOOL.SECURITY_ContentEncrypt(hccu_id), COS_SECURITY_TOOL.SECURITY_ContentEncrypt(_EP_ID), COS_SECURITY_TOOL.SECURITY_ContentEncrypt(_PROPERTY_COLLECTION), sk); }
public override ModuleName Update(GameTime gameTime) { if (PROP.allInput.Back()) { return(ModuleName.Exit); } else if (PROP.allInput.SelectMenuItem()) { switch (selected) { case 0: //New game PROP.InitPlayers(); //create a ship for each player refEngine.LoadLevel(LevelNumber.One); return(ModuleName.Engine); case 1: //Options return(ModuleName.Options); case 2: //Instructions return(ModuleName.Instructions); case 3: //Credits return(ModuleName.Credits); case 4: //Exit return(ModuleName.Exit); default: //New game return(ModuleName.MainMenu); } } else if (PROP.allInput.MenuNext()) { SelectNext(); } else if (PROP.allInput.MenuPrevious()) { SelectPrevious(); } return(base.Update(gameTime)); }
public Property(Instance instance, PROP property) { Instance = instance; Name = property.Name; Type = property.Type; }
protected override void ReadFile(byte[] contents) { using (MemoryStream file = new MemoryStream(contents)) using (BinaryRobloxFileReader reader = new BinaryRobloxFileReader(this, file)) { // Verify the signature of the file. byte[] binSignature = reader.ReadBytes(14); string signature = Encoding.UTF7.GetString(binSignature); if (signature != MagicHeader) { throw new InvalidDataException("Provided file's signature does not match BinaryRobloxFile.MagicHeader!"); } // Read header data. Version = reader.ReadUInt16(); NumClasses = reader.ReadUInt32(); NumInstances = reader.ReadUInt32(); Reserved = reader.ReadInt64(); // Begin reading the file chunks. bool reading = true; Classes = new INST[NumClasses]; Instances = new Instance[NumInstances]; while (reading) { try { var chunk = new BinaryRobloxFileChunk(reader); IBinaryFileChunk handler = null; switch (chunk.ChunkType) { case "INST": handler = new INST(); break; case "PROP": handler = new PROP(); break; case "PRNT": handler = new PRNT(); break; case "META": handler = new META(); break; case "SSTR": handler = new SSTR(); break; case "SIGN": handler = new SIGN(); break; case "END\0": ChunksImpl.Add(chunk); reading = false; break; case string unhandled: Console.Error.WriteLine("BinaryRobloxFile - Unhandled chunk-type: {0}!", unhandled); break; default: break; } if (handler != null) { using (var readBuffer = new MemoryStream(chunk.Data)) { using (var dataReader = new BinaryRobloxFileReader(this, readBuffer)) { chunk.Handler = handler; handler.Load(dataReader); } } ChunksImpl.Add(chunk); } } catch (EndOfStreamException) { throw new Exception("Unexpected end of file!"); } } } }
public override void Save(Stream stream) { ////////////////////////////////////////////////////////////////////////// // Generate the chunk data. ////////////////////////////////////////////////////////////////////////// using (var workBuffer = new MemoryStream()) using (var writer = new BinaryRobloxFileWriter(this, workBuffer)) { // Clear the existing data. Referent = "-1"; ChunksImpl.Clear(); NumInstances = 0; NumClasses = 0; SSTR = null; // Recursively capture all instances and classes. writer.RecordInstances(Children); // Apply the recorded instances and classes. writer.ApplyClassMap(); // Write the INST chunks. foreach (INST inst in Classes) { writer.SaveChunk(inst); } // Write the PROP chunks. foreach (INST inst in Classes) { var props = PROP.CollectProperties(writer, inst); foreach (string propName in props.Keys) { PROP prop = props[propName]; writer.SaveChunk(prop); } } // Write the PRNT chunk. var parents = new PRNT(); writer.SaveChunk(parents); // Write the SSTR chunk. if (HasSharedStrings) { writer.SaveChunk(SSTR, 0); } // Write the META chunk. if (HasMetadata) { writer.SaveChunk(META, 0); } // Write the SIGN chunk. if (HasSignatures) { writer.SaveChunk(SIGN); } // Write the END chunk. writer.WriteChunk("END", "</roblox>"); } ////////////////////////////////////////////////////////////////////////// // Write the chunk buffers with the header data ////////////////////////////////////////////////////////////////////////// using (BinaryWriter writer = new BinaryWriter(stream)) { stream.Position = 0; stream.SetLength(0); writer.Write(MagicHeader .Select(ch => (byte)ch) .ToArray()); writer.Write(Version); writer.Write(NumClasses); writer.Write(NumInstances); writer.Write(Reserved); foreach (BinaryRobloxFileChunk chunk in Chunks) { if (chunk.HasWriteBuffer) { byte[] writeBuffer = chunk.WriteBuffer; writer.Write(writeBuffer); } } } }
static public bool hasProps(char chr, PROP props) { return((chr < 256) ? (sems[chr] & props) != 0 : false); }
public string Sync(string HCCU_ID, string HCCU_MAC_ID, string EXECORDER_EP_ID_PAKG, string EVENT_ID_Collection, string TRANS_PAKG, string REQLOGS_PAKG, string SK) { string[,] p = new string[2, 6]; p[0, 0] = "HCCU_ID"; p[1, 0] = HCCU_ID; p[0, 1] = "HCCU_MAC_ID"; p[1, 1] = HCCU_MAC_ID; p[0, 2] = "EXECORDER_EP_ID_PAKG"; p[1, 2] = EXECORDER_EP_ID_PAKG; p[0, 3] = "EVENT_ID_Collection"; p[1, 3] = EVENT_ID_Collection; p[0, 4] = "TRANS_PAKG"; p[1, 4] = TRANS_PAKG; p[0, 5] = "REQLOGS_PAKG"; p[1, 5] = REQLOGS_PAKG; if (!COS_SECURITY_TOOL.SECURITY_RequestDecrypt(p, SK)) { return(COS_SECURITY_TOOL.SECURITY_ContentEncrypt("-4")); } /* * SYNC_HCCU_EP_INFO * * */ #region output:return_sync_hccu_ep_info HCCU _HCCU = new HCCU(); string para = "HCCU_ID=" + HCCU_ID + "&HCCU_MAC=" + HCCU_MAC_ID; string sk = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(para); string return_sync_hccu_ep_info = _HCCU.HCCU_EP_Get_Info(HCCU_ID, HCCU_MAC_ID, sk); return_sync_hccu_ep_info = "<SYNC_HCCU_EP_INFO>" + return_sync_hccu_ep_info + "</SYNC_HCCU_EP_INFO>"; #endregion /* * SYNC_EXECORDER * * */ #region output:return_sync_exec_order EXEC_ORDER _EXEC_ORDER = new EXEC_ORDER(); string return_sync_exec_order = ""; if (EXECORDER_EP_ID_PAKG != "") { string[] EXECORDER_EP_ID_PAKG_ARRAY = EXECORDER_EP_ID_PAKG.Split('|'); for (int x = 0; x < EXECORDER_EP_ID_PAKG_ARRAY.Length; x++) { if (EXECORDER_EP_ID_PAKG_ARRAY[x] != "") { string[] EXECORDER_EP_ID_PAKG_SINGLE_ARRAY = EXECORDER_EP_ID_PAKG_ARRAY[x].Split(','); return_sync_exec_order += _EXEC_ORDER.EXEC_ORDER_Get(EXECORDER_EP_ID_PAKG_SINGLE_ARRAY[0], EXECORDER_EP_ID_PAKG_SINGLE_ARRAY[1]) + "^"; } } return_sync_exec_order = "<SYNC_EXECORDER>" + return_sync_exec_order + "</SYNC_EXECORDER>"; } else { return_sync_exec_order = "<SYNC_EXECORDER></SYNC_EXECORDER>"; } #endregion /* * SYNC_EP_EVENTS * * */ #region output:return_sync_events EVENTS _EVENTS = new EVENTS(); string para3 = "HCCU_ID=" + HCCU_ID; string sk3 = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(para3); string return_sync_events = _EVENTS.EVENTS_Sync(HCCU_ID, sk3); return_sync_events = "<SYNC_EVENTS>" + return_sync_events + "</SYNC_EVENTS>"; #endregion /* * UPLOAD: SYNC_NOTIFYEVENTUPDATE(1,-1,-2,-4) * * * */ #region output:return_sync_notifyeventupdate string para35 = "EVENT_ID_Collection=" + EVENT_ID_Collection; string sk35 = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(para35); string return_sync_notifyeventupdate = _EVENTS.NotifyEventUpdate(EVENT_ID_Collection, sk35); return_sync_notifyeventupdate = "<SYNC_NOTIFYEVENTUPDATE>" + return_sync_notifyeventupdate + "</SYNC_NOTIFYEVENTUPDATE>"; #endregion /* * SYNC_PROP * * */ #region output:return_sync_prop PROP _PROP = new PROP(); string para4 = "HCCU_ID=" + HCCU_ID; string sk4 = COS_SECURITY_TOOL.SECURITY_RequestEncrypt(para4); string return_sync_prop = _PROP.EP_PROPERTYFACT_Sync(HCCU_ID, sk4); return_sync_prop = "<SYNC_PROP>" + return_sync_prop + "</SYNC_PROP>"; #endregion /* * UPLOAD: SYNC_TRANS(1,-1,-2,-4) * * */ #region output:return_sync_trans string return_sync_trans = ""; TRANS _TRANS = new TRANS(); if (TRANS_PAKG.Trim() != "") { string[] TRANS_PAKG_ARRAY = TRANS_PAKG.Split('|'); for (int x = 0; x < TRANS_PAKG_ARRAY.Length; x++) { if (TRANS_PAKG_ARRAY[x] != "") { string[] TRANS_PAKG_SINGLE_ARRAY = TRANS_PAKG_ARRAY[x].Split(','); return_sync_trans += _TRANS.TRANS_Add(TRANS_PAKG_SINGLE_ARRAY[0], TRANS_PAKG_SINGLE_ARRAY[1], TRANS_PAKG_SINGLE_ARRAY[2], TRANS_PAKG_SINGLE_ARRAY[3], TRANS_PAKG_SINGLE_ARRAY[4]) + ","; } } return_sync_trans = "<SYNC_TRANS>" + return_sync_trans + "</SYNC_TRANS>"; } else { return_sync_trans = "<SYNC_TRANS></SYNC_TRANS>"; } #endregion /* * UPLOAD: SYNC_REQLOGS(1,-1,-2,-4) * * */ #region output:return_sync_requestlogs string return_sync_requestlogs = ""; REQUESTLOGS _REQUESTLOGS = new REQUESTLOGS(); if (REQLOGS_PAKG.Trim() != "") { string[] REQLOGS_PAKG_ARRAY = REQLOGS_PAKG.Split('|'); for (int x = 0; x < REQLOGS_PAKG_ARRAY.Length; x++) { if (REQLOGS_PAKG_ARRAY[x] != "") { string[] REQLOGS_PAKG_SINGLE_ARRAY = REQLOGS_PAKG_ARRAY[x].Split(','); return_sync_requestlogs += _REQUESTLOGS.REQUESTLOGS_Add(REQLOGS_PAKG_SINGLE_ARRAY[0], REQLOGS_PAKG_SINGLE_ARRAY[1], REQLOGS_PAKG_SINGLE_ARRAY[2], REQLOGS_PAKG_SINGLE_ARRAY[3], REQLOGS_PAKG_SINGLE_ARRAY[4], REQLOGS_PAKG_SINGLE_ARRAY[5], REQLOGS_PAKG_SINGLE_ARRAY[6]) + ","; } } return_sync_requestlogs = "<SYNC_REQLOGS>" + return_sync_requestlogs + "</SYNC_REQLOGS>"; } else { return_sync_requestlogs = "<SYNC_REQLOGS></SYNC_REQLOGS>"; } #endregion return(return_sync_hccu_ep_info + return_sync_exec_order + return_sync_events + return_sync_notifyeventupdate + return_sync_prop + return_sync_trans + return_sync_requestlogs); }