RunUO Community

This is a sample guest message. Register a free account today to become a member! Once signed in, you'll be able to participate on this site by adding your own topics and posts, as well as connect with other members through your own private inbox!

[RunUO 2.0 RC1] Knives' Chat 3.0

Avelyn

Sorceror
kmwill23 said:
Ohhhhhh! So the chat system does pick up the new chat when you are off screen! That's neat, and unintended. The way that Global world works, if the player is on your screen and you can see their text, it doesn't show up in the bottom left of your screen. This is to reduce doubling the messages. I guess the new guild chatting is caught as world speech. You would rather it show up there all the time, no matter what?

I don't mind it showing above their head if I'm standing next to them, but the problem is that I lose the other side of the convo. I can see the person I'm standing next to (above their head) but the other members don't show up at the bottom until I get away from all of them. I like the way Global world works, and it's awesome. It's just the guild thing that is bugging me.
 

kmwill23

Sorceror
Avelyn said:
I don't mind it showing above their head if I'm standing next to them, but the problem is that I lose the other side of the convo. I can see the person I'm standing next to (above their head) but the other members don't show up at the bottom until I get away from all of them. I like the way Global world works, and it's awesome. It's just the guild thing that is bugging me.

I will test this out, thanks for bringing it up =)
 

kmwill23

