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!

Complete Messaging System

Status
Not open for further replies.
In the PlayerMobile, where you put the code:

Code:
pm.Onshow = false;


just change that to:

Code:
pm.Onshow = true;


that is under the
Code:
private static void OnLogin( LoginEventArgs e )


that will make all players visible on login.
I just downloaded msg system 1.5 and looked under

[code:1]private static void OnLogin( LoginEventArgs e ) [/code:1]
and did not find
[code:1]pm.Onshow = false;[/code:1]

is
[code:1]pm.Onshow = true;[/code:1]
just something you add into it to make players visible on login
 

dr_love0214

Wanderer
What might cause this?

[code:1]This is errors
Scripts: Compiling C# scripts...failed (2 errors, 0 warnings)
- Error: Scripts\Gumps\MsgClientGump.cs: CS1502: (line 62, column 24) The best
overloaded method match for 'Server.Gumps.MsgGump.MsgGump(Server.Mobile)' has so
me invalid arguments
- Error: Scripts\Gumps\MsgClientGump.cs: CS1503: (line 62, column 37) Argument
'1': cannot convert from 'Server.Network.NetState' to 'Server.Mobile'
Scripts: One or more scripts failed to compile or no script files were found.
- Press return to exit, or R to try again.[/code:1]
 

roadmaster

Sorceror
Fury, Excellent Messaging System you have made my players soooo happy. I want to thank you for such a job well done, it is custom scripts like this that really make these forum's shine.... :D


roadmaster
 

mebane2

Wanderer
Fury said:
Seven said:
Fury said:
aye to use this you really need some understanding of serialize/deserialize.. if you used the playermobile i included that wouldnt happen.. if you want post your serialize/deserialize methods and ill try and help.. please dont post whole playermobile.
??...Well, i know how to desleraize it and seralize it...for example the point system...When i did that perfectly i still had to restart my accounts. Do i have to configure it somewhere else to?

If that is the case you do not understand it and did not do it perfectly. i have done quite a bit of serialize/deserialize to playermobile.cs on a live shard and have never wiped players.

But have you had to convert your players over, or just added it on? I keep running into having to convert, and still can't seem to get the knack of it. From the faq it seems you have to have your current playermobile.cs and the new on compiled in at the same time, and some of the variable names conflict. But I would assume if you change those, then you have to change them in countless other scripts to match.
 

Fury

Wanderer
Nope i dont.. i comment what i change in playermobile and most of the time its not much trouble upgrading, if i do have trouble its some small detail i overlook which could happen in any script not just playermobile...
 

mebane2

Wanderer
Well this time I managed to get it to compile, but when I saved it trashed the database. Gonna revert and try again. I did get it up thought to look at it in game and it looks nice. Its def something I wanna get added for our shard when we get it ready to go public (someday ;) )
 

mebane2

Wanderer
Ok, here is my deserialize/serialize code. It compiles fine, its when I do the save of course that the server bombs. I will add the error msg after the code.

[code:1] public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();

switch ( version )
{
case 16:
{
Onshow = reader.ReadBool();
goto case 15;
}
case 15:
{
m_CompassionGains = reader.ReadEncodedInt();

if ( m_CompassionGains > 0 )
m_NextCompassionDay = reader.ReadDeltaTime();

goto case 14;
}
// Omega Red - possession
case 14:
{
m_PossessMob = reader.ReadMobile();
m_PossessStorageMob = reader.ReadMobile();



goto case 13;
}
// END possession
case 13: // just removed m_PayedInsurance list
case 12:
{
m_BOBFilter = new Engines.BulkOrders.BOBFilter( reader );
goto case 11;
}
case 11:
{
if ( version < 13 )
{
ArrayList payed = reader.ReadItemList();

for ( int i = 0; i < payed.Count; ++i )
((Item)payed).PayedInsurance = true;
}

goto case 10;
}
case 10:
{
if ( reader.ReadBool() )
{
m_HairModID = reader.ReadInt();
m_HairModHue = reader.ReadInt();
m_BeardModID = reader.ReadInt();
m_BeardModHue = reader.ReadInt();

// We cannot call SetHairMods( -1, -1 ) here because the items have not yet loaded
Timer.DelayCall( TimeSpan.Zero, new TimerCallback( RevertHair ) );
}

goto case 9;
}
case 9:
{
SavagePaintExpiration = reader.ReadTimeSpan();

if ( SavagePaintExpiration > TimeSpan.Zero )
{
BodyMod = ( Female ? 184 : 183 );
HueMod = 0;
}

goto case 8;
}
case 8:
{
m_NpcGuild = (NpcGuild)reader.ReadInt();
m_NpcGuildJoinTime = reader.ReadDateTime();
m_NpcGuildGameTime = reader.ReadTimeSpan();
goto case 7;
}
case 7:
{
m_PermaFlags = reader.ReadMobileList();
goto case 6;
}
case 6:
{
NextTailorBulkOrder = reader.ReadTimeSpan();
goto case 5;
}
case 5:
{
NextSmithBulkOrder = reader.ReadTimeSpan();
goto case 4;
}
case 4:
{
m_LastJusticeLoss = reader.ReadDeltaTime();
m_JusticeProtectors = reader.ReadMobileList();
goto case 3;
}
case 3:
{
m_LastSacrificeGain = reader.ReadDeltaTime();
m_LastSacrificeLoss = reader.ReadDeltaTime();
m_AvailableResurrects = reader.ReadInt();
goto case 2;
}
case 2:
{
m_Flags = (PlayerFlag)reader.ReadInt();
goto case 1;
}
case 1:
{
m_LongTermElapse = reader.ReadTimeSpan();
m_ShortTermElapse = reader.ReadTimeSpan();
m_GameTime = reader.ReadTimeSpan();
goto case 0;
}
case 0:
{
break;
}
}

