public Global defineGlobal(string name, Type type) { if (null == name) name = ".G"+m_code.globals.Count; Global g = new Global(name, type); m_code.globals.Add(g); return g; }
public static byte[] AlchemyResponse(bool isSuccess, Global.slotItem sItem, byte type, byte totalblue) { PacketWriter Writer = new PacketWriter(); Writer.Create(Systems.SERVER_ALCHEMY); Writer.Byte(1); Writer.Byte(2); Writer.Bool(isSuccess); Writer.Byte(sItem.Slot); if (!isSuccess) { Writer.Byte(0); } Writer.DWord(0); Writer.DWord(sItem.ID); Writer.Byte(sItem.PlusValue); Writer.LWord(0); Writer.DWord(sItem.Durability); Writer.Byte(Data.ItemBlue[sItem.dbID].totalblue); for (int i = 0; i <= Data.ItemBlue[sItem.dbID].totalblue - 1; i++) { Writer.DWord(Data.MagicOptions.Find(mg => (mg.Name == Convert.ToString(Data.ItemBlue[sItem.dbID].blue[i]))).ID); Writer.DWord(Data.ItemBlue[sItem.dbID].blueamount[i]); } Writer.Word(1); Writer.Word(2); Writer.Word(3); return Writer.GetBytes(); }
public static void SaveConfigFile(string configFileName, Global.Config config) { var xs = new XmlSerializer(typeof(Global.Config)); using (var sw = new StreamWriter(configFileName)) xs.Serialize(sw, config); }
void _consultaPorDiaViewModel_ProcesoError(Global.ViewModelEventArgs e) { progress.Hide(); if (e.ErrorInMakingRequest) { MessageBox.Show(TextosFront.frontMensajeErrorConexion); } else { e.Error.message = !string.IsNullOrEmpty(e.Error.message) ? e.Error.message : TextosFront.frontMensajeErrorConexion; switch (e.Error.clave) { case Errors.Token.BLOQUEO_TEMPORAL_TOKEN: Resultado res = CasosDeUso.getResultado((Application.Current as App).matrix, CasosDeUso.getCodigoCU(ClavesOperacion.ConsultaBitacora), (int)(Application.Current as App).EstatusToken, (int)(Application.Current as App).EstatusSoftToken); if ("TF".Equals(res.token)) { (Application.Current as App).EstatusToken = EstatusToken.T; } else { (Application.Current as App).EstatusSoftToken = EstatusToken.T; } MessageBox.Show(TextosFront.frontMensajeTokenBloqueadoTemporal2, string.Empty, MessageBoxButton.OK); break; case Errors.Generic.GBL_03: this.NavigateTo(Views._PanoramaPublicoView); this.App().SesionIniciada = false; break; } } }
public ChatServerMessage(Channel chan, string message, Global.Character actor) : base(PacketType.ChatServerMessage) { Channel = chan; Message = message; Actor = actor; }
public ChatServerCopyMessage(Channel chan, string message, Global.Character target) : base(PacketID.ChatServerCopyMessage) { Channel = chan; Message = message; Target = target; }
public ActorSpeakedArgs(Global.Character actor, Channel channel, string message) : base(GameEventArgsType.ActorSpeaked) { Channel = channel; Message = message; Actor = actor; }
public static void serialize(Utils.Objects.Packet sender, List<int> path, Global.Character actor) { sender.WriteShort( (short)path.Count ); foreach (int cell in path) sender.WriteShort((short)cell); sender.WriteInt(actor.Guid); }
void _vm_ViewModelLoaded(Global.ViewModelEventArgs e) { this._vm.ProcesoError += _vm_ProcesoError; this._vm.ProcessSuccess += _vm_ProcessSuccess; this._vm.CerrarSesionComplete += new Global.ViewModelServiceCallback(_vm_CerrarSesionComplete); this._vm.ValidaTokenComplete += _vm_ValidaTokenComplete; lstCompaniasCelular.ItemsSource = this._vm.CompaniasCelulares; lstCompaniasCelular.DataBind(); tbxTelefonoCelular.Text = this._vm.TelefonoCelular; if (null != this._vm.CompaniaCelular) { tbxCompaniaCelular.Text = this._vm.CompaniaCelular.NombreCompania; } tbxCorreoElectronico.Text = this._vm.CorreoElectronico; token.TokenSelected += token_TokenSelected; introducirPin.ValidarPinCompleted += new UserControls.IntroducirPin.ValidarPinCompletedEventHandler(introducirPin_ValidarPinCompleted); this.BackKeyPress += token.CancelBackKeyPress; this.BackKeyPress += lstCompaniasCelular.CancelBackKeyPress; this.BackKeyPress += AltaSuperTokenView_BackKeyPress; if(this._vm.ActualizarDatos == "OK") Paso1_3(); else Paso2_3(); }
void _vm_CerrarSesionError(Global.ViewModelEventArgs e) { if (!e.ErrorInMakingRequest) { if (!string.IsNullOrEmpty(e.Error.message)) { switch (e.Error.clave) { case Errors.Generic.GBL_03: this.NavigateTo(Views._PanoramaPublicoView); this.App().SesionIniciada = false; break; default: break; } MessageBox.Show(e.Error.message); } else { MessageBox.Show(TextosFront.frontMensajeErrorConexion); } } else { MessageBox.Show(TextosFront.frontMensajeErrorConexion); } }
public static void serialize(Utils.Objects.Packet sender, Global.Character senderChar, Global.Character targetChar) { sender.WriteInt(senderChar.Guid); sender.WriteUTF(senderChar.Name); sender.WriteInt(targetChar.Guid); sender.WriteUTF(targetChar.Name); }
/// <summary> /// Get the particular Problem object based on the option chosen by user /// </summary> /// <param name="problem">Problem ID</param> /// <returns>Respective problem object</returns> static Problem ProblemFactory(Global.Problems problem) { switch (problem) { case Global.Problems.RodCutting: return new RodCutting(); default: return null; } }
public static void serialize(Utils.Objects.Packet sender, Channel chan, string message, Global.Character target) { sender.WriteByte((byte)chan); sender.WriteUTF(message); sender.WriteInt(Global.Environnement.getInstance().Timestamp); sender.WriteUTF("abcdef"); // fingerprint ??? sender.WriteInt(target.Guid); sender.WriteUTF(target.Name); }
/// <summary> /// Get the particular Problem object based on the option chosen by user /// </summary> /// <param name="problem">Problem ID</param> /// <returns>Respective problem object</returns> static Problem ProblemFactory(Global.Problems problem) { switch (problem) { case Global.Problems.RodCutting: return new RodCutting(); case Global.Problems.LongestCommonSubSequence: return new LongestCommonSubsequence(); default: return null; } }
public static void serialize(Utils.Objects.Packet sender, Global.FriendList friends) { sender.WriteShort((short)friends.Count); foreach (Types.context.FriendInformations friend in friends.ToList()) { sender.WriteShort((short)friend.ProtocolID); friend.serialize(sender); } }
public Base CheckSyntax(List<Token> tokens, List<ILineContext> context, Global.InstructionSets architecture) { allTokens = tokens; allContext = context; this.architecture = architecture; astBase = new Base(context[0]); EatStatements(); return astBase; }
public static void serialize(Utils.Objects.Packet packet, Global.Character character) { packet.WriteUTF(character.Name); packet.WriteByte((byte)character.Classe); packet.WriteByte((byte)character.Sexe); foreach (int color in character.Colors) packet.WriteInt(color); }
public static void serialize(Utils.Objects.Packet sender, Channel chan, string message, Global.Character target) { sender.WriteByte((byte)chan); sender.WriteUTF(message); sender.WriteInt( (int)(DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds ); sender.WriteUTF("abcdef"); // fingerprint ??? sender.WriteInt((int)target.Id); sender.WriteUTF(target.Name); }
/// <summary> /// Constructor for the Problem class, initializes all data regarding one Particular problem /// </summary> /// <param name="problemID">ID of the Problem</param> protected Problem(Global.Problems problemID) { ProblemID = problemID; metaData = new ProblemMetaData(problemID); Name = metaData.GetName(); Description = metaData.GetDescription(); Implementations = metaData.GetImplementations(); Instruction = metaData.GetInstruction(); DefaultSubMethod = metaData.GetDefaultSubMethod(); }
public static void serialize(Utils.Objects.Packet sender, Channel chan, string message, Global.Character actor) { sender.WriteByte((byte)chan); sender.WriteUTF(message); sender.WriteInt( (int)(DateTime.Now - new DateTime(1970, 1, 1)).TotalSeconds ); sender.WriteUTF(string.Empty); sender.WriteInt((int)actor.Id); sender.WriteUTF(actor.Name); sender.WriteInt((int)actor.Owner.Id); }
public static void serialize(Utils.Objects.Packet sender, Channel chan, string message, Global.Character actor) { sender.WriteByte((byte)chan); sender.WriteUTF(message); sender.WriteInt(Global.Environnement.getInstance().Timestamp); sender.WriteUTF("abcdef"); sender.WriteInt(actor.Guid); sender.WriteUTF(actor.Name); sender.WriteInt(actor.AccountID); }
public static void serialize(Utils.Objects.Packet sender, Global.Account acc) { sender.WriteShort(1); // nGameServers sender.WriteUShort((ushort)GlobalConfig.Network.Game.Guid); sender.WriteByte((byte)ServerState.ONLINE); sender.WriteByte(0); // completion sender.WriteBool(true); // selectable sender.WriteByte( (byte)acc.Characters.Count ); }
public static void serialize(Utils.Objects.Packet sender, Global.Party party) { sender.WriteInt(party.Leader.Guid); sender.WriteShort((short)party.Members.Count); foreach (Global.Character member in party.Members) new Types.game.context.PartyMemberInformations(member).serialize(sender); sender.WriteBool(false); // restricted ?? }
/// <summary> /// Creates a new Symbol Table /// </summary> public Table(Table reference, Global.Scope scopeType, string identifier) { ParentOf = new List<Table>(); dictionary = new Dictionary<Tuple<string, List<ASTType>>, Symbol>(new TableFunctionComparator()); this.reference = reference; if (reference != null) reference.ParentOf.Add(this); this.scopeType = scopeType; this.identifier = identifier; symbolToTableVisitor = new SymbolToTableVisitor(dictionary); }
public static void serialize(Utils.Objects.Packet sender, Global.Account acc) { int wrapper = 0; Utils.BooleanByteWrapper.setFlag(ref wrapper, 0, (int)acc.GmLvl > 0); Utils.BooleanByteWrapper.setFlag(ref wrapper, 1, acc.Connected); sender.WriteByte( (byte)wrapper ); sender.WriteUTF("[" + acc.GmLvl + "] " + acc.Nickname); sender.WriteInt((int)acc.Id); sender.WriteByte(0); // communityID sender.WriteUTF(""); // question sender.WriteDouble(31536000000); // aboTime (un an en millisecondes) }
void _vm_ProcesoError(Global.ViewModelEventArgs e) { if (e.ErrorInMakingRequest) { MessageBox.Show(TextosFront.frontMensajeErrorConexion); } else { e.Error.message = !string.IsNullOrEmpty(e.Error.message) ? e.Error.message : TextosFront.frontMensajeErrorConexion; switch (e.Error.clave) { default: (ApplicationBar.MenuItems[0] as Microsoft.Phone.Shell.ApplicationBarMenuItem).IsEnabled = this._vm.Sucursales.Count >= 1 && !this._vm.Sucursales[0].Tipo.ToLower().Equals(TipoPushpin.UbicacionActual.ToString().ToLower()); MessageBox.Show(e.Error.message); break; } } }
void _vm_ProcesoError(Global.ViewModelEventArgs e) { progress.Hide(); if (e.ErrorInMakingRequest) { MessageBox.Show(TextosFront.frontMensajeErrorConexion); } else { e.Error.message = !string.IsNullOrEmpty(e.Error.message) ? e.Error.message : TextosFront.frontMensajeErrorConexion; switch (e.Error.clave) { default: MessageBox.Show(e.Error.message); break; } } }
/// <summary> /// FileHandler Constructor /// </summary> /// <param name="ioMode">Specify the IO Mode of the operation</param> /// <param name="saveEntireContent">true to cache entire content of the file, dont mention anything for Output file mode</param> public FileHandler(Global.IOMode ioMode, bool saveEntireContent = false) { this.saveEntireContent = saveEntireContent; if (ioMode == Global.IOMode.Input) { if (saveEntireContent) entireContent = System.IO.File.ReadAllText(inputFilePath).Split('\n'); else reader = new StreamReader(inputFilePath); } else writer = new StreamWriter(outputFilePath); }
public BulletPhysicsComponent(Engine engine, Vector2 initialGameWorldPosition, Vector2 directionalVector, float angle, Global.CollisionCategories category) : base(engine) { MainFixture = FixtureFactory.CreateCircle(Engine.Physics.World, 0.05f, 1.0f); Bodies.Add(MainFixture.Body); MainFixture.Body.Rotation = angle; MainFixture.Body.BodyType = BodyType.Dynamic; MainFixture.Body.IgnoreGravity = true; MainFixture.Body.IsBullet = true; MainFixture.Body.Position = Engine.Physics.PositionToPhysicsWorld(initialGameWorldPosition); MainFixture.CollisionFilter.CollisionCategories = (Category)category; MainFixture.Body.LinearVelocity = directionalVector; }
private string getRegisterName(Global.Registers n) { switch (n) { case Global.Registers.STACKBASEPOINTER: return "%rbp"; case Global.Registers.STACKPOINTER: return "%rsp"; case Global.Registers.ACCUMULATOR: return "%rax"; case Global.Registers.BASE: return "%rbx"; case Global.Registers.COUNTER: return "%rcx"; case Global.Registers.DATA: return "%rdx"; case Global.Registers.INSTRUCTIONPOINTER: return "%rip"; case Global.Registers.DEST_INDEX: return "%rdi"; case Global.Registers.SRC_INDEX: return "%rsi"; default: return null; } }