//发送聊天信息 public void SendTalkMessage(string msg) { string currStr = GameMethod.GetSplitStr(msg); byte[] utf8Bytes = Encoding.UTF8.GetBytes(currStr); CGLCtrl_GameLogic.Instance.EmsgToss_AskSendRoomTalk((UInt32)utf8Bytes.Length * sizeof(byte), utf8Bytes); }
private void SendChatPress(GameObject go) { //chatta if (string.Compare(str, GameUserModel.Instance.GameUserNick) == 0) { MsgInfoManager.Instance.ShowMsg(10028); return; } if (MsgInfo.label.text.CompareTo(str) == 0 || string.IsNullOrEmpty(MsgInfo.value)) { MsgInfoManager.Instance.ShowMsg(-16); return; } if (mLastTemp == 0) { //Debug.LogError("接受消息对象不能为空"); MsgInfoManager.Instance.ShowMsg(10027); return; } Friend friend = null; if (FriendManager.Instance.AllFriends.TryGetValue(mLastTemp, out friend)) { if (!friend.isOnline) { MsgInfoManager.Instance.ShowMsg(-130846); return; } } if (friend == null) { return; } string currStr = GameMethod.GetSplitStr(MsgInfo.value); byte[] utf8Bytes = Encoding.UTF8.GetBytes(currStr); ViableTalk(currStr); MsgInfo.value = ""; ChatTaskCtrl.Instance.SendMsg(mLastTemp, (UInt32)utf8Bytes.Length, utf8Bytes); }