Exemple #1
0
 protected override void Start()
 {
     base.Start();
     attack = GetComponent <Attack>();
     am     = FindObjectOfType <AllegianceManager>();
     HookIntoLocalUISystems();
 }
Exemple #2
0
 void Start()
 {
     playerAtComputer = GameObject.FindGameObjectWithTag("Player");
     ut = FindObjectOfType <UnitTracker>();
     am = FindObjectOfType <AllegianceManager>();
     cm = FindObjectOfType <CityManager>();
 }
Exemple #3
0
 void Start()
 {
     am  = FindObjectOfType <AllegianceManager>();
     iff = transform.root.GetComponentInChildren <IFF>();
     am.AddFactionLeaderToList(iff.GetIFFAllegiance(), this);
     //Debug.Log(gameObject.name + " attempted to add an FL for allegiance: " + iff.GetIFFAllegiance());
 }
Exemple #4
0
        /// <summary>
        /// Optionally passes XP up the Allegiance tree
        /// </summary>
        private void UpdateXpAllegiance(long amount)
        {
            if (!HasAllegiance)
            {
                return;
            }

            AllegianceManager.PassXP(AllegianceNode, (ulong)amount, true);
        }
Exemple #5
0
 void Start()
 {
     am = FindObjectOfType <AllegianceManager>();
     sr = GetComponent <SpriteRenderer>();
     SelectCityName();
     SpawnHousesWithinCity(numberOfHousesToSpawn);
     ConvertHousesToTurrets();
     SetAllegianceForBuildingsInCity(iff.GetIFFAllegiance());
 }
Exemple #6
0
        /// <summary>
        /// Constructs a new Allegiance from a Monarch
        /// </summary>
        public Allegiance(IPlayer monarch)
        {
            Monarch = new AllegianceNode(monarch, this);

            // find all players with this monarch
            var members = AllegianceManager.FindAllPlayers(monarch);

            Monarch.BuildChain(this, members);
            BuildMembers(Monarch);

            //Console.WriteLine("TotalMembers: " + TotalMembers);
        }
Exemple #7
0
    // Start is called before the first frame update
    void Start()
    {
        srs = transform.root.GetComponentsInChildren <SpriteRenderer>();

        rb               = transform.root.GetComponentInChildren <Rigidbody2D>();
        hiderColl        = GetComponent <CircleCollider2D>();
        hiderColl.radius = hiderRadius_Base;
        cs               = transform.root.GetComponentInChildren <ControlSource>();
        iff              = transform.root.GetComponentInChildren <IFF>();
        am               = FindObjectOfType <AllegianceManager>();
        FadeOrTurnInvisible();
    }
Exemple #8
0
 private void SetFlag(int placeholder1, int placeholder2)
 {
     if (!flagSR)
     {
         return;
     }
     if (!am)
     {
         am = FindObjectOfType <AllegianceManager>();
     }
     flagSR.sprite = am.GetFlagOfAllegiance(iffAllegiance);
 }
Exemple #9
0
        /// <summary>
        /// Constructs a new Allegiance from a Monarch
        /// </summary>
        public void Init(ObjectGuid monarch)
        {
            Monarch = new AllegianceNode(monarch, this);

            // find all players with this monarch
            var members = AllegianceManager.FindAllPlayers(monarch);

            Monarch.BuildChain(this, members);
            BuildMembers(Monarch);

            //Console.WriteLine("TotalMembers: " + TotalMembers);
            BuildOfficers();

            ChatFilters = new Dictionary <ObjectGuid, DateTime>();
        }
Exemple #10
0
    public override void OnStartServer()
    {
        base.OnStartServer();
        iff = GetComponent <IFF>();
        am  = FindObjectOfType <AllegianceManager>();
        sr  = GetComponent <SpriteRenderer>();
        SelectCityName();
        iff.SetIFFAllegiance(IFF.feralIFF);
        SpawnHousesWithinCity(numberOfHousesToSpawn);
        SpawnTurretsWithinCity(numberOfTurretsToSpawn);
        timeSinceLastHouseCreation = UnityEngine.Random.Range(0, randomTimeBetweenHouseSpawn);
        //ConvertHousesToTurrets();

        //SetAllegianceForBuildingsInCity(IFF.feralIFF);
    }
