private static void smethod_19(Session session_0, ClientMessage clientMessage_0) { if (!session_0.CharacterInfo.IsMuted) { uint actorId = clientMessage_0.ReadUnsignedInteger(); clientMessage_0.ReadUnsignedInteger(); string messageText = InputFilter.FilterString(clientMessage_0.ReadString().Trim(), false); clientMessage_0.ReadUnsignedInteger(); SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId); if (instanceBySpaceId != null) { SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); if (actorByReferenceId != null) { SpaceActor actor = instanceBySpaceId.GetActor(actorId); if ((actor != null) && (messageText.Length != 0)) { if (messageText.Length > 100) { messageText = messageText.Substring(0, 100); } uint referenceId = actor.ReferenceId; if (referenceId > 0) { actorByReferenceId.Whisper(messageText, referenceId, false); } } } } } }
private static void smethod_18(Session session_0, ClientMessage clientMessage_0) { if (!session_0.CharacterInfo.IsMuted) { SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId); if (instanceBySpaceId != null) { SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); if (actorByReferenceId != null) { CharacterInfo referenceObject = (CharacterInfo)actorByReferenceId.ReferenceObject; clientMessage_0.ReadUnsignedInteger(); string input = InputFilter.FilterString(clientMessage_0.ReadString().Trim(), false); int messageColor = clientMessage_0.ReadInteger(); if (input.Length != 0) { if (input.Length > 100) { input = input.Substring(0, 100); } if (referenceObject.Staff == 0) { messageColor = 1; } if (referenceObject.Staff == 1) { messageColor = 9; } if (referenceObject.Staff == 2) { messageColor = 2; } if (!input.StartsWith("@") || !ChatCommands.HandleCommand(session_0, input)) { actorByReferenceId.Chat(input, messageColor, referenceObject.Staff == 1); } //1 white, 2 gold, 6 pink, 7 red, 8 blue, 9 orange, 10 green /* * * White = Normal * Gold = RetroMods * Green = Designer * Blue = Translators * Pink = VIP * Red = Admin * Orange = XAT Staff * */ } } } } }
public static void smethod_20(Session session_0, ClientMessage clientMessage_0) { uint itemId = clientMessage_0.ReadUnsignedInteger(); SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId); if (instanceBySpaceId != null) { SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); if (actorByReferenceId != null) { CharacterInfo referenceObject = (CharacterInfo)actorByReferenceId.ReferenceObject; try { ContestItem item = instanceBySpaceId.Items[itemId]; if ((item != null) && item.IsActive) { using (SqlDatabaseClient client = SqlDatabaseManager.GetClient()) { item.CatchItem(client, (int)session_0.CharacterId); string definitionName = item.DefinitionName; if (definitionName != null) { if (definitionName != "cofre_oro") { if (!(definitionName == "cofre_plata")) { if (definitionName == "") { instanceBySpaceId.BroadcastChatMessage(actorByReferenceId, actorByReferenceId.Name + " ha cogido un diamante.", false, 3); instanceBySpaceId.BroadcastChatMessage(actorByReferenceId, actorByReferenceId.Name + " has caught a diamond", false, 3); } else { instanceBySpaceId.BroadcastChatMessage(actorByReferenceId, string.Concat(new object[] { actorByReferenceId.Name, " ha atrapado un cofre y obtiene: ", item.SilverCredits, " monedas de plata." }), false, 3); instanceBySpaceId.BroadcastChatMessage(actorByReferenceId, string.Concat(new object[] { actorByReferenceId.Name, " has caught a chest and obtained: ", item.GoldCredits, " silver credits." }), false, 3); referenceObject.UpdateSilverCreditsBalance(client, (int)item.SilverCredits); session_0.SendData(CharacterCoinsComposer.AddSilverCompose(item.SilverCredits), false); } } else { instanceBySpaceId.BroadcastChatMessage(actorByReferenceId, string.Concat(new object[] { actorByReferenceId.Name, " ha atrapado un cofre y obtiene: ", item.GoldCredits, " monedas de oro." }), false, 3); instanceBySpaceId.BroadcastChatMessage(actorByReferenceId, string.Concat(new object[] { actorByReferenceId.Name, " has caught a chest and obtained: ", item.GoldCredits, " gold credits." }), false, 3); referenceObject.UpdateGoldCreditsBalance(client, (int)item.GoldCredits); session_0.SendData(CharacterCoinsComposer.AddGoldCompose(item.GoldCredits), false); } } } instanceBySpaceId.BroadcastMessage(SpaceCatchItemComposer.Compose(itemId), 0, false); instanceBySpaceId.BroadcastMessage(SpaceRemoveItemComposer.Compose(itemId), 0, false); } } } catch (Exception) { } } } }
private static void smethod_3(Session session_0, ClientMessage clientMessage_0) { SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId); if (instanceBySpaceId != null) { SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); if ((actorByReferenceId != null) && !actorByReferenceId.IsLocked) { SpaceManager.RemoveUserFromSpace(session_0, true); } } }
private static void smethod_7(Session session_0, ClientMessage clientMessage_0) { clientMessage_0.ReadUnsignedInteger(); int rotation = clientMessage_0.ReadInteger(); SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId); if (instanceBySpaceId != null) { SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); if ((actorByReferenceId != null) && !actorByReferenceId.IsLocked) { instanceBySpaceId.BroadcastMessage(SpaceUserRotationComposer.Compose(actorByReferenceId.UInt32_0, actorByReferenceId.Position.Int32_0, actorByReferenceId.Position.Int32_1, rotation), 0, false); } } }
private static void smethod_2(Session session_0, ClientMessage clientMessage_0) { if (session_0 != null) { if (!SpaceManager.InstanceIsLoadedForSpace(session_0.AbsoluteSpaceId)) { if (SpaceManager.TryLoadSpaceInstance(session_0.AbsoluteSpaceId)) { } else { Console.WriteLine("ERROR"); } } SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.AbsoluteSpaceId); if (instanceBySpaceId != null) { session_0.SpaceAuthed = true; } if (((instanceBySpaceId != null) && !session_0.SpaceJoined) && (session_0.SpaceAuthed && !instanceBySpaceId.Info.BlackList.Contains(session_0.CharacterInfo.Username))) { if (!instanceBySpaceId.AddUserToSpace(session_0)) { SpaceManager.RemoveUserFromSpace(session_0, true); } else { session_0.SpaceAuthed = true; session_0.SpaceJoined = true; instanceBySpaceId.SendObjects(session_0); LaptopHandler.MarkUpdateNeeded(session_0, 0, false); SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); if (actorByReferenceId == null) { session_0.SendData(SpaceUserRemovedComposer.SingleCompose()); } else { instanceBySpaceId.BroadcastMessage(SpaceObjectListComposer.BroadcastCompose(actorByReferenceId), session_0.CharacterId, true); } } } else { session_0.SendData(SpaceUserRemovedComposer.SingleCompose()); } } }
private static void smethod_5(Session session_0, ClientMessage clientMessage_0) { clientMessage_0.ReadUnsignedInteger(); uint actionId = clientMessage_0.ReadUnsignedInteger(); SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId); if (instanceBySpaceId != null) { SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); if ((actorByReferenceId != null) && !actorByReferenceId.IsPreLocked) { actorByReferenceId.PreLock(2); instanceBySpaceId.BroadcastMessage(SpaceUserActionComposer.Compose(session_0.CharacterId, actionId), 0, false); } } }
private static void smethod_17(Session session_0, ClientMessage clientMessage_0) { clientMessage_0.ReadUnsignedInteger(); string motto = clientMessage_0.ReadString(); SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId); if (instanceBySpaceId != null) { SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); if (actorByReferenceId != null) { CharacterInfo referenceObject = (CharacterInfo)actorByReferenceId.ReferenceObject; using (SqlDatabaseClient client = SqlDatabaseManager.GetClient()) { referenceObject.UpdateMotto(client, motto); } instanceBySpaceId.BroadcastMessage(SpaceUserMottoUpdateComposer.Compose(actorByReferenceId.UInt32_0, motto), 0, false); } } }
private static void smethod_14(Session session_0, ClientMessage clientMessage_0) { clientMessage_0.ReadUnsignedInteger(); uint actorId = clientMessage_0.ReadUnsignedInteger(); SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId); if (instanceBySpaceId != null) { SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); SpaceActor actor = instanceBySpaceId.GetActor(actorId); if ((actor != null) && (actorByReferenceId != null)) { Session sessionByCharacterId = SessionManager.GetSessionByCharacterId(actor.ReferenceId); if (sessionByCharacterId != null) { sessionByCharacterId.SendData(SpaceUserCancelActionComposer.TargetCompose(actorByReferenceId.UInt32_0), false); } } } }
private static void smethod_10(Session session_0, ClientMessage clientMessage_0) { uint actorId = clientMessage_0.ReadUnsignedInteger(); uint colorId = clientMessage_0.ReadUnsignedInteger(); int vote = clientMessage_0.ReadInteger(); SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId); if (instanceBySpaceId != null) { SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); if (actorByReferenceId != null) { CharacterInfo referenceObject = (CharacterInfo)actorByReferenceId.ReferenceObject; using (SqlDatabaseClient client = SqlDatabaseManager.GetClient()) { referenceObject.UpdateVotes(client, colorId, vote); } instanceBySpaceId.BroadcastMessage(SpaceUserVoteUpdateComposer.Compose(actorId, colorId, vote), 0, false); } } }
private static void smethod_4(Session session_0, ClientMessage clientMessage_0) { SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId); if (instanceBySpaceId != null) { SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); if ((actorByReferenceId != null) && !actorByReferenceId.IsLocked) { clientMessage_0.ReadUnsignedInteger(); string str = clientMessage_0.ReadString(); string str2 = str; List <Vector3> stepList = new List <Vector3>(); while (str2 != "") { stepList.Add(new Vector3(int.Parse(str2.Substring(0, 2)), int.Parse(str2.Substring(2, 2)), int.Parse(str2.Substring(4, 1)))); str2 = str2.Substring(5); } Vector3 toPosition = new Vector3(int.Parse(str.Substring(str.Length - 5, 2)), int.Parse(str.Substring(str.Length - 3, 2)), int.Parse(str.Substring(str.Length - 1, 1))); actorByReferenceId.MoveTo(stepList, toPosition, false, false, false); } } }
private static void smethod_12(Session session_0, ClientMessage clientMessage_0) { uint actionId = clientMessage_0.ReadUnsignedInteger(); uint actorId = clientMessage_0.ReadUnsignedInteger(); SpaceInstance instanceBySpaceId = SpaceManager.GetInstanceBySpaceId(session_0.CurrentSpaceId); if (instanceBySpaceId == null) { return; } SpaceActor actorByReferenceId = instanceBySpaceId.GetActorByReferenceId(session_0.CharacterId, SpaceActorType.UserCharacter); SpaceActor actor = instanceBySpaceId.GetActor(actorId); if ((actor == null) || (actorByReferenceId == null)) { return; } CharacterInfo referenceObject = (CharacterInfo)actorByReferenceId.ReferenceObject; CharacterInfo info2 = (CharacterInfo)actor.ReferenceObject; if (actorByReferenceId.IsLocked || actor.IsLocked) { return; } actorByReferenceId.StopMoving(); actor.StopMoving(); if (SessionManager.GetSessionByCharacterId(actor.ReferenceId) == null) { return; } using (SqlDatabaseClient client = SqlDatabaseManager.GetClient()) { switch (actionId) { case 1: referenceObject.UpdateKisses(client, false); info2.UpdateKisses(client, true); actor.Lock(3, false, false); actorByReferenceId.Lock(3, false, false); goto Label_0165; case 2: referenceObject.UpdateCocktails(client, false); info2.UpdateCocktails(client, true); actor.Lock(9, false, false); actorByReferenceId.Lock(9, false, false); goto Label_0165; case 3: referenceObject.UpdateRoses(client, false); info2.UpdateRoses(client, true); actor.Lock(4, false, false); actorByReferenceId.Lock(4, false, false); goto Label_0165; } referenceObject.UpdateKisses(client, false); info2.UpdateKisses(client, true); actor.Lock(3, false, false); actorByReferenceId.Lock(3, false, false); } Label_0165: instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actorByReferenceId, actionId), 0, false); instanceBySpaceId.BroadcastMessage(SpaceUpdateUserStatistics.Compose(actor, actionId), 0, false); instanceBySpaceId.BroadcastMessage(SpaceUserAcceptInteract.Compose(actor, actorByReferenceId, actionId), 0, false); }