if ( m_IgnoreList == null )
m_IgnoreList = new ArrayList();

if ( m_PermaFlags == null )
m_PermaFlags = new ArrayList();

if ( m_JusticeProtectors == null )
m_JusticeProtectors = new ArrayList();

if ( m_BOBFilter == null )
m_BOBFilter = new Engines.BulkOrders.BOBFilter();

ArrayList list = this.Stabled;

for ( int i = 0; i < list.Count; ++i )
{
BaseCreature bc = list as BaseCreature;

if ( bc != null )
bc.IsStabled = true;
}
}

public override void Serialize( GenericWriter writer )
{
//cleanup our anti-macro table
foreach ( Hashtable t in m_AntiMacroTable.Values )
{
ArrayList remove = new ArrayList();
foreach ( CountAndTimeStamp time in t.Values )
{
if ( time.TimeStamp + SkillCheck.AntiMacroExpire <= DateTime.Now )
remove.Add( time );
}

for (int i=0;i<remove.Count;++i)
t.Remove( remove );
}

//decay our kills
if ( m_ShortTermElapse < this.GameTime )
{
m_ShortTermElapse += TimeSpan.FromHours( 8 );
if ( ShortTermMurders > 0 )
--ShortTermMurders;
}

if ( m_LongTermElapse < this.GameTime )
{
m_LongTermElapse += TimeSpan.FromHours( 40 );
if ( Kills > 0 )
--Kills;
}

base.Serialize( writer );

writer.Write( (int) 16 ); // version

writer.Write( (bool) Onshow );

writer.WriteEncodedInt( m_CompassionGains );

if ( m_CompassionGains > 0 )
writer.WriteDeltaTime( m_NextCompassionDay );

// Omega Red - possession
//writer.Write( (int) 14 ); // version - previous was 13

writer.Write( (Mobile) m_PossessMob);
writer.Write( (Mobile) m_PossessStorageMob);
// END possesion

m_BOBFilter.Serialize( writer );

bool useMods = ( m_HairModID != -1 || m_BeardModID != -1 );

writer.Write( useMods );

if ( useMods )
{
writer.Write( (int) m_HairModID );
writer.Write( (int) m_HairModHue );
writer.Write( (int) m_BeardModID );
writer.Write( (int) m_BeardModHue );
}

writer.Write( SavagePaintExpiration );

writer.Write( (int) m_NpcGuild );
writer.Write( (DateTime) m_NpcGuildJoinTime );
writer.Write( (TimeSpan) m_NpcGuildGameTime );

writer.WriteMobileList( m_PermaFlags, true );

writer.Write( NextTailorBulkOrder );

writer.Write( NextSmithBulkOrder );

writer.WriteDeltaTime( m_LastJusticeLoss );
writer.WriteMobileList( m_JusticeProtectors, true );

writer.WriteDeltaTime( m_LastSacrificeGain );
writer.WriteDeltaTime( m_LastSacrificeLoss );
writer.Write( m_AvailableResurrects );

writer.Write( (int) m_Flags );

writer.Write( m_LongTermElapse );
writer.Write( m_ShortTermElapse );
writer.Write( this.GameTime );
}
[/code:1]

[code:1]World: Saving...Warning:
System.ArgumentException: Value does not fall within the expected range.
at Server.ConsoleCommands.ProcessConsoleInput(String text)
at Server.Remote.ConsoleHook.OnOutput(String data, Boolean newline)
at Server.Remote.ConsoleCMD.RunUOConsole(Object state)
MyRunUO: Updating status database
MyRunUO: Status database updated in 0.0 seconds
MyRunUO: Updating status database
MyRunUO: Status database updated in 0.0 seconds
MyRunUO: Updating status database
MyRunUO: Status database updated in 0.0 seconds
MyRunUO: Updating status database
MyRunUO: Status database updated in 0.0 seconds
MyRunUO: Updating status database
MyRunUO: Status database updated in 0.0 seconds[/code:1]
 
