Example #1
0
 /// <summary>
 /// Creates a new connection instance.
 /// </summary>
 /// <param name="messagingSettings">Qbes messaging configuration
 /// node</param>
 /// <param name="connection">NetConnection object</param>
 /// <param name="callback">Callback for completed received multipart
 /// messages</param>
 public Connection(MessagingConfiguration messagingSettings, NetConnection connection, CompletedReceivedMultipartMessage callback)
 {
     _MaxMessageSize = messagingSettings.MaxMessageSize;
      _Connection = connection;
      _RemoteEndPoint = connection.RemoteEndPoint;
      _CompletedReceivedMultipartCallback = callback;
 }
Example #2
0
 /// <summary>
 /// Creates a default configuration instance.
 /// </summary>
 public NetworkConfiguration()
 {
     AutoConnect = DefaultAutoConnect;
      IpAddress = DefaultIpAddress;
      Messaging = new MessagingConfiguration();
      PlayerName = Environment.UserName;
      PortUdp = DefaultPortUdp;
      PortTcp = DefaultPortTcp;
 }
Example #3
0
 /// <summary>
 /// Creates an instance with default settings.
 /// </summary>
 public NetworkConfiguration()
 {
     InitialMSPerKBSendTimeout = DefaultInitialMSPerKBSendTimeout;
      MaxConnections = DefaultMaxConnections;
      MaxTerrainBatchSize = DefaultMaxTerrainBatchSize;
      Messaging = new MessagingConfiguration();
      PortUdp = DefaultPortUdp;
      PortTcp = DefaultPortTcp;
      Web = new WebConfiguration();
 }
Example #4
0
        internal void Start(MessagingConfiguration messagingSettings, IPEndPoint remoteEndPoint)
        {
            NetworkComms.AppendGlobalIncomingPacketHandler<byte[]>(Connection.TcpByteMessageName, ReceivedMessageTcpBytes);
             NetworkComms.AppendGlobalIncomingPacketHandler<string>("Message", ReceivedMessageTcpString);
             ConnectionInfo connectionInfo = new ConnectionInfo(ClientWorldManager.Instance.Configuration.Network.IpAddress, ClientWorldManager.Instance.Configuration.Network.PortTcp);
             _ClientTcp = TCPConnection.GetConnection(connectionInfo, true);

             _Client.Start();
             _Connection = new Connection(messagingSettings, _Client.Connect(remoteEndPoint), MultiPlayerProvider.ServerToClientProvider.ProcessReceivedMessage);
             _Connection.TcpConnection = _ClientTcp;
        }
Example #5
0
 public static void SetMessagingConfiguration(MessagingConfiguration config)
 {
     _MessagingConfiguration = config;
 }