Exemple #11
0
    private void Start()
    {
        if (TryGetComponent <SpriteRenderer>(out SpriteRenderer sr))
        {
            if (GetComponent <ControlSource>())
            {
                return;
            }                                               //things with a control source don't have an allegiance flag.
            flagSR = sr;
        }

        am = FindObjectOfType <AllegianceManager>();
        GetFlagUIElement();
        SetFlag();
    }
Exemple #12
0
 protected virtual void Start()
 {
     ut = FindObjectOfType <UnitTracker>();
     ut.AddUnitToTargetableList(gameObject);
     move     = GetComponentInChildren <Movement>();
     attack   = GetComponentInChildren <Attack>();
     targetGO = GameObject.FindGameObjectWithTag("Player");
     iff      = GetComponent <IFF>();
     cm       = FindObjectOfType <CityManager>();
     health   = GetComponentInChildren <Health>();
     am       = FindObjectOfType <AllegianceManager>();
     if (TryGetComponent <NavMeshAgent>(out nma))
     {
         nma.updateRotation = false;
     }
 }
Exemple #13
0
    void Start()
    {
        SceneManager.sceneLoaded -= OnSceneLoaded;
        SceneManager.sceneLoaded += OnSceneLoaded;

        sl     = FindObjectOfType <SceneLoader>();
        am     = FindObjectOfType <AllegianceManager>();
        player = GameObject.FindGameObjectWithTag("Player");
        if (!player)
        {
            player = Instantiate(playerPrefab, Vector3.zero, Quaternion.identity) as GameObject;
            if (SceneManager.GetActiveScene() == SceneManager.GetSceneByBuildIndex(1))  //for those development times where i start in Arena scene
            {
                Camera.main.GetComponentInChildren <CinemachineVirtualCamera>().Follow = player.transform;
            }
        }
    }