S

Seven

Guest
So..anyone figure out how i make it so people when they log on they are automaticly visible? No one replied to that one guy yet.
 

Fury

Wanderer
that save warning has nothing to do with pmobile or this script.. looks like issues with some sort of remote console.
 

tristemfire

Wanderer
:D Just want to say thanx to everyone for all the great help and advice. I found the problem it was all user error something i over looked in playermobile. Fury you rock man keep up the great scripts. Look forward to seeing the next great script your gonna have.
 

mebane2

Wanderer
Fury said:
that save warning has nothing to do with pmobile or this script.. looks like issues with some sort of remote console.

Hmm, I do have the remote console script put in so I can do commands directly from the console or telnet. It didn't give the error before I added the messaging script so there must be some sort of conflict between the two. Hmmmmm. I don't use the console script much so I might just pull it. I still have another script in where I can do things from the server without connecting in game so I can just use that.
 

Fury

Wanderer
i use the frontend altered by sno.. in third party support.. ive never had any problems with it.
 

TimberRidge

Wanderer
mebane2 said:
Fury said:
that save warning has nothing to do with pmobile or this script.. looks like issues with some sort of remote console.

Hmm, I do have the remote console script put in so I can do commands directly from the console or telnet. It didn't give the error before I added the messaging script so there must be some sort of conflict between the two. Hmmmmm. I don't use the console script much so I might just pull it. I still have another script in where I can do things from the server without connecting in game so I can just use that.

You will find that remote console frequently crashes and corrupts your player data. I've noticed with with save and shutdown and also if you perform a back to back save without a LOT of inbetween time.

One save here and there, won't cause a crash -- but I've lost a lot of player data from that remote console. Now I havent used the new version, if they updated it to beta 36 -- but thats just my experience with it. Nice idea, but the save crashes are a pain.
 

mebane2

Wanderer
Ya. I disabled the backup/save combo so backups are just manual. And don't use any of the shutdown/restart with save commands.

But still, I went in and just removed the console alltogether and put in the one Fury mentioned. It works for saving and msg broadcasting, though the section for account admin, and the other tabs doesn't seem to work. Not sure if I did something wrong or not when I compiled the code.

I will prob put back in just the backup.cs and maybe the logger files from console though. Having a backup helped me this time in addition to the automatic saves cause a conflict between the messsaging system, the console, and prob something else was resulting int he saves, AND automatic backup dirs getting deleted. So all I had was the backup I had before I added the messageing system. hehe
 
How would I change this script so it does not give the location where everyone is. If a player is in a dungeon it says what dungeon. Thats a pks dream. I have tryed looking over the code and I just dont see where it gets the info.
And I want to say this script is awesome! I love it!
 

Fury

Wanderer
in msggump.cs find these lines and remove or comment them out

[code:1] if(region == "")
{
AddLabelCropped( (int)((x + TextOffsetX) + (m.Name.Length * 7.5)), y, EntryWidth - TextOffsetX, EntryHeight, 1153, m.Deleted ? "(deleted)" : String.Format("[Unknown]") );
AddLabelCropped( (int)((x + TextOffsetX) + (m.Name.Length * 7.5) + 60 ), y, EntryWidth - TextOffsetX, EntryHeight, 1153, m.Deleted ? "(deleted)" : String.Format("[{0}]",map) );
}
else
{
AddLabelCropped( (int)((x + TextOffsetX) + (m.Name.Length * 7.5)), y, EntryWidth - TextOffsetX, EntryHeight, 1153, m.Deleted ? "(deleted)" : String.Format("[{0}]",region) );
AddLabelCropped( (int)((x + TextOffsetX) + (m.Name.Length * 7.5) + (region.Length * 7.5)), y, EntryWidth - TextOffsetX, EntryHeight, 1153, m.Deleted ? "(deleted)" : String.Format("[{0}]",map) );
}[/code:1]

i added it for my shard because with a mid sized player base and all maps in use it makes pvp (seeking out rival guilds etc) almost impossible without it.
 

Crackerjack

Wanderer
After implementing the script everything started fine. I saved, shutdown and restarted the server and got the following error:

[code:1]
Scripts: Compiling C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling VB.net scripts...no files found.
Scripts: Verifying...done (1407 items, 414 mobiles)
World: Loading...An error was encountered while loading a saved object
- Type: Server.Mobiles.PlayerMobile
- Serial: 0x00000518
Delete the object? (y/n)
[/code:1]

I noticed that somebody else had this error, but Im still not understanding if my problem is with serializing/deserializing or something else.
 
Status
Not open for further replies.
Top