private void HandleRequestFriendCmd(CommandParser.Command param) { ulong gUID = 0uL; ulong.TryParse(param.GetParam(1), out gUID); MC2S_RequestFriend mC2S_RequestFriend = new MC2S_RequestFriend(); mC2S_RequestFriend.GUID = gUID; Globals.Instance.CliSession.Send(309, mC2S_RequestFriend); }
private void OnFriendClick(GameObject go) { Globals.Instance.EffectSoundMgr.Play("ui/ui_001"); if (this.mChatInfo == null) { return; } if (this.friendType == 1) { GameMessageBox gameMessageBox = GameMessageBox.ShowMessageBox(Singleton<StringManager>.Instance.GetString("friend_22", new object[] { this.mChatInfo.Name }), MessageBox.Type.OKCancel, this.mChatInfo); GameMessageBox expr_5E = gameMessageBox; expr_5E.OkClick = (MessageBox.MessageDelegate)Delegate.Combine(expr_5E.OkClick, new MessageBox.MessageDelegate(delegate(object obj) { if (Globals.Instance.Player.FriendSystem.IsFriend(this.mChatInfo.PlayerID)) { MC2S_RemoveFriend mC2S_RemoveFriend = new MC2S_RemoveFriend(); mC2S_RemoveFriend.GUID = this.mChatInfo.PlayerID; Globals.Instance.CliSession.Send(313, mC2S_RemoveFriend); } else { GameUIManager.mInstance.ShowMessageTipByKey("friend_33", 0f, 0f); } })); this.friendType = 0; } else if (this.mChatInfo.PlayerID == Globals.Instance.Player.Data.ID) { GameUIManager.mInstance.ShowMessageTipByKey("friend_30", 0f, 0f); } else { MC2S_RequestFriend mC2S_RequestFriend = new MC2S_RequestFriend(); mC2S_RequestFriend.GUID = this.mChatInfo.PlayerID; Globals.Instance.CliSession.Send(309, mC2S_RequestFriend); } this.EnablePersonalInfoLayer(false); }
private void OnFriendBtnClick(GameObject go) { if (this.mGuildMember != null) { if (this.friendType == 1) { if (this.mGuildMember.ID != Globals.Instance.Player.Data.ID) { GameMessageBox gameMessageBox = GameMessageBox.ShowMessageBox(Singleton<StringManager>.Instance.GetString("friend_22", new object[] { this.mGuildMember.Name }), MessageBox.Type.OKCancel, null); GameMessageBox expr_67 = gameMessageBox; expr_67.OkClick = (MessageBox.MessageDelegate)Delegate.Combine(expr_67.OkClick, new MessageBox.MessageDelegate(delegate(object obj) { MC2S_RemoveFriend mC2S_RemoveFriend = new MC2S_RemoveFriend(); mC2S_RemoveFriend.GUID = this.mGuildMember.ID; Globals.Instance.CliSession.Send(313, mC2S_RemoveFriend); })); } this.friendType = 0; } else if (this.mGuildMember.ID == Globals.Instance.Player.Data.ID) { GameUIManager.mInstance.ShowMessageTipByKey("friend_30", 0f, 0f); } else { MC2S_RequestFriend mC2S_RequestFriend = new MC2S_RequestFriend(); mC2S_RequestFriend.GUID = this.mGuildMember.ID; Globals.Instance.CliSession.Send(309, mC2S_RequestFriend); } GameUIPopupManager.GetInstance().PopState(true, null); } }
private void OnSubmitMsg() { if (string.IsNullOrEmpty(this.mUIInputMsg.value.Trim())) { GameUIManager.mInstance.ShowMessageTipByKey("friend_20", 0f, 0f); return; } if (Tools.GetLength(this.mUIInputMsg.value) > 12) { GameUIManager.mInstance.ShowMessageTipByKey("friend_21", 0f, 0f); return; } ulong num = 0uL; if (ulong.TryParse(this.mUIInputMsg.value, out num)) { if (num == Globals.Instance.Player.Data.AccountID) { GameUIManager.mInstance.ShowMessageTipByKey("friend_30", 0f, 0f); } else if (this.IsFriend(num, null)) { GameUIManager.mInstance.ShowMessageTipByKey("friend_35", 0f, 0f); } else { MC2S_RequestFriend mC2S_RequestFriend = new MC2S_RequestFriend(); mC2S_RequestFriend.AID = (int)num; Globals.Instance.CliSession.Send(309, mC2S_RequestFriend); } } else if (string.Compare(this.mUIInputMsg.value.Trim(), Globals.Instance.Player.Data.Name, true) == 0) { GameUIManager.mInstance.ShowMessageTipByKey("friend_30", 0f, 0f); } else if (this.IsFriend(0uL, this.mUIInputMsg.value.Trim())) { GameUIManager.mInstance.ShowMessageTipByKey("friend_35", 0f, 0f); } else { MC2S_RequestFriend mC2S_RequestFriend2 = new MC2S_RequestFriend(); mC2S_RequestFriend2.GUID = 0uL; mC2S_RequestFriend2.Name = this.mUIInputMsg.value.Trim(); Globals.Instance.CliSession.Send(309, mC2S_RequestFriend2); } this.mUIInputMsg.value = string.Empty; this.CloseAll(); }
public void SendRequestFriend(ulong id, string name) { if (this.IsFriend(id)) { GameUIManager.mInstance.ShowMessageTip(Singleton<StringManager>.Instance.GetString("friend_18", new object[] { name }), 0f, 0f); return; } MC2S_RequestFriend mC2S_RequestFriend = new MC2S_RequestFriend(); mC2S_RequestFriend.GUID = id; Globals.Instance.CliSession.Send(309, mC2S_RequestFriend); }