public void SendMessage(string msg, eChatType type, eChatLoc loc) { if (log.IsDebugEnabled) { log.Debug(string.Format("({0}, {1}): {2}", type, loc, msg)); } }
/// <summary> /// Send Raw Message to all group members. /// </summary> /// <param name="msg">message string</param> /// <param name="type">message type</param> /// <param name="loc">message location</param> public virtual void SendMessageToGroupMembers(string msg, eChatType type, eChatLoc loc) { foreach (GamePlayer player in GetPlayersInTheGroup()) { player.Out.SendMessage(msg, type, loc); } }
public override void SendMessage(string msg, eChatType type, eChatLoc loc) { if (m_gameClient.ClientState == GameClient.eClientState.CharScreen) { return; } GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.Message)); pak.WriteByte((byte)type); string str; if (loc == eChatLoc.CL_ChatWindow) { str = "@@"; } else if (loc == eChatLoc.CL_PopupWindow) { str = "##"; } else { str = ""; } pak.WriteString(str + msg); SendTCP(pak); }
protected static int MakeSaySequence(RegionTimer callingTimer) { m_sayTimerQueue.Dequeue(); GamePlayer player = (GamePlayer)m_sayObjectQueue.Dequeue(); String message = (String)m_sayMessageQueue.Dequeue(); eChatType chatType = (eChatType)m_sayChatTypeQueue.Dequeue(); eChatLoc chatLoc = (eChatLoc)m_sayChatLocQueue.Dequeue(); player.Out.SendMessage(message, chatType, chatLoc); return(0); }
public static void MessageToAllStaff(string msg, eChatType chattype, eChatLoc chatloc) { if (msg == null) { return; } foreach (GamePlayer staffplayer in StaffList) { staffplayer.Out.SendMessage("[Appeals]: " + msg, chattype, chatloc); } return; }
private static string AssembleWithPrefix(eChatLoc location, string message) { switch (location) { case eChatLoc.CL_ChatWindow: return("@@" + message); case eChatLoc.CL_PopupWindow: return("##" + message); default: return(message); } }
public override void SendMessage(string msg, eChatType type, eChatLoc loc) { // if (m_gameClient.ClientState == GameClient.eClientState.CharScreen) // { // return; // } GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.Message)); { pak.WriteByte((byte)type); pak.WriteString(AssembleWithPrefix(loc, msg)); SendTCP(pak); } }
public virtual void SendMessage(string msg, eChatType type, eChatLoc loc) { if (m_gameClient.ClientState == GameClient.eClientState.CharScreen) return; // types not supported by 1.68+ clients switch (type) { case eChatType.CT_ScreenCenterSmaller: case eChatType.CT_ScreenCenter: return; } using (var pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.Message))) { pak.WriteShort((ushort) m_gameClient.SessionID); pak.WriteShort(0x00); pak.WriteByte((byte) type); pak.Fill(0x0, 3); String str; if (loc == eChatLoc.CL_ChatWindow) str = "@@"; else if (loc == eChatLoc.CL_PopupWindow) str = "##"; else str = ""; str = String.Concat(str, msg); pak.WriteString(str); SendTCP(pak); } }
/// <summary> /// Send custom text message to GameLiving /// </summary> /// <param name="living"></param> /// <param name="message"></param> /// <param name="type"></param> /// <param name="loc"></param> public virtual void MessageToLiving(GameLiving living, string message, eChatType type, eChatLoc loc) { if (living is GamePlayer) ((GamePlayer)living).Out.SendMessage(message, type, loc); }
/// <summary> /// Send a message to player. You can use <Player>, <Class>, <Race>, <Guild>, <RealmTitle>, <Title> to have text replaced with actual player values. /// </summary> /// <param name="player"></param> /// <param name="msg"></param> /// <param name="delay"></param> /// <param name="chatType"></param> /// <param name="chatLoc"></param> protected static void SendMessage(GamePlayer player, string msg, uint delay, eChatType chatType, eChatLoc chatLoc) { msg = BehaviourUtils.GetPersonalizedMessage(msg, player); if (delay == 0) { player.Out.SendMessage(msg, chatType, chatLoc); } else { m_sayMessageQueue.Enqueue(msg); m_sayObjectQueue.Enqueue(player); m_sayChatLocQueue.Enqueue(chatLoc); m_sayChatTypeQueue.Enqueue(chatType); m_sayTimerQueue.Enqueue(new RegionTimer(player, new RegionTimerCallback(MakeSaySequence), (int)delay * 100)); } }
/// <summary> /// Sends a message to all group members with an object from /// </summary> /// <param name="from">GameLiving source of the message</param> /// <param name="msg">message string</param> /// <param name="type">message type</param> /// <param name="loc">message location</param> public virtual void SendMessageToGroupMembers(GameLiving from, string msg, eChatType type, eChatLoc loc) { string message; if (from != null) { message = string.Format("[Party] {0}: \"{1}\"", from.GetName(0, true), msg); } else { message = string.Format("[Party] {0}", msg); } SendMessageToGroupMembers(message, type, loc); }
public override void SendMessage(string msg, eChatType type, eChatLoc loc) { if (m_gameClient.ClientState == GameClient.eClientState.CharScreen) return; using (GSTCPPacketOut pak = new GSTCPPacketOut(GetPacketCode(eServerPackets.Message))) { pak.WriteShort(0xFFFF); pak.WriteShort((ushort)m_gameClient.SessionID); pak.WriteByte((byte)type); pak.Fill(0x0, 3); string str; if (loc == eChatLoc.CL_ChatWindow) str = "@@"; else if (loc == eChatLoc.CL_PopupWindow) str = "##"; else str = ""; pak.WriteString(str+msg); SendTCP(pak); } }
protected static void SendMessage(GamePlayer player, String msg, uint delay, eChatType chatType, eChatLoc chatLoc) { if (delay == 0) player.Out.SendMessage(msg, chatType, chatLoc); else { m_sayMessageQueue.Enqueue(msg); m_sayObjectQueue.Enqueue(player); m_sayChatLocQueue.Enqueue(chatLoc); m_sayChatTypeQueue.Enqueue(chatType); m_sayTimerQueue.Enqueue(new RegionTimer(player, new RegionTimerCallback(MakeSaySequence), (int)delay * 100)); } }
public override void SendMessage(string msg, eChatType type, eChatLoc loc) { }
/// <summary> /// Sends a message to all group members /// </summary> /// <param name="msg">message string</param> /// <param name="type">message type</param> /// <param name="loc">message location</param> public virtual void SendMessageToGroupMembers(GameLiving from, string msg, eChatType type, eChatLoc loc) { string message = msg; if (from != null) { message = "[Party] " + from.GetName(0, true) + ": \"" + message + "\""; } else { message = "[Party] " + message; } SendMessageToGroupMembers(message, type, loc); }
/// <summary> /// Sends a text message to players within a specific radius of another object /// </summary> /// <param name="centerObject">The center object</param> /// <param name="message">The message to send</param> /// <param name="chatType">The chat typ</param> /// <param name="chatLoc">The chat location</param> /// <param name="distance">The distance</param> /// <param name="excludes">A list of GameObjects to exlude from the message</param> public static void MessageToArea(GameObject centerObject, string message, eChatType chatType, eChatLoc chatLoc, ushort distance, params GameObject[] excludes) { if (message == null || message.Length <= 0) { return; } bool excluded; foreach (GamePlayer player in centerObject.GetPlayersInRadius(distance)) { excluded = false; if (excludes != null) { foreach (GameObject obj in excludes) { if (obj == player) { excluded = true; break; } } } if (!excluded) { player.MessageFromArea(centerObject, message, chatType, chatLoc); } } }
public virtual void SendMessageToBattleGroupMembers(string msg, eChatType type, eChatLoc loc) { lock (m_battlegroupMembers) // Mannen 10:56 PM 10/30/2006 - Fixing every lock(this) { foreach (GamePlayer player in m_battlegroupMembers.Keys) { player.Out.SendMessage(msg, type, loc); } } }
/// <summary> /// Format "say" message and send it to target /// </summary> /// <param name="target"></param> /// <param name="loc">chat location of the message</param> /// <param name="message"></param> public virtual void SayTo(GamePlayer target, eChatLoc loc, string message, bool announce = true) { if (target == null) return; TurnTo(target); string resultText = LanguageMgr.GetTranslation(target.Client.Account.Language, "GameNPC.SayTo.Says", GetName(0, true, target.Client.Account.Language, this), message); switch (loc) { case eChatLoc.CL_PopupWindow: target.Out.SendMessage(resultText, eChatType.CT_System, eChatLoc.CL_PopupWindow); if (announce) { Message.ChatToArea(this, LanguageMgr.GetTranslation(target.Client.Account.Language, "GameNPC.SayTo.SpeaksTo", GetName(0, true, target.Client.Account.Language, this), target.GetName(0, false)), eChatType.CT_System, WorldMgr.SAY_DISTANCE, target); } break; case eChatLoc.CL_ChatWindow: target.Out.SendMessage(resultText, eChatType.CT_Say, eChatLoc.CL_ChatWindow); break; case eChatLoc.CL_SystemWindow: target.Out.SendMessage(resultText, eChatType.CT_System, eChatLoc.CL_SystemWindow); break; } }
public virtual void SendMessageToGroupMembers(string msg, eChatType type, eChatLoc loc) { foreach (GamePlayer player in GetPlayersInTheGroup()) { if(player==null) continue; player.Out.SendMessage(msg, type, loc); } }
/// <summary> /// Sends a text message to players within a specific radius of another object /// </summary> /// <param name="centerObject">The center object</param> /// <param name="message">The message to send</param> /// <param name="chatType">The chat typ</param> /// <param name="chatLoc">The chat location</param> /// <param name="distance">The distance</param> /// <param name="excludes">A list of GameObjects to exlude from the message</param> public static void MessageToArea(GameObject centerObject, string message, eChatType chatType, eChatLoc chatLoc, ushort distance, params GameObject[] excludes) { if (message == null || message.Length <= 0) return; bool excluded; foreach(GamePlayer player in centerObject.GetPlayersInRadius(distance)) { excluded = false; if(excludes!=null) { foreach(GameObject obj in excludes) if(obj == player) { excluded = true; break; } } if (!excluded) { player.MessageFromArea(centerObject, message, chatType, chatLoc); } } }
public void SendMessage(string msg, eChatType type, eChatLoc loc) { if (SendMessageMethod != null) SendMessageMethod(this, msg, type, loc); }