示例#1
0
 public void Init(MyObjectBuilder_FactionChatItem chatBuilder)
 {
     Text            = chatBuilder.Text;
     IdentityId      = MyEntityIdentifier.ConstructId(MyEntityIdentifier.ID_OBJECT_TYPE.IDENTITY, chatBuilder.IdentityIdUniqueNumber);
     Timestamp       = TimeSpan.FromMilliseconds(chatBuilder.TimestampMs);
     PlayersToSendTo = new Dictionary <long, bool>();
     if (chatBuilder.PlayersToSendToUniqueNumber != null && chatBuilder.PlayersToSendToUniqueNumber.Count != 0)
     {
         for (int i = 0; i < chatBuilder.PlayersToSendToUniqueNumber.Count; i++)
         {
             PlayersToSendTo.Add(MyEntityIdentifier.ConstructId(MyEntityIdentifier.ID_OBJECT_TYPE.IDENTITY, chatBuilder.PlayersToSendToUniqueNumber[i]), chatBuilder.IsAlreadySentTo[i]);
         }
     }
 }
示例#2
0
 public void Init(MyObjectBuilder_GlobalChatItem chatBuilder)
 {
     Text       = chatBuilder.Text;
     AuthorFont = chatBuilder.Font;
     if (chatBuilder.IdentityIdUniqueNumber == 0)
     {
         IdentityId = 0;
         Author     = chatBuilder.Author;
     }
     else
     {
         IdentityId = MyEntityIdentifier.ConstructId(MyEntityIdentifier.ID_OBJECT_TYPE.IDENTITY, chatBuilder.IdentityIdUniqueNumber);
         Author     = "";
     }
 }
        private static void OnFactionMessageSuccess(MySyncCharacter sync, ref SendNewFactionMessageMsg msg, MyNetworkClient sender)
        {
            long senderIdentityId = MyEntityIdentifier.ConstructId(MyEntityIdentifier.ID_OBJECT_TYPE.IDENTITY, msg.ChatItem.IdentityIdUniqueNumber);

            var factionChatItem = new MyFactionChatItem();

            factionChatItem.Init(msg.ChatItem);
            if (!(Sync.IsServer && senderIdentityId != MySession.LocalPlayerId))
            {
                MyChatSystem.AddFactionChatItem(MySession.LocalPlayerId, msg.FactionId1, msg.FactionId2, factionChatItem);
            }
            if (senderIdentityId != MySession.LocalPlayerId)
            {
                MySession.Static.Gpss.ScanText(factionChatItem.Text, MyTexts.GetString(MySpaceTexts.TerminalTab_GPS_NewFromFactionComms));
            }
            MySession.Static.ChatSystem.OnNewFactionMessage(msg.FactionId1, msg.FactionId2, senderIdentityId, true);
        }
示例#4
0
 public void Init(MyObjectBuilder_GlobalChatItem chatBuilder)
 {
     Text       = chatBuilder.Text;
     IdentityId = MyEntityIdentifier.ConstructId(MyEntityIdentifier.ID_OBJECT_TYPE.IDENTITY, chatBuilder.IdentityIdUniqueNumber);
 }