Exemple #14
0
 // Start is called before the first frame update
 void Start()
 {
     am = FindObjectOfType <AllegianceManager>();
     sl = FindObjectOfType <SceneLoader>();
     SetButtonFlags();
 }
        public static void TurbineChatReceived(ClientMessage clientMessage, Session session)
        {
            if (!PropertyManager.GetBool("use_turbine_chat").Item)
            {
                return;
            }

            clientMessage.Payload.ReadUInt32(); // Bytes to follow
            var chatBlobType = (ChatNetworkBlobType)clientMessage.Payload.ReadUInt32();

            clientMessage.Payload.ReadUInt32(); // Always 2
            clientMessage.Payload.ReadUInt32(); // Always 1
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Bytes to follow

            if (session.Player.IsGagged)
            {
                session.Player.SendGagError();
                return;
            }

            if (chatBlobType == ChatNetworkBlobType.NETBLOB_REQUEST_BINARY)
            {
                var contextId = clientMessage.Payload.ReadUInt32(); // 0x01 - 0x71 (maybe higher), typically though 0x01 - 0x0F
                clientMessage.Payload.ReadUInt32();                 // Always 2
                clientMessage.Payload.ReadUInt32();                 // Always 2
                var channelID = clientMessage.Payload.ReadUInt32();

                int messageLen = clientMessage.Payload.ReadByte();
                if ((messageLen & 0x80) > 0) // PackedByte
                {
                    byte lowbyte = clientMessage.Payload.ReadByte();
                    messageLen = ((messageLen & 0x7F) << 8) | lowbyte;
                }
                var messageBytes = clientMessage.Payload.ReadBytes(messageLen * 2);
                var message      = Encoding.Unicode.GetString(messageBytes);

                clientMessage.Payload.ReadUInt32(); // Always 0x0C
                var senderID = clientMessage.Payload.ReadUInt32();
                clientMessage.Payload.ReadUInt32(); // Always 0
                var chatType = (ChatType)clientMessage.Payload.ReadUInt32();

                if (channelID == TurbineChatChannel.Society)                                                             // shouldn't ever be hit
                {
                    ChatPacket.SendServerMessage(session, "You do not belong to a society.", ChatMessageType.Broadcast); // I don't know if this is how it was done on the live servers
                    return;
                }

                var gameMessageTurbineChat = new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_EVENT_BINARY, channelID, session.Player.Name, message, senderID, chatType);

                if (channelID > TurbineChatChannel.SocietyRadiantBlood) // Channel must be an allegiance channel
                {
                    var allegiance = AllegianceManager.FindAllegiance(channelID);
                    if (allegiance != null)
                    {
                        // is sender booted / gagged?
                        if (!allegiance.IsMember(session.Player.Guid))
                        {
                            return;
                        }
                        if (allegiance.IsFiltered(session.Player.Guid))
                        {
                            return;
                        }

                        // iterate through all allegiance members
                        foreach (var member in allegiance.Members.Keys)
                        {
                            // is this allegiance member online?
                            var online = PlayerManager.GetOnlinePlayer(member);
                            if (online == null)
                            {
                                continue;
                            }

                            // is this member booted / gagged?
                            if (allegiance.IsFiltered(member) || online.SquelchManager.Squelches.Contains(session.Player, ChatMessageType.Allegiance))
                            {
                                continue;
                            }

                            // does this player have allegiance chat filtered?
                            if (!online.GetCharacterOption(CharacterOption.ListenToAllegianceChat))
                            {
                                continue;
                            }

                            online.Session.Network.EnqueueSend(gameMessageTurbineChat);
                        }

                        session.Network.EnqueueSend(new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_RESPONSE_BINARY, contextId, null, null, 0, chatType));
                    }
                }
                else if (channelID > TurbineChatChannel.Society) // Channel must be a society restricted channel
                {
                    var senderSociety = session.Player.Society;

                    //var adjustedChatType = senderSociety switch
                    //{
                    //    FactionBits.CelestialHand => ChatType.SocietyCelHan,
                    //    FactionBits.EldrytchWeb => ChatType.SocietyEldWeb,
                    //    FactionBits.RadiantBlood => ChatType.SocietyRadBlo,
                    //    _ => ChatType.Society
                    //};

                    //gameMessageTurbineChat = new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_EVENT_BINARY, channelID, session.Player.Name, message, senderID, adjustedChatType);

                    if (senderSociety == FactionBits.None)
                    {
                        ChatPacket.SendServerMessage(session, "You do not belong to a society.", ChatMessageType.Broadcast); // I don't know if this is how it was done on the live servers
                        return;
                    }

                    foreach (var recipient in PlayerManager.GetAllOnline())
                    {
                        // handle filters
                        if (senderSociety != recipient.Society && !recipient.IsAdmin)
                        {
                            continue;
                        }

                        if (!recipient.GetCharacterOption(CharacterOption.ListenToSocietyChat))
                        {
                            continue;
                        }

                        if (recipient.SquelchManager.Squelches.Contains(session.Player, ChatMessageType.AllChannels))
                        {
                            continue;
                        }

                        recipient.Session.Network.EnqueueSend(gameMessageTurbineChat);
                    }

                    session.Network.EnqueueSend(new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_RESPONSE_BINARY, contextId, null, null, 0, chatType));
                }
                else if (channelID == TurbineChatChannel.Olthoi) // Channel must is the Olthoi play channel
                {
                    // todo: olthoi play chat (ha! yeah right...)
                }
                else // Channel must be one of the channels available to all players
                {
                    if (PropertyManager.GetBool("chat_echo_only").Item)
                    {
                        session.Network.EnqueueSend(gameMessageTurbineChat);
                        session.Network.EnqueueSend(new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_RESPONSE_BINARY, contextId, null, null, 0, chatType));
                        return;
                    }

                    if (PropertyManager.GetBool("chat_requires_account_15days").Item&& !session.Player.Account15Days)
                    {
                        if (PropertyManager.GetBool("chat_echo_reject").Item)
                        {
                            session.Network.EnqueueSend(gameMessageTurbineChat);
                        }

                        session.Network.EnqueueSend(new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_RESPONSE_BINARY, contextId, null, null, 0, chatType));
                        return;
                    }

                    var chat_requires_account_time_seconds = PropertyManager.GetLong("chat_requires_account_time_seconds").Item;
                    if (chat_requires_account_time_seconds > 0 && (DateTime.UtcNow - session.Player.Account.CreateTime).TotalSeconds < chat_requires_account_time_seconds)
                    {
                        if (PropertyManager.GetBool("chat_echo_reject").Item)
                        {
                            session.Network.EnqueueSend(gameMessageTurbineChat);
                        }

                        session.Network.EnqueueSend(new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_RESPONSE_BINARY, contextId, null, null, 0, chatType));
                        return;
                    }

                    var chat_requires_player_age = PropertyManager.GetLong("chat_requires_player_age").Item;
                    if (chat_requires_player_age > 0 && session.Player.Age < chat_requires_player_age)
                    {
                        if (PropertyManager.GetBool("chat_echo_reject").Item)
                        {
                            session.Network.EnqueueSend(gameMessageTurbineChat);
                        }

                        session.Network.EnqueueSend(new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_RESPONSE_BINARY, contextId, null, null, 0, chatType));
                        return;
                    }

                    var chat_requires_player_level = PropertyManager.GetLong("chat_requires_player_level").Item;
                    if (chat_requires_player_level > 0 && session.Player.Level < chat_requires_player_level)
                    {
                        if (PropertyManager.GetBool("chat_echo_reject").Item)
                        {
                            session.Network.EnqueueSend(gameMessageTurbineChat);
                        }

                        session.Network.EnqueueSend(new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_RESPONSE_BINARY, contextId, null, null, 0, chatType));
                        return;
                    }

                    foreach (var recipient in PlayerManager.GetAllOnline())
                    {
                        // handle filters
                        if (channelID == TurbineChatChannel.General && !recipient.GetCharacterOption(CharacterOption.ListenToGeneralChat) ||
                            channelID == TurbineChatChannel.Trade && !recipient.GetCharacterOption(CharacterOption.ListenToTradeChat) ||
                            channelID == TurbineChatChannel.LFG && !recipient.GetCharacterOption(CharacterOption.ListenToLFGChat) ||
                            channelID == TurbineChatChannel.Roleplay && !recipient.GetCharacterOption(CharacterOption.ListenToRoleplayChat))
                        {
                            continue;
                        }

                        if ((channelID == TurbineChatChannel.General && PropertyManager.GetBool("chat_disable_general").Item) ||
                            (channelID == TurbineChatChannel.Trade && PropertyManager.GetBool("chat_disable_trade").Item) ||
                            (channelID == TurbineChatChannel.LFG && PropertyManager.GetBool("chat_disable_lfg").Item) ||
                            (channelID == TurbineChatChannel.Roleplay && PropertyManager.GetBool("chat_disable_roleplay").Item))
                        {
                            if (PropertyManager.GetBool("chat_echo_reject").Item)
                            {
                                session.Network.EnqueueSend(gameMessageTurbineChat);
                            }

                            session.Network.EnqueueSend(new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_RESPONSE_BINARY, contextId, null, null, 0, chatType));
                            return;
                        }

                        if (recipient.SquelchManager.Squelches.Contains(session.Player, ChatMessageType.AllChannels))
                        {
                            continue;
                        }

                        recipient.Session.Network.EnqueueSend(gameMessageTurbineChat);
                    }

                    session.Network.EnqueueSend(new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_RESPONSE_BINARY, contextId, null, null, 0, chatType));
                }

                LogTurbineChat(channelID, session.Player.Name, message, senderID, chatType);
            }
            else
            {
                Console.WriteLine($"Unhandled TurbineChatHandler ChatNetworkBlobType: 0x{(uint)chatBlobType:X4}");
            }
        }
