object OnPlayerChat(ConsoleSystem.Arg arg) { BasePlayer player = (BasePlayer)arg.connection.player; string message = arg.GetString(0, "text"); if (stickies.Any(x => x.Key.userID == player.userID && x.Value.type == ChatType.CLAN)) { clanLib.Call("cmdChatClanchat", player, "", new string[] { message }); return(false); } else if (stickies.Any(x => x.Key.userID == player.userID && x.Value.type == ChatType.REPLY)) { pmLib.Call("cmdPmReply", player, "", new string[] { message }); return(false); } else if (stickies.Any(x => x.Key.userID == player.userID && x.Value.type == ChatType.PRIVATE)) { StickyInfo result = (from el in stickies where el.Key.userID == player.userID && el.Value.type == ChatType.PRIVATE select el.Value).First(); pmLib.Call("cmdPm", player, "", new string[] { result.details, message }); return(false); } return(null); }
private object OnUserChat(IPlayer player, string message) { if (stickies.Any(x => x.Key.Id == player.Id && x.Value.type == ChatType.CLAN)) { if (!bcLib) { clanLib.Call("cmdChatClanchat", players.FindPlayerById(player.Id)?.Object as BasePlayer, "", new string[] { message }); clanLib.Call("cmdClanChat", player.Id, "", new string[] { message }); } return(false); } else if (stickies.Any(x => x.Key.Id == player.Id && x.Value.type == ChatType.REPLY)) { if (!bcLib) { pmLib.Call("cmdPmReply", players.FindPlayerById(player.Id)?.Object as BasePlayer, "", new string[] { message }); } return(false); } else if (stickies.Any(x => x.Key.Id == player.Id && x.Value.type == ChatType.PRIVATE)) { if (!bcLib) { StickyInfo result = (from el in stickies where el.Key.Id == player.Id && el.Value.type == ChatType.PRIVATE select el.Value).First(); pmLib.Call("cmdPm", players.FindPlayerById(player.Id)?.Object as BasePlayer, "", new string[] { result.details, message }); } return(false); } return(null); }
private object OnBetterChat(Dictionary <string, object> messageData) { IPlayer player = (IPlayer)messageData["Player"]; string message = (string)messageData["Text"]; if (stickies.Any(x => x.Key.Id == player.Id && x.Value.type == ChatType.CLAN)) { clanLib.Call("cmdChatClanchat", players.FindPlayerById(player.Id)?.Object as BasePlayer, "", new string[] { message }); clanLib.Call("cmdClanChat", player, "", new string[] { message }); return(false); } else if (stickies.Any(x => x.Key.Id == player.Id && x.Value.type == ChatType.REPLY)) { pmLib.Call("cmdPmReply", players.FindPlayerById(player.Id)?.Object as BasePlayer, "", new string[] { message }); return(false); } else if (stickies.Any(x => x.Key.Id == player.Id && x.Value.type == ChatType.PRIVATE)) { StickyInfo result = (from el in stickies where el.Key.Id == player.Id && el.Value.type == ChatType.PRIVATE select el.Value).First(); pmLib.Call("cmdPm", players.FindPlayerById(player.Id)?.Object as BasePlayer, "", new string[] { result.details, message }); return(false); } return(null); }
private int PlayerStickyState(BasePlayer player) { if (stickies.Any(x => x.Key.userID == player.userID)) { StickyInfo result = (from el in stickies where el.Key.userID == player.userID select el.Value).First(); return(Convert.ToInt32(result.type)); } return(0); }
private void SendStickyHandler(StickyInfo stick) { try { Message mess = new Message(); mess.IDSender = User.UserID; mess.IDReceiver = _selected.User.UserID; mess.Type = eMessageType.Sticky; mess.Content = stick.FilePath; Out.SendTextMessage(mess); _selected.Messages.Add(mess); EffectSound = SentSoundEffect; } catch (Exception ex) { messagerService.ShowError(ex, "Exception", "OK", null); } }