/// <summary> /// Handles sending a chat message in a player's local vicinity. /// </summary> /// <param name="type">The type of chat to send.</param> /// <param name="set">The set of things in the player's local vicinity.</param> /// <param name="msg">The message to send.</param> /// <param name="sender">The sender of the message.</param> private void HandleLocalChat(ChatLocal type, ThingSet set, string msg, Creature sender) { foreach (Thing thing in set.GetThings()) { thing.AddLocalChat(type, msg, sender.CurrentPosition, sender); } }
public override void AddLocalChat(ChatLocal chatType, string message, Position pos, Creature creatureFrom) { if (creatureFrom == this) { return; } lastMessage = message.ToLower(); lastMessage = lastMessage.Replace(".", ""); lastMessage = lastMessage.Replace("?", ""); lastCreatureSay = creatureFrom; HandleMessage(); }
public override void AddLocalChat(ChatLocal chatType, string message, Position pos, Creature creatureFrom) { if (creatureFrom == this) { return; } lastMessage = message.ToLower(); lastMessage = lastMessage.Replace(".", ""); lastMessage = lastMessage.Replace("?", ""); lastCreatureSay = creatureFrom; HandleMessage(); }
/// <summary> /// Sends a local chat event to the game client. /// </summary> /// <param name="chatType">Type of chat.</param> /// <param name="message">Message content of chat.</param> /// <param name="pos">Position of chat.</param> /// <param name="nameFrom">Name of creature sending the chat.</param> public override void AddLocalChat(ChatLocal chatType, string message, Position pos, string nameFrom) { AddChat((byte)chatType, pos, nameFrom, message); }
/// <summary> /// Handles sending a chat message in a player's local vicinity. /// </summary> /// <param name="type">The type of chat to send.</param> /// <param name="set">The set of things in the player's local vicinity.</param> /// <param name="msg">The message to send.</param> /// <param name="sender">The sender of the message.</param> private void HandleLocalChat(ChatLocal type, ThingSet set, string msg, Creature sender) { foreach (Thing thing in set.GetThings()) { thing.AddLocalChat(type, msg, sender.CurrentPosition, sender); } }
public abstract void AddLocalChat(ChatLocal chatType, string message, Position pos, string nameFrom);
public abstract void AddLocalChat(ChatLocal chatType, string message, Position pos, string nameFrom);
public override void AddLocalChat(ChatLocal chatType, string message, Position pos, string nameFrom) { throw new NotImplementedException(); }
public override void AddLocalChat(ChatLocal chatType, string message, Position pos, string nameFrom) { throw new NotImplementedException(); }
// TODO: REMOVE /*/// <summary> /// Returns whether the supplied name and the supplied password are valid. /// </summary> /// <param name="name">Name of player to be loaded</param> /// <param name="password">Password of player to be loaded.</param> /// <returns>True if valid, false otherwise.</returns> public bool LoadPlayerOld(LoginInfo info) { lock (lockStatic) { string filePath = GetPlayerPath(info.GetUsername()); if (!File.Exists(filePath)) { #if DEBUG Tracer.Println("Player: " + Name + " does not exist."); #endif return false; } BinaryReader bReader = new BinaryReader(File.Open(filePath, FileMode.Open)); Name = (bReader.ReadString()); Password = (bReader.ReadString()); if (!Password.Equals(info.GetPassword())) { #if DEBUG Tracer.Println("Invalid player password for : " + Name); #endif bReader.Close(); return false; } Level = (bReader.ReadByte()); Experience = (bReader.ReadUInt32()); MagicLevel = (bReader.ReadByte()); ManaSpent = (bReader.ReadUInt32()); CurrentHP = (bReader.ReadUInt16()); MaxHP = (bReader.ReadUInt16()); CurrentMana = (bReader.ReadUInt16()); MaxMana = (bReader.ReadUInt16()); CurrentCapacity = (bReader.ReadUInt16()); MaxCapacity = (bReader.ReadUInt16()); bReader.ReadByte(); //access bReader.ReadByte(); //gender CurrentVocation = (Vocation)(bReader.ReadByte()); CurrentPosition = new Position(); CurrentPosition.x = bReader.ReadUInt16(); CurrentPosition.y = bReader.ReadUInt16(); CurrentPosition.z = bReader.ReadByte(); CharType = (bReader.ReadByte()); OutfitUpper = bReader.ReadByte(); OutfitMiddle = bReader.ReadByte(); OutfitLower = bReader.ReadByte(); for (byte i = 0; i < Constants.SKILL_MAX; i++) { SetSkill(i, bReader.ReadByte()); SetSkillTries(i, bReader.ReadUInt32()); } CurrentDirection = (Direction)bReader.ReadByte(); for (byte i = 0; i < inventory.Length; i++) { bool existsItem = bReader.ReadBoolean(); if (existsItem) { inventory[i] = Item.Load(bReader); } } BaseSpeed = bReader.ReadInt32(); bReader.Close(); return true; } }*/ /// <summary> /// Lets this thing know that a local chat event has occured. /// </summary> /// <param name="chatType">Type of chat.</param> /// <param name="message">Message content.</param> /// <param name="pos">Position of chat.</param> /// <param name="nameFrom">Name of creature doing the chat.</param> public override void AddLocalChat(ChatLocal chatType, string message, Position pos, Creature creatureFrom) { AddAffected(); string nameFrom = creatureFrom.Name; protocolS.AddLocalChat(chatType, message, pos, nameFrom); }
/// <summary> /// Sends a local chat event to the game client. /// </summary> /// <param name="chatType">Type of chat.</param> /// <param name="message">Message content of chat.</param> /// <param name="pos">Position of chat.</param> /// <param name="nameFrom">Name of creature sending the chat.</param> public override void AddLocalChat(ChatLocal chatType, string message, Position pos, string nameFrom) { AddChat((byte)chatType, pos, nameFrom, message); }
/// <summary> /// Lets this thing know that a local chat event has occured. /// </summary> /// <param name="chatType">Type of chat.</param> /// <param name="message">Message content.</param> /// <param name="pos">Position of chat.</param> /// <param name="nameFrom">Name of creature doing the chat.</param> public virtual void AddLocalChat(ChatLocal chatType, string message, Position pos, Creature creatureFrom) { }