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!

Post Office Stone

Umahduh

Wanderer
having problems with crashing

ok i got everything in all the files but my server keeps crashing when i try to send a letter and i know this cuase i am the only person on my shard right now just started building it

crash log
Server Crash Report
===================

RunUO Version 1.0.0, Build 36918
Operating System: Microsoft Windows NT 5.1.2600.0
.NET Framework: 1.1.4322.2032
Time: 1/29/2006 12:34:23 AM
Mobiles: 2305
Items: 85162
Clients:
- Count: 2
+ 192.168.1.50: (account = Umahduh) (mobile = 0x34 'Umahduh')
+ 192.168.1.56: (account = test) (mobile = 0x33 'tester')

Exception:
System.NullReferenceException: Object reference not set to an instance of an object.
at Server.Gumps.PackageTarget.OnTarget(Mobile from, Object o)
at Server.Targeting.Target.Invoke(Mobile from, Object targeted)
at Server.Network.PacketHandlers.TargetResponse(NetState state, PacketReader pvSrc)
at Server.Network.MessagePump.HandleReceive(NetState ns)
at Server.Network.MessagePump.Slice()
at Server.Core.Main(String[] args)


what could be Callusing this ??? me lost ???
 

Arvoreen

Sorceror
Umahduh said:
ok i got everything in all the files but my server keeps crashing when i try to send a letter and i know this cuase i am the only person on my shard right now just started building it

You're probably going to have a hard time getting support for this script, since it's in the archives. . . .I would search the current Custom Scripts forum for a suitable replacement. :)

Otherwise, you should probably start your server with the /debug switch, which should give you line numbers of the script causing the error.

Also, the last (useful or close to it) post in this thread was from almost a year ago. . .which means it's not used much, that's why I suggested looking elsewhere for your script. :)
 

orionmse

Wanderer
problem

i'm sorry for reviving this thing, no offence but it is kinda dead, but i had a problem with the post office doors....they don't open...
 

marvin3634

Wanderer
Ok for addons doors never work on them so I suggest that you leave the line for the doors out and the gm can place doors .. Btw Very nice .
 

jamesreg

Sorceror
i just tried this script and its a awsome script by they way just awsome
but i had everything working except the postal worker part i had to take that file out the other items worked but he doesnt any way of knowing why im using 2.0
 
