コード例 #1
0
 public ClientPPLocator(EventHandlersOnClient handlers, IDOManager dOManager)
 {
     EventFactoryOnClient factory = new EventFactoryOnClient();
     ILogger logger = LightweightContainer.LogFactory.Create(typeof (ProtocolProcessor));
     processor = new ProtocolProcessor(ProtocolInfo.Instance.Name, factory, handlers, dOManager, logger);
 }
コード例 #2
0
        public void Startup()
        {
            handlers = new EventHandlersOnClient();
            handlers.ConnectionTest += Handlers_OnConnectionTest;
            handlers.LogOnACK += Handlers_OnGetLogOnACK;

            communicator.InjectProcessorLocator(new ClientPPLocator(handlers, dOManager)); // inject manually
            communicator.RegisterRakNetEventHandler(RakNetMessageId.ConnectionRequestAccepted, ConnectionRequestAccepted);
            communicator.Startup();
            communicator.Connect();
        }