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]); } } }
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); }
public void Init(MyObjectBuilder_GlobalChatItem chatBuilder) { Text = chatBuilder.Text; IdentityId = MyEntityIdentifier.ConstructId(MyEntityIdentifier.ID_OBJECT_TYPE.IDENTITY, chatBuilder.IdentityIdUniqueNumber); }