Im using Rc2 and it all works great except all letters go thro empty so i change the letter to a base book with the letter id BUT now my isssues is after having it in not even for 24 hours a player is sending dirty messages and no way of knowing who :(*
 

kenferguson

Squire
I know this is an old thread, but I wasn't sure where else to post about this, and didnt want anyone to think im taking credit for this script.
Anyway, here's the problem--

I get this warning when ever I get an error and I believe it could be the reason for the letters coming out blank.

Warnings:
+ Custom/PostOffice.2.5/PostOffice/PostOfficeGump.cs:
CS0219: Line 88: The variable 'done' is assigned but its value is never used

Here is the script, I've marked the line in red that gets the warning. Can anyone please help?

Code:
using System;
using System.Reflection;
using System.Collections;
using Server;
using Server.Items;
using Server.Network;
using Server.Mobiles;
using Server.Targeting;
using Server.Accounting;

namespace Server.Gumps
{
	public class PostOfficeGump : Gump
	{
		private Mobile m_from;
		string m_acct, m_to;
		
		public PostOfficeGump( Mobile from, string to, string a ) : base( 25, 25)
		{
			from.CloseGump( typeof( PostOfficeGump ) );
			
			Closable=true;
			Disposable=true;
			Dragable=true;
			Resizable=false;
			
			AddPage(0);
			
			AddBackground(27, 22, 400, 400, 3500);
			
			AddImage(-20, -1, 10440, 0);
			AddImage(316, 53, 5536, 0);
			AddLabel(148, 84, 0, @".::Post Office::.");
			AddImage(95, 80, 92, 0);
			AddImage(147, 80, 93, 0);
			AddImage(154, 80, 93, 0);
			AddImage(265, 80, 94, 0);
			AddImage(110, 155, 1418, 0);
			AddTextEntry( 93, 340, 110, 20, 1149, 0, to );
			AddButton(60, 260, 4030, 4031, 1, GumpButtonType.Reply, 0);
			AddButton(60, 290, 4018, 4019, 0, GumpButtonType.Reply, 0);
			AddLabel(100, 260, 0, @"Send Item");
			AddLabel(100, 290, 0, @"Close");
			AddLabel(89, 126, 0, "To Send an Item is 50 Gold Pieces.");
			AddImage(41, 336, 52, 0);
			AddButton( 56, 351, 2117, 2118, 2, GumpButtonType.Reply, 0);
			AddLabel(137, 155, 0, @"Thanks for using,");
			AddLabel(127, 183, 0, @"Raisor's Post Office.");
			AddLabel(44, 315, 0, "Type \"recievers\" name here");

			m_acct = a;
			m_to = to;
		}
		
		public override void OnResponse( NetState state, RelayInfo info ) //Function for GumpButtonType.Reply Buttons 
		{ 
			m_from = state.Mobile; 

			if ( info.ButtonID == 1 ) 
			{ 
				if ( m_to == "" )
					m_from.SendMessage("You did not specify a person to send to.");
				else
				{
					m_from.SendMessage("Choose the Item to send to {0}", m_to);
					m_from.Target = new PackageTarget( m_from, m_to, m_acct );
				}
			}

			if ( info.ButtonID == 2 )
			{
				m_from.SendGump( new SendToGump( m_from ) );
			}
		}
		
		private class PackageTarget : Target
		{
			private string m_to, m_acct;
			
			public PackageTarget( Mobile m, string n, string a ) : base( -1, true, TargetFlags.None )
			{
				m_to = n;
				m_acct = a;
			}
			
			protected override void OnTarget( Mobile from, object o )
			{
				[COLOR="Red"]bool done = false;[/COLOR]
				bool sent = false;
				Container bank = from.BankBox;
				MailBox mailbox;
				Account a;
				Gold g = new Gold();
				g.Amount = 50;
				
				if ( o is Item )
				{
					Item i_package = (Item)o;
					
					if ( !i_package.IsChildOf( from.Backpack ) && !i_package.IsChildOf( from.BankBox ) )
					{
						from.SendMessage( "This must be in your backpack or bank to send it." );
						return;
					}
					else
					{
						if ( o is Container ) 
						{ 
							from.SendMessage( "You can't send Container's" );
							return;
						}
						
						if ( !bank.ConsumeTotal( typeof( Gold ), 50 ))
						{
							from.SendMessage("You must have 50 gold in your bank to send items");
							return;
						}
						
                        ArrayList mobs = new ArrayList( World.Mobiles.Values );
										
						foreach ( Mobile m in mobs )
						{
							a = m.Account as Account;
							mailbox = m.BankBox.FindItemByType( typeof( MailBox ) ) as MailBox;

							if ( m.Player && m != null && m.Name == m_to && a.Username == m_acct && i_package != null )
							{
								mailbox.DropItem( i_package );
								mailbox.NewMail = "true";
                                if ( m.NetState != null ) 
                                    m.SendGump(new NewMailGump(m, mailbox));
                                sent = true;
                			}
						}
                        done = true;
                    }
                    if (sent)
                    {
                        from.SendMessage("Item sent.");
                        g.Delete();
                    }
                    else
                    {
                        from.SendMessage("Item not sent");
                        from.BankBox.DropItem(g);
                    }
                }
				else
					from.SendMessage("You can only send Items");
			}
		}
	}
}
 

kenferguson

Squire
Okay figured out why the letters go through blank.

At the top of the letter gump where you enter who it is to, you have to type the exact name and it is case sensitive.

Just in case anyone would like to know.
 
Top