Exemple #16
0
 void Start()
 {
     am = FindObjectOfType <AllegianceManager>();
     am.AddFactionLeaderToList(masterIFFAllegiance, this);
 }
Exemple #17
0
 private void Awake()
 {
     instance = this;
 }
        public static void TurbineChatReceived(ClientMessage clientMessage, Session session)
        {
            if (!PropertyManager.GetBool("use_turbine_chat").Item)
            {
                return;
            }

            clientMessage.Payload.ReadUInt32(); // Bytes to follow
            var chatBlobType = (ChatNetworkBlobType)clientMessage.Payload.ReadUInt32();

            clientMessage.Payload.ReadUInt32(); // Always 2
            clientMessage.Payload.ReadUInt32(); // Always 1
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Bytes to follow

            if (session.Player.IsGagged)
            {
                session.Player.SendGagError();
                return;
            }

            if (chatBlobType == ChatNetworkBlobType.NETBLOB_REQUEST_BINARY)
            {
                var contextId = clientMessage.Payload.ReadUInt32(); // 0x01 - 0x71 (maybe higher), typically though 0x01 - 0x0F
                clientMessage.Payload.ReadUInt32();                 // Always 2
                clientMessage.Payload.ReadUInt32();                 // Always 2
                var channelID = clientMessage.Payload.ReadUInt32();

                int messageLen = clientMessage.Payload.ReadByte();
                if ((messageLen & 0x80) > 0) // PackedByte
                {
                    byte lowbyte = clientMessage.Payload.ReadByte();
                    messageLen = ((messageLen & 0x7F) << 8) | lowbyte;
                }
                var messageBytes = clientMessage.Payload.ReadBytes(messageLen * 2);
                var message      = Encoding.Unicode.GetString(messageBytes);

                clientMessage.Payload.ReadUInt32(); // Always 0x0C
                var senderID = clientMessage.Payload.ReadUInt32();
                clientMessage.Payload.ReadUInt32(); // Always 0
                var chatType = (ChatType)clientMessage.Payload.ReadUInt32();

                if (channelID == TurbineChatChannel.Society)
                {
                    ChatPacket.SendServerMessage(session, "You do not belong to a society.", ChatMessageType.Broadcast); // I don't know if this is how it was done on the live servers
                    return;
                }

                var gameMessageTurbineChat = new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_EVENT_BINARY, channelID, session.Player.Name, message, senderID, chatType);

                var allegiance = AllegianceManager.FindAllegiance(channelID);
                if (allegiance != null)
                {
                    // is sender booted / gagged?
                    if (allegiance.IsFiltered(session.Player.Guid))
                    {
                        return;
                    }

                    // iterate through all allegiance members
                    foreach (var member in allegiance.Members.Keys)
                    {
                        // is this allegiance member online?
                        var online = PlayerManager.GetOnlinePlayer(member);
                        if (online == null)
                        {
                            continue;
                        }

                        // is this member booted / gagged?
                        if (allegiance.IsFiltered(member) || online.SquelchManager.Squelches.Contains(session.Player, ChatMessageType.Allegiance))
                        {
                            continue;
                        }

                        // does this player have allegiance chat filtered?
                        if (!online.GetCharacterOption(CharacterOption.ListenToAllegianceChat))
                        {
                            continue;
                        }

                        online.Session.Network.EnqueueSend(gameMessageTurbineChat);
                    }
                }
                else
                {
                    foreach (var recipient in PlayerManager.GetAllOnline())
                    {
                        // handle filters
                        if (channelID == TurbineChatChannel.General && !recipient.GetCharacterOption(CharacterOption.ListenToGeneralChat) ||
                            channelID == TurbineChatChannel.Trade && !recipient.GetCharacterOption(CharacterOption.ListenToTradeChat) ||
                            channelID == TurbineChatChannel.LFG && !recipient.GetCharacterOption(CharacterOption.ListenToLFGChat) ||
                            channelID == TurbineChatChannel.Roleplay && !recipient.GetCharacterOption(CharacterOption.ListenToRoleplayChat) ||
                            channelID == TurbineChatChannel.Society && !recipient.GetCharacterOption(CharacterOption.ListenToSocietyChat))
                        {
                            continue;
                        }

                        if (recipient.SquelchManager.Squelches.Contains(session.Player, ChatMessageType.AllChannels))
                        {
                            continue;
                        }

                        recipient.Session.Network.EnqueueSend(gameMessageTurbineChat);
                    }

                    session.Network.EnqueueSend(new GameMessageTurbineChat(ChatNetworkBlobType.NETBLOB_RESPONSE_BINARY, contextId, null, null, 0, chatType));
                }
            }
            else
            {
                Console.WriteLine($"Unhandled TurbineChatHandler ChatNetworkBlobType: 0x{(uint)chatBlobType:X4}");
            }
        }
