Пример #1
0
 public Networking(IEngineServer engineServer, IGlobalVars globals, IEngineModel engineModel, IEntityDictionary entityDictionary, ITrace trace)
 {
     EngineServer     = engineServer ?? throw new ArgumentNullException(nameof(engineServer));
     Globals          = globals ?? throw new ArgumentNullException(nameof(globals));
     EngineModel      = engineModel ?? throw new ArgumentNullException(nameof(engineModel));
     EntityDictionary = entityDictionary ?? throw new ArgumentNullException(nameof(entityDictionary));
     Trace            = trace ?? throw new ArgumentNullException(nameof(trace));
 }
Пример #2
0
 public int EnterGame(Guid gameId, Client c)
 {
     if (!string.IsNullOrEmpty(serverPath))
     {
         try
         {
             ChannelFactory<IEngineServer> pipeFactory = new ChannelFactory<IEngineServer>(new NetNamedPipeBinding(), new EndpointAddress(serverPath));
             serverProxy = pipeFactory.CreateChannel();
             return serverProxy.EnterGame(gameId, c);
         }
         catch (Exception ex)
         {
             Log.Error(ex);
         }
     }
     return -1;
 }