Esempio n. 1
0
        void PacketHandler_ReceivedLoginUnsuccessful(ClientPacketHandler sender, ClientPacketHandlerEventArgs <string> e)
        {
            // Show the login screen
            ScreenManager.ActiveScreen = this;

            // Display the message
            SetError(e.Args);
        }
Esempio n. 2
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ClientSockets"/> class.
        /// </summary>
        /// <param name="screenManager">The <see cref="IScreenManager"/> instance.</param>
        /// <exception cref="MethodAccessException">An instance of this object has already been created.</exception>
        ClientSockets(IScreenManager screenManager) : base(CommonConfig.NetworkAppIdentifier)
        {
            if (_instance != null)
                throw new MethodAccessException("ClientSockets instance was already created. Use that instead.");

            _screenManager = screenManager;
            _packetHandler = new ClientPacketHandler(this, ScreenManager, DynamicEntityFactory.Instance);

            // When debugging, use the StatMessageProcessorManager instead (same thing as the other, but provides network statistics)
#if DEBUG
            var m = new StatMessageProcessorManager(_packetHandler, EnumHelper<ServerPacketID>.BitsRequired);
            m.Stats.EnableFileOutput(ContentPaths.Build.Root.Join("netstats_in" + EngineSettings.DataFileSuffix));
            _messageProcessorManager = m;
#else
            _messageProcessorManager = new MessageProcessorManager(_packetHandler, EnumHelper<ServerPacketID>.BitsRequired);
#endif
        }
Esempio n. 3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ClientSockets"/> class.
        /// </summary>
        /// <param name="screenManager">The <see cref="IScreenManager"/> instance.</param>
        /// <exception cref="MethodAccessException">An instance of this object has already been created.</exception>
        ClientSockets(IScreenManager screenManager) : base(CommonConfig.NetworkAppIdentifier)
        {
            if (_instance != null)
            {
                throw new MethodAccessException("ClientSockets instance was already created. Use that instead.");
            }

            _screenManager = screenManager;
            _packetHandler = new ClientPacketHandler(this, ScreenManager, DynamicEntityFactory.Instance);

            // When debugging, use the StatMessageProcessorManager instead (same thing as the other, but provides network statistics)
#if DEBUG
            var m = new StatMessageProcessorManager(_packetHandler, EnumHelper <ServerPacketID> .BitsRequired);
            m.Stats.EnableFileOutput(ContentPaths.Build.Root.Join("netstats_in" + EngineSettings.DataFileSuffix));
            _messageProcessorManager = m;
#else
            _messageProcessorManager = new MessageProcessorManager(_packetHandler, EnumHelper <ServerPacketID> .BitsRequired);
#endif
        }
Esempio n. 4
0
        void PacketHandler_ReceivedLoginUnsuccessful(ClientPacketHandler sender, ClientPacketHandlerEventArgs<string> e)
        {
            // Show the login screen
            ScreenManager.ActiveScreen = this;

            // Display the message
            SetError(e.Args);
        }
Esempio n. 5
0
 void PacketHandler_ReceivedLoginSuccessful(ClientPacketHandler sender, ClientPacketHandlerEventArgs e)
 {
     // Show the character selection screen
     ScreenManager.SetScreen<CharacterSelectionScreen>();
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ObjGrabber"/> class.
 /// </summary>
 /// <param name="cph">The <see cref="ClientPacketHandler"/>.</param>
 public ObjGrabber(ClientPacketHandler cph)
 {
     _parent = cph;
 }
Esempio n. 7
0
 void PacketHandler_ReceivedLoginSuccessful(ClientPacketHandler sender, ClientPacketHandlerEventArgs e)
 {
     // Show the character selection screen
     ScreenManager.SetScreen <CharacterSelectionScreen>();
 }