Sorceror
m00er said:
Well im using 3.0 and [c doesnt work

When you install the system, it doesn't come with a default public chat room. You get to actually create those =)

Go into your chat setup ([cs) and on that first page you'll find the channel setup.
 

wulf monat

Sorceror
been running this for awhile but all of a sudden crash...

i'm not sure at all why its crashing, i havent had any crashes with it until recently but it seems its when a new char is being created, there hasnt been alot new chars until recently so not sure if its something that has been added messing with it or if it was aproblem that already existed? any help greatly appreciated i'd love to continue suing this system, well heres crash report i have been getting same crash from multiple players but not sure if its every new char yet ill check into it lil more,



Error:
System.ArgumentNullException: Key cannot be null.
Parameter name: key
at System.Collections.Hashtable.get_Item(Object key)
at Knives.Chat3.Data.GetData(Mobile m)
at Knives.Chat3.General.OnCreate(CharacterCreatedEventArgs args)
at Server.CharacterCreatedEventHandler.Invoke(CharacterCreatedEventArgs e)
at Server.EventSink.InvokeCharacterCreated(CharacterCreatedEventArgs e)
at Server.Network.PacketHandlers.CreateCharacter(NetState state, PacketReader
pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)



Thanks.
 
I want to auth on some IRC server and I need to send message like this "/msg blablabla AUTH blablabla blablabla" - but then I tried to send this message (after irc connection established) the IRC server responses like
"unknown command: msg". Im used 'SendMessage("msg blablabla AUTH blablabla blablabla")'. What Im doing wrong?
 

LNewman

Wanderer
problems with Chat

I installed it like you said by simply dropping the folders into the script\Custom folder. When I set up a public global chat channel and make the quick access C, B, Z or X, I get as admin either it works and a staff message goes out globally or the error message unknown command.

But when a player uses [c [b [z or [x it always reboots the shard regardless of whether or not the command worked for the admin character.

Any suggestions? The PM seems to work just fine. I disabled the IRC chat as I do not plan to use it at this time.:)
 

kmwill23

Sorceror
LNewman said:
I installed it like you said by simply dropping the folders into the script\Custom folder. When I set up a public global chat channel and make the quick access C, B, Z or X, I get as admin either it works and a staff message goes out globally or the error message unknown command.

But when a player uses [c [b [z or [x it always reboots the shard regardless of whether or not the command worked for the admin character.

Any suggestions? The PM seems to work just fine. I disabled the IRC chat as I do not plan to use it at this time.:)

This all sounds very odd. You mention the player using the command causes a server reboot. Can you give me the crashlog?
 

kmwill23

Sorceror
Prohor Meletevich said:
I want to auth on some IRC server and I need to send message like this "/msg blablabla AUTH blablabla blablabla" - but then I tried to send this message (after irc connection established) the IRC server responses like
"unknown command: msg". Im used 'SendMessage("msg blablabla AUTH blablabla blablabla")'. What Im doing wrong?

It sounds like you are attempting to add something to the script to aid in authentication to a server that doesn't work well with thia chat system. Is this correct? If so, the command you are looking for starts with "PRIVMSG". If you search the script file you might find an example.
 

LNewman

Wanderer
Crashlog

kmwill23 said:
This all sounds very odd. You mention the player using the command causes a server reboot. Can you give me the crashlog?

Sorry I should have done this with the previous post. Here is one of the crashlogs. There are a number of them but all essentially the same words.

Server Crash Report
===================

RunUO Version 2.0, Build 2357.32527
Operating System: Microsoft Windows NT 5.1.2600 Service Pack 2
.NET Framework: 2.0.50727.42
Time: 8/13/2006 12:01:08 AM
Mobiles: 2468
Items: 100256
Clients:
- Count: 2
+ (IP#1): (account = daddio123) (mobile = 0x4 'Cedric')
+ (IP#2): (account = SpiritofTexas) (mobile = 0x9 'Azur Teblanc')

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Commands.HearAll.OnSpeech(SpeechEventArgs args)
at Server.SpeechEventHandler.Invoke(SpeechEventArgs e)
at Server.EventSink.InvokeSpeech(SpeechEventArgs e)
at Server.Mobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
at Server.Mobiles.PlayerMobile.DoSpeech(String text, Int32[] keywords, MessageType type, Int32 hue)
at Server.Network.PacketHandlers.UnicodeSpeech(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)


This is the complete crashlog with only the IP#s left out.

Thanks!
 

LNewman

Wanderer
New Info on Knives Chat problem

I removed "hearall" from the scripts and the system no longer crashes. Still the channel shortcut does not work. The owner character can't talk in the global chat channel though he of course can join it. When the player character types anything onsreen it goes out to the channel that the player joined. (Note: I have IRC disabled)

I have {s for staff chat already working from some other script, not sure which one but if you think it might be causing problems with this one, I can maybe find it and remove it too.

Maybe this will shed more light on the problem. I hope so. I really would love to get the chat system working.
 
kmwill23 said:
It sounds like you are attempting to add something to the script to aid in authentication to a server that doesn't work well with thia chat system. Is this correct? If so, the command you are looking for starts with "PRIVMSG". If you search the script file you might find an example.

Also "PRIVMSG" not working. This is your script with my Auth modification:
Code:
using System;
using System.Net.Sockets;
using System.Threading;
using System.IO;
using System.Collections;
using Server;
using Knives.Utils;
namespace Knives.Chat3
{
 public enum IrcColor
 {
  White = 0,
  Black = 1,
  Blue = 2,
  Green = 3,
  LightRed = 4,
  Brown = 5,
  Purple = 6,
  Orange = 7,
  Yellow = 8,
  LightGreen = 9,
  Cyan = 10,
  LightCyan = 11,
  LightBlue = 12,
  Pink = 13,
  Grey = 14,
  LightGrey = 15,
 };
 public class IrcConnection
 {
  private static IrcConnection s_Connection = new IrcConnection();
  public static IrcConnection Connection{ get{ return s_Connection; } }
  private TcpClient c_Tcp;
  private Thread c_Thread;
  private StreamReader c_Reader;
  private StreamWriter c_Writer;
        private bool c_Connecting, c_Connected, [COLOR=red]m_Authenticated[/COLOR];
        private int c_Attempts, [COLOR=red]m_AuthAttempts[/COLOR];
  private DateTime c_LastPong;
  public bool Connecting{ get{ return c_Connecting; } }
  public bool Connected{ get{ return c_Connected; } }
  public bool HasMoreAttempts{ get{ return c_Attempts <= Data.IrcMaxAttempts; } }
  public IrcConnection()
  {
  }
  public void Connect( Mobile m )
  {
   Data data = Data.GetData( m );
   if ( c_Connecting )
   {
    m.SendMessage( data.SystemC, General.Local(102) );
    return;
   }
   if ( c_Connected )
   {
    m.SendMessage( data.SystemC, General.Local(103) );
    return;
   }
   Connect();
  }
  public void Connect()
  {
   new Thread( new ThreadStart( ConnectTcp ) ).Start();
  }
  public void CancelConnect()
  {
   c_Attempts = Data.IrcMaxAttempts;
  }
  private void Reconnect()
  {
   c_Attempts++;
   if ( !HasMoreAttempts )
   {
    c_Attempts = 1;
    BroadcastSystem( General.Local(104) );
    return;
   }
   BroadcastSystem( General.Local(105) + c_Attempts );
   Connect();
  }
  private void ConnectTcp()
  {
   try{ c_Tcp = new TcpClient( Data.IrcServer, Data.IrcPort ); }
   catch
   {
    BroadcastSystem( General.Local(106) );
    Reconnect();
    return;
   }
   ConnectStream();
  }
  private void ConnectStream()
  {try{
   c_Connecting = true;
   c_LastPong = DateTime.Now;
            c_Reader = new StreamReader(c_Tcp.GetStream(), System.Text.Encoding.Default);
            c_Writer = new StreamWriter(c_Tcp.GetStream(), System.Text.Encoding.Default);
            BroadcastSystem( General.Local(107) );
            SendMessage(String.Format("USER {0} 1 * :Hello!", Data.IrcNick));
            SendMessage(String.Format("NICK {0}", Data.IrcNick));
            c_Thread = new Thread(new ThreadStart(ReadStream));
   c_Thread.Start();
   Server.Timer.DelayCall( TimeSpan.FromSeconds( 15.0 ), new Server.TimerCallback( Names ) );
            foreach (Data data in Data.Datas.Values)
                if (data.Mobile.HasGump(typeof(SetupGump)))
                    General.RefreshGump(data.Mobile, typeof(SetupGump));            
  }catch{ Errors.Report( String.Format( "IrcConnection-> ConnectStream" ) ); } }
[COLOR=red]        private void Auth()
        {
            if (!m_Authenticated)
            {                
                SendMessage("PRIVMSG [/COLOR][EMAIL="[email protected]"][COLOR=red][email protected][/COLOR][/EMAIL][COLOR=red] AUTH XXXX XXXX");
                
                m_AuthAttempts++;[/COLOR]
[COLOR=red]                if (m_AuthAttempts < 10)
                {
                    Server.Timer.DelayCall(TimeSpan.FromSeconds(15.0), new Server.TimerCallback(Auth));
                }
            }            
        }[/COLOR]
        private void Names()
        {
            if (c_Connected)
                SendMessage("NAMES " + Data.IrcRoom);
            else
                return;
            Server.Timer.DelayCall( TimeSpan.FromSeconds( 15.0 ), new Server.TimerCallback( Names ) );
        }
  private void PingPong(string str)
  {
            if (!c_Connecting && !c_Connected)
                return;
            if (str.IndexOf("PING") != -1)
                str = str.Replace("PING", "PONG");
            else
                str = str.Replace("PONG", "PING");
            
   SendMessage( str );
  }
  public void SendMessage( string msg )
  {
   try{
   BroadcastRaw( msg );
   c_Writer.WriteLine( msg );
   c_Writer.Flush();
   }catch{ Disconnect(); }
  }
  public void SendUserMessage( Mobile m, string msg )
  {
   if ( !Connected )
    return;
   msg = OutParse( m, m.Name + ": " + msg );
   s_Connection.SendMessage( String.Format( "PRIVMSG {0} : {1}", Data.IrcRoom, msg  ));
   BroadcastRaw( String.Format( "PRIVMSG {0} : {1}", Data.IrcRoom, msg ) );
  }
  private string OutParse( Mobile m, string str )
  {
   if ( m.AccessLevel != AccessLevel.Player )
    return str = '\x0003' + ((int)Data.IrcStaffColor).ToString() + str;
   return str;
  }
  private void BroadcastSystem( string msg )
  {
   foreach( Data data in Data.Datas.Values )
    if ( data.Channels.Contains("IRC") && !data.Banned )
     data.Mobile.SendMessage( data.SystemC, msg );
  }
  private void Broadcast( string name, string msg )
  {
            if (!(Channel.GetByName("IRC") is IRC))
                return;
            ((IRC)Channel.GetByName("IRC")).Broadcast(name, msg);
  }
  private void Broadcast( Mobile m, string msg )
  {
  }
  private void BroadcastRaw( string msg )
  {
   foreach( Data data in Data.Datas.Values )
    if ( data.IrcRaw )
     data.Mobile.SendMessage( data.SystemC, "RAW: " + msg );
  }
  private void ReadStream()
  {try{
   string input = "";
   while( c_Thread.IsAlive )
   {
    input = c_Reader.ReadLine();
    if ( input == null )
     break;
    HandleInput( input );
   }
   Disconnect();
  }catch{ Disconnect(); } }
  private void HandleInput( string str )
  {try{
            if (str == null)
                return;
   BroadcastRaw( str );
   if ( str.IndexOf( "PONG" ) != -1 || str.IndexOf("PING") != -1 )
   {
                PingPong( str );
                return;
   }
   if ( str.IndexOf( "353" ) != -1 )
   {
    BroadcastRaw( General.Local(109) );
    int index = str.ToLower().IndexOf( Data.IrcRoom.ToLower() ) + Data.IrcRoom.Length + 2;
    if ( index == 1 )
     return;
                
    string strList = str.Substring( index, str.Length-index );
    string[] strs = strList.Trim().Split( ' ' );
    Data.IrcList.Clear();
    Data.IrcList.AddRange( strs );
    Data.IrcList.Remove( Data.IrcNick );
   }
            if (str.IndexOf("001") != -1 && c_Connecting)
            {
                c_Connected = true;
                c_Connecting = false;
                BroadcastSystem(General.Local(108));
                c_Attempts = 1;
                SendMessage(String.Format("JOIN {0}", Data.IrcRoom));
                foreach (Data data in Data.Datas.Values)
                    if (data.Mobile.HasGump(typeof(SetupGump)))
                        General.RefreshGump(data.Mobile, typeof(SetupGump));
                [COLOR=red]m_Authenticated = false;
                m_AuthAttempts = 0;
                Server.Timer.DelayCall(TimeSpan.FromSeconds(15.0), new Server.TimerCallback(Auth));
[/COLOR]            }
            [COLOR=red]if (str.IndexOf("Notice from Q(QuakeNet):") != -1 && !m_Authenticated)
            {
                string message = str.Substring( 25, str.Length - 25 );[/COLOR]
[COLOR=red]                if (message == "AUTH'd successfully.")
                {
                    m_Authenticated = true;
                }
            }[/COLOR]
            if (str.Length > 300)
                return;
            if (str.IndexOf("PRIVMSG") != -1)
   {
    string parOne = str.Substring( 1, str.IndexOf( "!" )-1 );
                string parThree = str.Substring( str.IndexOf( "!" )+1, str.Length-str.IndexOf("!")-(str.Length-str.IndexOf("PRIVMSG"))-1);
    int index = 0;
    index = str.ToLower().IndexOf( Data.IrcRoom.ToLower() ) + Data.IrcRoom.Length + 2;
    if ( index == 1 )
     return;
    string parTwo = str.Substring( index, str.Length-index );
                if (parTwo.IndexOf("ACTION") != -1)
                {
                    index = parTwo.IndexOf("ACTION") + 7;
                    parTwo = parTwo.Substring(index, parTwo.Length - index);
                    str = String.Format("<{0}> {1} {2}", Data.IrcRoom, parOne, parTwo);
                }
                else
                {
                    str = String.Format("<{0}> {1}: {2}", Data.IrcRoom, parOne, parTwo);
                }
                [COLOR=seagreen]switch (ChatHelper.Check(parOne, parTwo))
                {
                    case ProfanityCheckResult.Nothing:
                        Broadcast(parOne, str);
                        break;
                    case ProfanityCheckResult.Warning:
                        ChatHelper.Warn(this, parOne);
                        break;
                    case ProfanityCheckResult.Profanation:
                        ChatHelper.Kick(this, parOne);
                        break;                                           
                }[/COLOR]    
   }
        }
        catch (Exception e) { Errors.Report(String.Format("IrcConnection-> HandleInput")); Console.WriteLine(e.Message); }}
  public void Disconnect()
  {
   Disconnect( true );
  }
        public void Disconnect(bool reconn)
        {
            try
            {
                if (c_Connected)
                    BroadcastSystem(General.Local(110));
                c_Connected = false;
                c_Connecting = false;
                if (c_Thread != null)
                {
                    c_Thread.Abort();
                    c_Thread = null;
                }
                if (c_Reader != null)
                    c_Reader.Close();
                if (c_Writer != null)
                    c_Writer.Close();
                if (c_Tcp != null)
                    c_Tcp.Close();
                if (reconn)
                    Reconnect();
                foreach (Data data in Data.Datas.Values)
                    if (data.Mobile.HasGump(typeof(SetupGump)))
                        General.RefreshGump(data.Mobile, typeof(SetupGump));
            }
            catch { Errors.Report(String.Format("IrcConnection-> Disconnect")); }
        }
 }
}
 

kmwill23

Sorceror
LNewman said:
I removed "hearall" from the scripts and the system no longer crashes. Still the channel shortcut does not work. The owner character can't talk in the global chat channel though he of course can join it. When the player character types anything onsreen it goes out to the channel that the player joined. (Note: I have IRC disabled)

I have {s for staff chat already working from some other script, not sure which one but if you think it might be causing problems with this one, I can maybe find it and remove it too.

Maybe this will shed more light on the problem. I hope so. I really would love to get the chat system working.

The good thing is that you managed to find and solve your crash =)

Now, when you go into [chatsetup and select the channel, what do you see for the commands there?
 

kmwill23

Sorceror
Prohor Meletevich said:
Also "PRIVMSG" not working. This is your script with my Auth modification:

When you perform this authentication in a normal IRC client, what command do you use, or does your IRC client handle it for you?
 

Sunshine

Wanderer
Is it possible (for non great scriptors) to add a rp chat? one that would say RP instead of say Public or world

Role Players would like to have one so that others will know this is Rp
 
Top