Exemple #19
0
        public static void TurbineChatReceived(ClientMessage clientMessage, Session session)
        {
            clientMessage.Payload.ReadUInt32(); // Bytes to follow
            var turbineChatType = (TurbineChatType)clientMessage.Payload.ReadUInt32();

            clientMessage.Payload.ReadUInt32(); // Always 2
            clientMessage.Payload.ReadUInt32(); // Always 1
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Always 0
            clientMessage.Payload.ReadUInt32(); // Bytes to follow

            if (turbineChatType == TurbineChatType.OutboundMessage)
            {
                clientMessage.Payload.ReadUInt32(); // 0x01 - 0x71 (maybe higher), typically though 0x01 - 0x0F
                clientMessage.Payload.ReadUInt32(); // Always 2
                clientMessage.Payload.ReadUInt32(); // Always 2
                var channelID = clientMessage.Payload.ReadUInt32();

                var messageLen   = clientMessage.Payload.ReadByte();
                var messageBytes = clientMessage.Payload.ReadBytes(messageLen * 2);
                var message      = Encoding.Unicode.GetString(messageBytes);

                clientMessage.Payload.ReadUInt32(); // Always 0x0C
                var senderID = clientMessage.Payload.ReadUInt32();
                clientMessage.Payload.ReadUInt32(); // Always 0
                clientMessage.Payload.ReadUInt32(); // Always 1 or 2

                if (channelID == TurbineChatChannel.Society)
                {
                    ChatPacket.SendServerMessage(session, "You do not belong to a society.", ChatMessageType.Broadcast); // I don't know if this is how it was done on the live servers
                    return;
                }

                var gameMessageTurbineChat = new GameMessageTurbineChat(TurbineChatType.InboundMessage, channelID, session.Player.Name, message, senderID);

                var allegiance = AllegianceManager.FindAllegiance(channelID);
                if (allegiance != null)
                {
                    // is sender booted / gagged?
                    if (allegiance.IsFiltered(session.Player.Guid))
                    {
                        return;
                    }

                    // iterate through all allegiance members
                    foreach (var member in allegiance.Members.Keys)
                    {
                        // is this allegiance member online?
                        var online = PlayerManager.GetOnlinePlayer(member);
                        if (online == null)
                        {
                            continue;
                        }

                        // is this member booted / gagged?
                        if (allegiance.IsFiltered(member) || online.Squelches.Contains(session.Player))
                        {
                            continue;
                        }

                        // does this player have allegiance chat filtered?
                        if (!online.GetCharacterOption(CharacterOption.ListenToAllegianceChat))
                        {
                            continue;
                        }

                        online.Session.Network.EnqueueSend(gameMessageTurbineChat);
                    }
                }
                else
                {
                    foreach (var recipient in PlayerManager.GetAllOnline())
                    {
                        // handle filters
                        if (channelID == TurbineChatChannel.General && !recipient.GetCharacterOption(CharacterOption.ListenToGeneralChat) ||
                            channelID == TurbineChatChannel.Trade && !recipient.GetCharacterOption(CharacterOption.ListenToTradeChat) ||
                            channelID == TurbineChatChannel.LFG && !recipient.GetCharacterOption(CharacterOption.ListenToLFGChat) ||
                            channelID == TurbineChatChannel.Roleplay && !recipient.GetCharacterOption(CharacterOption.ListentoRoleplayChat) ||
                            channelID == TurbineChatChannel.Society && !recipient.GetCharacterOption(CharacterOption.ListenToSocietyChat))
                        {
                            continue;
                        }

                        if (recipient.Squelches.Contains(session.Player))
                        {
                            continue;
                        }

                        recipient.Session.Network.EnqueueSend(gameMessageTurbineChat);
                    }
                }
            }
            else
            {
                Console.WriteLine($"Unhandled TurbineChatHandler TurbineChatType: 0x{(uint)turbineChatType:X4}");
            }
        }
