private void LabourUnionChatToggleEvent(bool IsOn) { chatType[2].interactable = !IsOn; if (!IsOn) { return; } worldChat.gameObject.SetActive(false); privateChat.gameObject.SetActive(false); labourUnionChat.gameObject.SetActive(true); chatScrollView.gameObject.SetActive(false); chatBottom.gameObject.SetActive(false); worldText.color = Color.gray; privateChatText.color = Color.gray; labourUnionText.color = Color.white; currentChatTag = ChatTag.UnionChat; controller.SendRelationList(); hornButton.interactable = false; }
private void WorldToggleEvent(bool IsOn) { chatType[0].interactable = !IsOn; if (!IsOn) { return; } worldChat.gameObject.SetActive(true); privateChat.gameObject.SetActive(false); labourUnionChat.gameObject.SetActive(false); chatBottom.gameObject.SetActive(true); worldText.color = Color.white; privateChatText.color = Color.gray; labourUnionText.color = Color.gray; currentChatTag = ChatTag.WorldChat; controller.SendRelationList(); hornButton.interactable = true; ResfresChatItemData(controller.GetWorldChatDataList()); }
/// <summary> /// Creates a packet /// </summary> public static RealmPacketOut CreateChatPacket(ChatMsgType type, ChatLanguage language, string msg, ChatTag tag) { var packet = new RealmPacketOut(RealmServerOpCode.SMSG_MESSAGECHAT, 23 + msg.Length); packet.WriteByte((byte)type); // 1 packet.WriteUInt((uint)language); // 5 packet.WriteUIntPascalString(msg); // 22 + msg.Length packet.WriteByte((byte)tag); // 23 + msg.Length return packet; }
private void PrivateChatToggleEvent(bool IsOn) { chatType[1].interactable = !IsOn; if (!IsOn) { return; } worldChat.gameObject.SetActive(false); privateChat.gameObject.SetActive(true); labourUnionChat.gameObject.SetActive(false); chatScrollView.gameObject.SetActive(false); worldText.color = Color.gray; privateChatText.color = Color.white; labourUnionText.color = Color.gray; currentChatTag = ChatTag.PrivateChat; List <FriendInfo> data = controller.GetMyFriendData(); if (data.Count > 0) { privateChatBg.gameObject.SetActive(true); chatBottom.gameObject.SetActive(true); ResfresMyFriendItemData(controller.GetMyFriendData(), data[0].friendId); } else { privateChatBg.gameObject.SetActive(false); chatBottom.gameObject.SetActive(false); } hornButton.interactable = false; }
/// <summary> /// Creates a chat message packet for a player. /// </summary> /// <param name="type">the type of chat message</param> /// <param name="language">the language the message is in</param> /// <param name="id1">the ID of the chatter</param> /// <param name="id2">the ID of the receiver</param> /// <param name="target">the target or null (if its an area message)</param> /// <param name="msg">the message itself</param> /// <param name="tag">the chat tag of the chatter</param> /// <returns>Might return null</returns> private static RealmPacketOut CreateCharChatMessage(ChatMsgType type, ChatLanguage language, EntityId id1, EntityId id2, string target, string msg, ChatTag tag) { var packet = new RealmPacketOut(RealmServerOpCode.SMSG_MESSAGECHAT); packet.Write((byte)type); packet.Write((uint)language); packet.Write(id1); packet.Write(0); if (target != null) packet.WriteUIntPascalString(target); packet.Write(id2); packet.WriteUIntPascalString(msg); packet.Write((byte)tag); return packet; }
/// <summary> /// Creates a chat message packet for a player. /// </summary> /// <param name="type">the type of chat message</param> /// <param name="language">the language the message is in</param> /// <param name="id1">the ID of the chatter</param> /// <param name="id2">the ID of the receiver</param> /// <param name="target">the target or null (if its an area message)</param> /// <param name="msg">the message itself</param> /// <param name="tag">the chat tag of the chatter</param> private static RealmPacketOut CreateCharChatMessage(ChatMsgType type, ChatLanguage language, IEntity id1, IEntity id2, string target, string msg, ChatTag tag) { return CreateCharChatMessage(type, language, id1.EntityId, id2.EntityId, target, msg, tag); }
/// <summary> /// Creates a chat message packet for a non-player object. /// </summary> /// <param name="type">the type of chat message</param> /// <param name="language">the language the message is in</param> /// <param name="obj">the object "saying" the message</param> /// <param name="msg">the message itself</param> /// <param name="tag">any chat tags for the object</param> /// <returns>the generated chat packet</returns> private static RealmPacketOut CreateObjectChatMessage(ChatMsgType type, ChatLanguage language, INamedEntity obj, string msg, ChatTag tag) { var packet = CreateObjectChatMessage(type, language, obj); //packet.Write(obj.EntityId); packet.WriteUIntPascalString(msg); // 30 + nameLength + msg.Length packet.Write((byte)tag); // 31 + ... return packet; }
/// <summary> /// Creates a chat message packet for a player. /// </summary> /// <param name="type">the type of chat message</param> /// <param name="language">the language the message is in</param> /// <param name="id1">the ID of the chatter</param> /// <param name="id2">the ID of the receiver</param> /// <param name="target">the target or null (if its an area message)</param> /// <param name="msg">the message itself</param> /// <param name="tag">the chat tag of the chatter</param> /// <returns>Might return null</returns> private static RealmPacketOut CreateCharChatMessage(ChatMsgType type, ChatLanguage language, EntityId id1, EntityId id2, string target, string msg, ChatTag tag) { var packet = new RealmPacketOut(RealmServerOpCode.SMSG_MESSAGECHAT); packet.Write((byte)type); packet.Write((uint)language); packet.Write(id1); packet.Write(0); if (target != null) { packet.WriteUIntPascalString(target); } packet.Write(id2); packet.WriteUIntPascalString(msg); packet.Write((byte)tag); return(packet); }
/// <summary> /// Creates a chat message packet for a player. /// </summary> /// <param name="type">the type of chat message</param> /// <param name="language">the language the message is in</param> /// <param name="id1">the ID of the chatter</param> /// <param name="id2">the ID of the receiver</param> /// <param name="target">the target or null (if its an area message)</param> /// <param name="msg">the message itself</param> /// <param name="tag">the chat tag of the chatter</param> private static RealmPacketOut CreateCharChatMessage(ChatMsgType type, ChatLanguage language, IEntity id1, IEntity id2, string target, string msg, ChatTag tag) { return(CreateCharChatMessage(type, language, id1.EntityId, id2.EntityId, target, msg, tag)); }
/// <summary> /// Creates a chat message packet for a non-player object. /// </summary> /// <param name="type">the type of chat message</param> /// <param name="language">the language the message is in</param> /// <param name="obj">the object "saying" the message</param> /// <param name="msg">the message itself</param> /// <param name="tag">any chat tags for the object</param> /// <returns>the generated chat packet</returns> private static RealmPacketOut CreateObjectChatMessage(ChatMsgType type, ChatLanguage language, INamedEntity obj, string msg, ChatTag tag) { var packet = CreateObjectChatMessage(type, language, obj); //packet.Write(obj.EntityId); packet.WriteUIntPascalString(msg); // 30 + nameLength + msg.Length packet.Write((byte)tag); // 31 + ... return(packet); }
/// <summary> /// Creates a chat message packet for a player. /// </summary> /// <param name="type">the type of chat message</param> /// <param name="language">the language the message is in</param> /// <param name="id1">the ID of the chatter</param> /// <param name="id2">the ID of the receiver</param> /// <param name="target">the target or null (if its an area message)</param> /// <param name="msg">the message itself</param> /// <param name="tag">the chat tag of the chatter</param> /// <returns>Might return null</returns> private static RealmPacketOut CreateCharChatMessage(ChatMsgType type, ChatLanguage language, EntityId id1, EntityId id2, string target, string msg, ChatTag tag) { return(CreateGlobalChatMessage("??", msg, Color.Red, Locale.En)); }
/// <summary> /// Creates a packet /// </summary> public static RealmPacketOut CreateChatPacket(ChatMsgType type, ChatLanguage language, string msg, ChatTag tag) { var packet = new RealmPacketOut(RealmServerOpCode.SMSG_MESSAGECHAT, 23 + msg.Length); packet.WriteByte((byte)type); // 1 packet.WriteUInt((uint)language); // 5 packet.WriteUIntPascalString(msg); // 22 + msg.Length packet.WriteByte((byte)tag); // 23 + msg.Length return(packet); }