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!

FAQ Tutorial: Adding more AccessLevels

Khaz

Knight
I honestly can't explain it any easier than I did in the main post (otherwise I would've). I'll try and get the two inaccessible pictures re-uploaded so they work. :eek:
 

Killamus

Knight
Stupid question, can you post the exact location of mobile.cs? Cuz i searched for it via the search tool for XP, and nothin came up. erm, i unno if im missing sumthin or what...
 

CrazyJester

Wanderer
umm are you looking at the core source code? its in the root directory of that, its not in the scripts folder of the standard release... "~runuo-core-source-root~\mobile.cs"
 
Can u Help with Error?

I got an error here is the log:
RunUO - [www.runuo.com] Version 1.0.0, Build 40277
Scripts: Compiling C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling VB.net scripts...no files found.
Scripts: Verifying...Error:
System.Reflection.ReflectionTypeLoadException: One or more of the types in the a
ssembly unable to load.
at System.Reflection.Module.GetTypesInternal(StackCrawlMark& stackMark)
at System.Reflection.Assembly.GetTypes()
at Server.Core.VerifySerialization(Assembly a)
at Server.Core.VerifySerialization()
at Server.ScriptCompiler.Compile(Boolean debug)
at Server.Core.Main(String[] args)
This exception is fatal, press return to exit
I put the server.exe in the root dir. Don't know why it says no scripts?
 

Khaz

Knight
You have all of the regular 1.0.0 distribution files in the same directory as your Server executable, right? What have you changed in the Core?
 
Changes I Made