Exemple #20
0
 private void Start()
 {
     am = FindObjectOfType <AllegianceManager>();
     SetFlag(0, 0);
 }
Exemple #21
0
        private void SetEphemeralValues()
        {
            BaseDescriptionFlags |= ObjectDescriptionFlag.Player;

            // This is the default send upon log in and the most common. Anything with a velocity will need to add that flag.
            PositionFlag |= UpdatePositionFlag.ZeroQx | UpdatePositionFlag.ZeroQy | UpdatePositionFlag.Contact | UpdatePositionFlag.Placement;

            CurrentMotionState = new UniversalMotion(MotionStance.NonCombat);

            // radius for object updates
            ListeningRadius = 5f;

            if (Session != null && Common.ConfigManager.Config.Server.Accounts.OverrideCharacterPermissions)
            {
                if (Session.AccessLevel == AccessLevel.Admin)
                {
                    IsAdmin = true;
                }
                if (Session.AccessLevel == AccessLevel.Developer)
                {
                    IsArch = true;
                }
                if (Session.AccessLevel == AccessLevel.Envoy)
                {
                    IsEnvoy = true;
                }
                // TODO: Need to setup and account properly for IsSentinel and IsAdvocate.
                // if (Session.AccessLevel == AccessLevel.Sentinel)
                //    character.IsSentinel = true;
                // if (Session.AccessLevel == AccessLevel.Advocate)
                //    character.IsAdvocate= true;
            }

            ContainerCapacity = 7;

            if (Session != null && (AdvocateQuest ?? false) && IsAdvocate) // Advocate permissions are per character regardless of override
            {
                if (Session.AccessLevel == AccessLevel.Player)
                {
                    Session.SetAccessLevel(AccessLevel.Advocate); // Elevate to Advocate permissions
                }
                if (AdvocateLevel > 4)
                {
                    IsPsr = true; // Enable AdvocateTeleport via MapClick
                }
            }

            UpdateCoinValue(false);

            if (Session != null && Session.IsOnline)
            {
                AllegianceManager.LoadPlayer(this);
            }

            QuestManager = new QuestManager(this);

            IsOnline = true;

            return; // todo

            /* todo fix for new EF model
             * TrackedContracts = new Dictionary<uint, ContractTracker>();
             * // Load the persisted tracked contracts into the working dictionary on player object.
             * foreach (var trackedContract in AceObject.TrackedContracts)
             * {
             *  ContractTracker loadContract = new ContractTracker(trackedContract.Value.ContractId, Guid.Full)
             *  {
             *      DeleteContract = trackedContract.Value.DeleteContract,
             *      SetAsDisplayContract = trackedContract.Value.SetAsDisplayContract,
             *      Stage = trackedContract.Value.Stage,
             *      TimeWhenDone = trackedContract.Value.TimeWhenDone,
             *      TimeWhenRepeats = trackedContract.Value.TimeWhenRepeats
             *  };
             *
             *  TrackedContracts.Add(trackedContract.Key, loadContract);
             * }*/

            LastUseTracker = new Dictionary <int, DateTime>();

            // =======================================
            // This code was taken from the old Load()
            // =======================================

            /*AceCharacter character;
             *
             * if (Common.ConfigManager.Config.Server.Accounts.OverrideCharacterPermissions)
             * {
             *  if (Session.AccessLevel == AccessLevel.Admin)
             *      character.IsAdmin = true;
             *  if (Session.AccessLevel == AccessLevel.Developer)
             *      character.IsArch = true;
             *  if (Session.AccessLevel == AccessLevel.Envoy)
             *      character.IsEnvoy = true;
             *  // TODO: Need to setup and account properly for IsSentinel and IsAdvocate.
             *  // if (Session.AccessLevel == AccessLevel.Sentinel)
             *  //    character.IsSentinel = true;
             *  // if (Session.AccessLevel == AccessLevel.Advocate)
             *  //    character.IsAdvocate= true;
             * }*/

            // FirstEnterWorldDone = false;

            // IsAlive = true;
        }