|
||
|
|||||||
| Custom Script Releases This forum is where you can release your custom scripts for other users to use. Please note: By releasing your scripts here you are submitting them to the public and as such agree to make them public domain. The RunUO Team has made its software GPL for you to use and enjoy you should do the same for anything based off of RunUO. |
![]() |
|
|
Thread Tools | Display Modes |
|
|
#52 (permalink) |
|
Forum Newbie
Join Date: Dec 2005
Posts: 22
|
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. ![]() |
|
|
|
|
|
#53 (permalink) | |
|
Forum Expert
|
Quote:
__________________
"Morality is a lonely path." - Me |
|
|
|
|
|
|
#54 (permalink) | |
|
Forum Expert
|
Quote:
__________________
"Morality is a lonely path." - Me |
|
|
|
|
|
|
#55 (permalink) | |
|
Forum Newbie
Join Date: Dec 2005
Posts: 22
|
Quote:
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(NetSta te 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! |
|
|
|
|
|
|
#56 (permalink) |
|
Forum Newbie
Join Date: Dec 2005
Posts: 22
|
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. |
|
|
|
|
|
#57 (permalink) | |
|
Forum Novice
|
Quote:
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, m_Authenticated;
private int c_Attempts, m_AuthAttempts;
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" ) ); } }
private void Auth()
{
if (!m_Authenticated)
{
SendMessage("PRIVMSG Q@CServe.quakenet.org AUTH XXXX XXXX");
m_AuthAttempts++;
if (m_AuthAttempts < 10)
{
Server.Timer.DelayCall(TimeSpan.FromSeconds(15.0), new Server.TimerCallback(Auth));
}
}
}
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));
m_Authenticated = false;
m_AuthAttempts = 0;
Server.Timer.DelayCall(TimeSpan.FromSeconds(15.0), new Server.TimerCallback(Auth));
}
if (str.IndexOf("Notice from Q(QuakeNet):") != -1 && !m_Authenticated)
{
string message = str.Substring( 25, str.Length - 25 );
if (message == "AUTH'd successfully.")
{
m_Authenticated = true;
}
}
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);
}
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;
}
}
}
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")); }
}
}
}
Last edited by Prohor Meletevich; 08-13-2006 at 07:13 PM. |
|
|
|
|
|
|
#58 (permalink) | |
|
Forum Expert
|
Quote:
Now, when you go into [chatsetup and select the channel, what do you see for the commands there?
__________________
"Morality is a lonely path." - Me |
|
|
|
|
|
|
#59 (permalink) | |
|
Forum Expert
|
Quote:
__________________
"Morality is a lonely path." - Me |
|
|
|
|
|
|
#60 (permalink) |
|
Forum Expert
Join Date: Mar 2005
Location: Hopefully not near you
Posts: 2,233
|
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
__________________
All people have the right to be stupid but some abuse the privilege.
|
|
|
|
|
|
#61 (permalink) | |
|
Forum Novice
Join Date: Dec 2004
Location: Middle of nowhere
Posts: 632
|
Quote:
![]()
__________________
sigtoobig Achilles Kingdom, Fun PvP/RP shard waiting for players.IP: 24.19.230.74, Port: 2593 |
|
|
|
|
|
|
#63 (permalink) | |
|
Forum Novice
|
Quote:
Last edited by Prohor Meletevich; 08-15-2006 at 06:38 PM. |
|
|
|
|
|
|
#64 (permalink) | |
|
Forum Novice
|
Quote:
/MSG Q@CServe.quakenet.org AUTH XXXX XXXX |
|
|
|
|
|
|
#65 (permalink) | |
|
Forum Expert
|
Quote:
__________________
"Morality is a lonely path." - Me |
|
|
|
|
|
|
#66 (permalink) | |
|
Forum Expert
|
Quote:
This version allows you to create that [chat command on your own through the first page of the [chatsetup menu. Give it a shot =)
__________________
"Morality is a lonely path." - Me |
|
|
|
|
|
|
#67 (permalink) | |
|
Forum Expert
|
Quote:
__________________
"Morality is a lonely path." - Me |
|
|
|
|
|
|
#68 (permalink) |
|
Forum Expert
Join Date: Mar 2005
Location: Hopefully not near you
Posts: 2,233
|
Ok says not vaild command I must not have the latest version in...will update it and try the [chatsetup thanks
__________________
All people have the right to be stupid but some abuse the privilege.
|
|
|
|
|
|
#70 (permalink) | |
|
Forum Novice
|
Quote:
Because the server is unaccessible now. From my country maybe... So I'll moving to another server. |
|
|
|
|
|
|
#71 (permalink) |
|
Forum Expert
Join Date: Mar 2005
Location: Hopefully not near you
Posts: 2,233
|
Ok I can not update...
We are using run uo 1 still and thus can not use the latest and best knives chat yet...now I wanna cry
__________________
All people have the right to be stupid but some abuse the privilege.
|
|
|
|
|
|
#72 (permalink) |
|
Forum Novice
Join Date: May 2004
Age: 26
Posts: 114
|
Love this script soo much
.So, I'm setting up the IRC function and I think I have it all figured ou. But if I understand it correctly players need to join the IRC chan before they can see what is said in the actual IRC channel? Or did I miss something? |
|
|
|