Code:
[b][size=2][color=#0000ff]public [/color][/size][size=2][color=#ff0000]enum [/b][/color][/size][size=2]AccessLevel[/size]
[size=2][color=#006400]{[/color][/size]
[size=2][color=#000000]Player [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#00008b]0[/color][/size][size=2][color=#006400], [/color][/size]
[size=2][color=#000000]Counselor [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#00008b]1[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#000000]GameMaster [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#00008b]2[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#000000]Scriptor [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#00008b]3[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#000000]Oracle [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#00008b]4[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#000000]Seer [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#00008b]5[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#000000]Overseer [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#00008b]6[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#000000]MasterScriptor [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#00008b]7[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#000000]Administrator [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#00008b]8 [/color][/size]
[size=2][color=#006400]}[/color][/size]

It appears called: SharpDevelop.exe and I renamed it to: Server.exe Then put it in the directory of the original server.exe.
 

Khaz

Knight
Did you follow Step #7 or not? Your "listed additions" above doesn't include strings for the access levels.
 
Step 7

Code:
[b][size=2][color=#0000ff]private [/b][/color][/size][size=2][color=#a52a2a]static [/color][/size][size=2][color=#ff0000]string[/color][/size][size=2][color=#006400][] [/color][/size][size=2]m_AccessLevelNames [/size][size=2][color=#006400]= [/color][/size][b][size=2][color=#008b8b]new [/b][/color][/size][size=2][color=#ff0000]string[/color][/size][size=2][color=#006400][][/color][/size]
[size=2][color=#006400]{[/color][/size]
[size=2][color=#ff00ff]"a player"[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#ff00ff]"a counselor"[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#ff00ff]"a game master"[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#ff00ff]"a scriptor"[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#ff00ff]"an oracle"[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#ff00ff]"a seer"[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#ff00ff]"an overseer"[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#ff00ff]"a master scriptor"[/color][/size][size=2][color=#006400],[/color][/size]
[size=2][color=#ff00ff]"an administrator"[/color][/size]
[size=2][color=#006400]};[/color][/size]
Here are the other changes i did.
 

Khaz

Knight
Run through the tutorial again, step by step, and make sure you nail each piece on the head. Ensure that you're plugging the whole of the Core download into the Project -- you can see what's included in the .prjx or .cmb file when you load SharpDevelop and open the Projects tab.

Once that's done, make sure you've got everything in the right directory after compiling the executable. Scripts in the root Scripts folder, Data where it belongs, a Server.exe.config file (possibly not needed; haven't tried without it), and the rest of the shibang.
 
Server.exe

OK I got the .exe to work but the access level list in the [admin gump doesn't display the proper names. I tried this but I got errors:
Code:
[b][size=2][color=#0000ff]private [/b][/color][/size][size=2][color=#a52a2a]static [/color][/size][b][size=2][color=#ff0000]int[/b][/color][/size][size=2][color=#006400][] [/color][/size][size=2]AccessOffsets [/size][size=2][color=#006400]= [/color][/size][b][size=2][color=#008b8b]new [/color][/size][size=2][color=#ff0000]int[/b][/color][/size][size=2][color=#006400][][/color][/size]
[size=2][color=#006400]{[/color][/size]
[size=2][color=#00008b]0[/color][/size][size=2][color=#006400], [/color][/size][size=2][color=#008000]//AccessLevel.Player //remains zero[/color][/size]
[size=2][color=#00008b]1[/color][/size][size=2][color=#006400], [/color][/size][size=2][color=#008000]//AccessLevel.Counselor //remains 1[/color][/size]
[size=2][color=#00008b]2[/color][/size][size=2][color=#006400], [/color][/size][size=2][color=#008000]//AccessLevel.GameMaster //remains 2[/color][/size]
[size=2][color=#00008b]3[/color][/size][size=2][color=#006400], [/color][/size][size=2][color=#008000]//AccessLevel.Scriptor //remains 3[/color][/size]
[size=2][color=#00008b]4[/color][/size][size=2][color=#006400], [/color][/size][size=2][color=#008000]//AccessLevel.Oracle //changed to 5[/color][/size]
[size=2][color=#00008b]5[/color][/size][size=2][color=#006400], [/color][/size][size=2][color=#008000]//AccessLevel.Seer //remains 3[/color][/size]
[size=2][color=#00008b]6[/color][/size][size=2][color=#006400], [/color][/size][size=2][color=#008000]//AccessLevel.Overseer //changed to 5[/color][/size]
[size=2][color=#00008b]7[/color][/size][size=2][color=#006400], [/color][/size][size=2][color=#008000]//AccessLevel.MasterScriptor //remains 3[/color][/size]
[size=2][color=#00008b]8[/color][/size][size=2][color=#006400], [/color][/size][size=2][color=#008000]//AccessLevel.Administrator //changed to 5[/color][/size]
[size=2][color=#006400]};[/color][/size]
[b][size=2][color=#0000ff]public [/b][/color][/size][size=2][color=#a52a2a]static [/color][/size][size=2][color=#ff0000]void [/color][/size][b][size=2][color=#191970]Initialize[/b][/color][/size][size=2][color=#006400]()[/color][/size]
[size=2][color=#006400]{[/color][/size]
[size=2][color=#000000]Commands[/color][/size][size=2][color=#006400].[/color][/size][b][size=2][color=#191970]Register[/b][/color][/size][size=2][color=#006400]( [/color][/size][size=2][color=#ff00ff]"FixAccess"[/color][/size][size=2][color=#006400], [/color][/size][size=2][color=#000000]AccessLevel[/color][/size][size=2][color=#006400].[/color][/size][size=2][color=#000000]Administrator[/color][/size][size=2][color=#006400], [/color][/size][b][size=2][color=#008b8b]new [/color][/size][/b]
[b][size=2][color=#191970]ommandEventHandler[/b][/color][/size][size=2][color=#006400]( [/color][/size][size=2][color=#000000]Online_OnCommand [/color][/size][size=2][color=#006400]) );  [/color][color=blue]<--FixAccess here (opps)[/color][/size]
[size=2][color=#006400]}[/color][/size]
[b][size=2][color=#0000ff]private [/b][/color][/size][size=2][color=#a52a2a]static [/color][/size][size=2][color=#ff0000]void [/color][/size][b][size=2][color=#191970]FixAcces_OnCommand[/b][/color][/size][size=2][color=#006400]( [/color][/size][size=2][color=#000000]CommandEventArgs e [/color][/size][size=2][color=#006400])[/color][/size]
[size=2][color=#006400]{[/color][/size]
[size=2][color=#000000]ArrayList mobiles [/color][/size][size=2][color=#006400]= [/color][/size][b][size=2][color=#008b8b]new [/color][/size][size=2][color=#191970]ArrayList[/b][/color][/size][size=2][color=#006400]( [/color][/size][size=2][color=#000000]World[/color][/size][size=2][color=#006400].[/color][/size][size=2][color=#000000]Mobiles[/color][/size][size=2][color=#006400].[/color][/size][size=2][color=#000000]Values [/color][/size][size=2][color=#006400]);[/color][/size]
[b][size=2][color=#0000ff]for[/b][/color][/size][size=2][color=#006400]( [/color][/size][b][size=2][color=#ff0000]int [/b][/color][/size][size=2][color=#000000]i [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#00008b]0[/color][/size][size=2][color=#006400]; [/color][/size][size=2][color=#000000]i [/color][/size][size=2][color=#006400]< [/color][/size][size=2][color=#000000]mobiles[/color][/size][size=2][color=#006400].[/color][/size][size=2][color=#000000]Count[/color][/size][size=2][color=#006400]; ++[/color][/size][size=2][color=#000000]i [/color][/size][size=2][color=#006400])[/color][/size]
[size=2][color=#006400]{[/color][/size]
[size=2][color=#000000]Mobile m [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#000000]mobiles[/color][/size][size=2][color=#006400][[/color][/size][size=2][color=#000000]i[/color][/size][size=2][color=#006400]] [/color][/size][b][size=2][color=#008b8b]as [/b][/color][/size][size=2][color=#000000]Mobile[/color][/size][size=2][color=#006400];[/color][/size]
[b][size=2][color=#ff0000]int [/b][/color][/size][size=2][color=#000000]newOffset [/color][/size][size=2][color=#006400]= [/color][/size][size=2][color=#000000]AccessOffsets[/color][/size][size=2][color=#006400][[/color][/size][size=2][color=#000000]m[/color][/size][size=2][color=#006400].[/color][/size][size=2][color=#000000]AccessLevel[/color][/size][size=2][color=#006400]];[/color][/size]
[size=2][color=#000000]m[/color][/size][size=2][color=#006400].[/color][/size][size=2][color=#000000]AccessLevel [/color][/size][size=2][color=#006400]= ([/color][/size][size=2][color=#000000]AccessLevel[/color][/size][size=2][color=#006400])[/color][/size][size=2][color=#000000]newOffset[/color][/size][size=2][color=#006400];[/color][/size]
[size=2][color=#006400]}[/color][/size]
[size=2][color=#006400]}[/color][/size]

Error #1: The Online_OnCommand does not exist in class.
Error #2: Cannont implicitly convert type server.Accesslevel to int.

Any ideas?

*Edit: I fixed the first error, but still have the second one.
 

Khaz

Knight
Try this:
Code:
public static void FixAcces_OnCommand( CommandEventArgs e )
{ 
	ArrayList mobiles = new ArrayList( World.Mobiles.Values ); 
	
	for( int i = 0; i < mobiles.Count; ++i ) 
	{ 
		Mobile m = mobiles[i] as Mobile; 
		
		int currLevel = (int)m.AccessLevel;

		int newOffset = AccessOffsets[currLevel];
		
		currLevel = newOffset; 
	}
}
 

DaZiL

Wanderer
Whoa..

Omg, i never knew how the sourecode worked.. and holy cow there are so many things i could do with it! :D Thanks for pointed this out with sharp develope its handy!

But...

I only touched the accesslevels and it seems that my Server.exe keeps crashing.. Error:

Code:
RunUO - [www.runuo.com] Version 1.0.0, Build 35109
Scripts: Compiling C# scripts...done (0 errors, 0 warnings)
Scripts: Compiling VB.net scripts...no files found.
Scripts: Verifying...Error:
System.Reflection.ReflectionTypeLoadException: One or more of the types in the a
ssembly unable to load.
   at System.Reflection.Module.GetTypesInternal(StackCrawlMark& stackMark)
   at System.Reflection.Assembly.GetTypes()
   at Server.Core.VerifySerialization(Assembly a)
   at Server.Core.VerifySerialization()
   at Server.ScriptCompiler.Compile(Boolean debug)
   at Server.Core.Main(String[] args)
This exception is fatal, press return to exit
Here's my mobile.cs
Code:
	public enum AccessLevel
	{
		Player = 0,
		Counselor = 1,
		Seer = 2,
		SeniorCounselor = 3,
		GameMaster = 4,
		SeniorGamemaster = 5,
		Administrator = 6,
		SeniorAdministrator = 7,
		ShardOwner = 8
	}
part 2
Code:
		private static string[] m_AccessLevelNames = new string[]
			{
				"a player",
				"a counselor",
				"a seer",
				"a senior counselor",
				"a game master",
				"a senior gamemaster",
				"an administrator",
				"a senior administrator",
				"a shard owner"
			};

All help would be appreciated. Maybe ill try redownloading the sourcecode, and doing the steps over again, see if that'll do anything.. doubt it tho, in return thanks.
- DaZiL
 

DaZiL

Wanderer
how strange.. i re-did those exact steps to find this time it worked... Hmm, woot for me! Maybe something was corrupted in the other sourcecode, anyhoo's its fixed now.

-DaZiL
 

Bugbear_1

Sorceror
With the new rank structure would that allow for lvl 5-8 to have more freedom and access to functionality around the world and to have button commands for just about anything in game... Just a question as <cough> I am a noob but in age high enough lol to try to understand this....
 

Khaz

Knight
Bugbear_1 said:
With the new rank structure would that allow for lvl 5-8 to have more freedom and access to functionality around the world and to have button commands for just about anything in game... Just a question as <cough> I am a noob but in age high enough lol to try to understand this....

No. Commands are designated by access level, and most of them are set to AccessLevel.Counselor or AccessLevel.GameMaster. Anything "beneath" the accesslevel wouldn't be able to use the command, so if you insert a Legend level between player and counselor, they won't have access to any normal staff commands. However, as Crepti and others discovered, anything not at player level will require some changes in order to prevent them from staying hidden while moving and doing various other 'staff' things. We worked through and fixed those up here and in the subscriber thread Crepti posted a while back.
 

Bugbear_1

Sorceror
Actually that makes perfect sense to me now. I see that by changing the levels it would then allow any players that are brought into the world and made say a gm then they couldnt go screwing up the things that the shard owner wanted to stay one way. And this allows for better control by the shard owner on his/her shard..... Thanks that made alot more sense to me hehe
 

omagaalpha

Wanderer
hey foolow all step when compile came up with Drawing,Windows, Color,Graphics,Bitmap could not be found
I use .net 2003
 

Khaz

Knight
I have never used VS.Net, and this guide was written for SharpDevelop. It's free, so if no one else can help you could download it temporarily ;)
 
Top