Hii,I need to send from a C# application the position of several aircrafts to a 
flight gear multiplayer server; in order to write the mentioned C# app I have 
ported the T_MsgHdr and T_PositionMsg structures from mpmessages.h. (see end of 
message)
The first time I send a position msg to server a new client is added correctly 
and a chat msg is sent to flight gear instance with the following text
Test is now online, using
Aircraft/Dragonfly/Models/Dragonfly.xml

The problem is that the new pilot (Test) is not listed in pilot list.
I hope that someone can help me with this issue.Regards
Marco
P.S Please note that I am a newbie with fg devel :-D


the following structs are ported from mpmessages.h

 // Header for use with all messages sent     
[StructLayout(LayoutKind.Explicit, Pack = 1)]    public struct T_MsgHdr    {    
    [FieldOffset(0)]        public uint Magic;                  // Magic Value  
      [FieldOffset(4)]        public uint Version;                // Protocol 
version        [FieldOffset(8)]        public uint MsgId;                  // 
Message identifier         [FieldOffset(12)]        public uint MsgLen;         
        // absolute length of message        [FieldOffset(16)]        public 
uint ReplyAddress;           // (player's receiver address        
[FieldOffset(20)]        public uint ReplyPort;              // player's 
receiver port        [FieldOffset(24)]        
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 8)]        public String 
Callsign;               // Callsign used by the player    };
    /// <summary>    /// Position message    /// </summary>    
[StructLayout(LayoutKind.Explicit, Pack = 1)]    public struct T_PositionMsg    
{        [FieldOffset(0)]        [MarshalAs(UnmanagedType.ByValTStr, SizeConst 
= 96)]        public String Model;    // Name of the aircraft model
        [FieldOffset(96)]        // Time when this packet was generated        
public ulong time;        [FieldOffset(104)]        public ulong lag;
        // position wrt the earth centered frame        [FieldOffset(112)]      
  public ulong position_x;        [FieldOffset(120)]        public ulong 
position_y;        [FieldOffset(128)]        public ulong position_z;        // 
orientation wrt the earth centered frame, stored in the angle axis        // 
representation where the angle is coded into the axis length        
[FieldOffset(136)]        public uint orientation_x;        [FieldOffset(140)]  
      public uint orientation_y;        [FieldOffset(144)]        public uint 
orientation_z;
        // linear velocity wrt the earth centered frame measured in        // 
the earth centered frame        [FieldOffset(148)]        public uint 
linearVel_x;        [FieldOffset(152)]        public uint linearVel_y;        
[FieldOffset(156)]        public uint linearVel_z;        // angular velocity 
wrt the earth centered frame measured in        // the earth centered frame     
   [FieldOffset(160)]        public uint angularVel_x;        
[FieldOffset(164)]        public uint angularVel_Y;        [FieldOffset(168)]   
     public uint angularVel_z;
        // linear acceleration wrt the earth centered frame measured in        
// the earth centered frame        [FieldOffset(172)]        public uint 
linearAccel_x;        [FieldOffset(176)]        public uint linearAccel_y;      
  [FieldOffset(180)]        public uint linearAccel_z;        // angular 
acceleration wrt the earth centered frame measured in        // the earth 
centered frame        [FieldOffset(184)]        public uint angularAccel_x;     
   [FieldOffset(188)]        public uint angularAccel_y;        
[FieldOffset(192)]        public uint angularAccel_z;        // Padding. The 
alignment is 8 bytes on x86_64 because there are        // 8-byte types in the 
message, so the size should be explicitly        // rounded out to a multiple 
of 8. Of course, it's a bad idea to        // put a C struct directly on the 
wire, but that's a fight for        // another day...        //UInt32 pad;    };
_________________________________________________________________
Messenger è su Hotmail. Scopri le novità.
http://www.messenger.it/accediWebMessengerHotmail.aspx
------------------------------------------------------------------------------
Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day 
trial. Simplify your report design, integration and deployment - and focus on 
what you do best, core application coding. Discover what's new with 
Crystal Reports now.  http://p.sf.net/sfu/bobj-july
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to