本文整理汇总了C#中Server.Server.GetInt32方法的典型用法代码示例。如果您正苦于以下问题:C# Server.GetInt32方法的具体用法?C# Server.GetInt32怎么用?C# Server.GetInt32使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Server
的用法示例。
在下文中一共展示了Server.GetInt32方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Animate_OnCommand
public static void Animate_OnCommand( Server.Commands.CommandEventArgs e )
{
if ( e.Length == 6 )
{
e.Mobile.Animate( e.GetInt32( 0 ), e.GetInt32( 1 ), e.GetInt32( 2 ), e.GetBoolean( 3 ), e.GetBoolean( 4 ), e.GetInt32( 5 ) );
}
else
{
e.Mobile.SendAsciiMessage( "Format: Animate <action> <frameCount> <repeatCount> <forward> <repeat> <delay>" );
}
}
示例2: Randomize_OnCommand
public static void Randomize_OnCommand( Server.Commands.CommandEventArgs args )
{
Mobile m = args.Mobile;
if( args.Length != 4 )
{
m.SendMessage( "Format: Randomize <starting itemID> <ending itemID> <Z level> <bool includeNonFlooring>" );
return;
}
int start = args.GetInt32( 0 );
int end = args.GetInt32( 1 );
int z = args.GetInt32( 2 );
bool walls = args.GetBoolean( 3 );
object[] state = new object[4] { start, end, z, walls };
BoundingBoxPicker.Begin( m, new BoundingBoxCallback( BoxPickerCallback ), state );
}
示例3: Execute
public override void Execute( Server.Commands.CommandEventArgs e, object obj )
{
Mobile from = e.Mobile;
if ( e.Length == 1 )
{
int index = e.GetInt32( 0 );
Mobile mob = (Mobile)obj;
CommandLogging.WriteLine( from, "{0} {1} playing sound {2} for {3}", from.AccessLevel, CommandLogging.Format( from ), index, CommandLogging.Format( mob ) );
mob.Send( new PlaySound( index, mob.Location ) );
}
else
{
from.SendMessage( "Format: PrivSound <index>" );
}
}
示例4: Go_OnCommand
private static void Go_OnCommand( Server.Commands.CommandEventArgs e )
{
Mobile from = e.Mobile;
if ( e.Length == 0 )
{
GoGump.DisplayTo( from );
}
else if ( e.Length == 1 )
{
try
{
int ser = e.GetInt32( 0 );
IEntity ent = World.FindEntity( ser );
if ( ent is Item )
{
Item item = (Item)ent;
Map map = item.Map;
Point3D loc = item.GetWorldLocation();
Mobile owner = item.RootParent as Mobile;
if ( owner != null && (owner.Map != null && owner.Map != Map.Internal) && !from.CanSee( owner ) )
{
from.SendAsciiMessage( "You can not go to what you can not see." );
return;
}
else if ( owner != null && (owner.Map == null || owner.Map == Map.Internal) && owner.Hidden && owner.AccessLevel >= from.AccessLevel )
{
from.SendAsciiMessage( "You can not go to what you can not see." );
return;
}
else if ( !FixMap( ref map, ref loc, item ) )
{
from.SendAsciiMessage( "That is an internal item and you cannot go to it." );
return;
}
from.MoveToWorld( loc, map );
return;
}
else if ( ent is Mobile )
{
Mobile m = (Mobile)ent;
Map map = m.Map;
Point3D loc = m.Location;
Mobile owner = m;
if ( owner != null && (owner.Map != null && owner.Map != Map.Internal) && !from.CanSee( owner ) )
{
from.SendAsciiMessage( "You can not go to what you can not see." );
return;
}
else if ( owner != null && (owner.Map == null || owner.Map == Map.Internal) && owner.Hidden && owner.AccessLevel >= from.AccessLevel )
{
from.SendAsciiMessage( "You can not go to what you can not see." );
return;
}
else if ( !FixMap( ref map, ref loc, m ) )
{
from.SendAsciiMessage( "That is an internal mobile and you cannot go to it." );
return;
}
from.MoveToWorld( loc, map );
return;
}
else
{
string name = e.GetString( 0 );
List<Region> list = new List<Region>(from.Map.Regions.Values);
for ( int i = 0; i < list.Count; ++i )
{
Region r = (Region)list[i];
if ( Insensitive.Equals( r.Name, name ) )
{
from.Location = new Point3D( r.GoLocation );
return;
}
}
if ( ser != 0 )
from.SendAsciiMessage( "No object with that serial was found." );
else
from.SendAsciiMessage( "No region with that name was found." );
return;
}
}
catch
//.........这里部分代码省略.........
示例5: Sound_OnCommand
public static void Sound_OnCommand( Server.Commands.CommandEventArgs e )
{
if ( e.Length == 1 )
PlaySound( e.Mobile, e.GetInt32( 0 ), true );
else if ( e.Length == 2 )
PlaySound( e.Mobile, e.GetInt32( 0 ), e.GetBoolean( 1 ) );
else
e.Mobile.SendAsciiMessage( "Format: Sound <index> [toAll]" );
}
示例6: Light_OnCommand
public static void Light_OnCommand( Server.Commands.CommandEventArgs e )
{
e.Mobile.LightLevel = e.GetInt32( 0 );
}
示例7: Light_OnCommand
private static void Light_OnCommand( Server.Commands.CommandEventArgs e )
{
if ( e.Length >= 1 )
{
LevelOverride = e.GetInt32( 0 );
e.Mobile.SendAsciiMessage( "Global light level override has been changed to {0}.", m_LevelOverride );
}
else
{
LevelOverride = int.MinValue;
e.Mobile.SendAsciiMessage( "Global light level override has been cleared." );
}
}
示例8: TileZ_OnCommand
public static void TileZ_OnCommand( Server.Commands.CommandEventArgs e )
{
if ( e.Length >= 2 )
{
string[] subArgs = new string[e.Length - 1];
for ( int i = 0; i < subArgs.Length; ++i )
subArgs[i] = e.Arguments[i + 1];
BoundingBoxPicker.Begin( e.Mobile, new BoundingBoxCallback( TileBox_Callback ), new TileState( e.GetInt32( 0 ), subArgs ) );
}
else
{
e.Mobile.SendMessage( "Format: TileZ <z> <type> [params] [set {<propertyName> <value> ...}]" );
}
}
示例9: TileXYZ_OnCommand
public static void TileXYZ_OnCommand( Server.Commands.CommandEventArgs e )
{
if ( e.Length >= 6 )
{
Point3D p = new Point3D( e.GetInt32( 0 ), e.GetInt32( 1 ), e.GetInt32( 4 ) );
Point3D p2 = new Point3D( p.X + e.GetInt32( 2 ) - 1, p.Y + e.GetInt32( 3 ) - 1, e.GetInt32( 4 ) );
string[] subArgs = new string[e.Length - 5];
for ( int i = 0; i < subArgs.Length; ++i )
subArgs[i] = e.Arguments[i + 5];
Add.Invoke( e.Mobile, p, p2, subArgs );
}
else
{
e.Mobile.SendMessage( "Format: TileXYZ <x> <y> <w> <h> <z> <type> [params] [set {<propertyName> <value> ...}]" );
}
}
示例10: Props_OnCommand
private static void Props_OnCommand( Server.Commands.CommandEventArgs e )
{
if ( e.Length == 1 )
{
IEntity ent = World.FindEntity( e.GetInt32( 0 ) );
if ( ent == null )
e.Mobile.SendMessage( "No object with that serial was found." );
else if ( !BaseCommand.IsAccessible( e.Mobile, ent ) )
e.Mobile.SendMessage( "That is not accessible." );
else
e.Mobile.SendGump( new PropertiesGump( e.Mobile, ent ) );
}
else
{
e.Mobile.Target = new PropsTarget( true );
}
}
示例11: CheckLos_OnCommand
public static void CheckLos_OnCommand( Server.Commands.CommandEventArgs args )
{
try
{
DateTime start = DateTime.Now;
ClearLOS_OnCommand( args );
LOSItemPacket.Reset();
Mobile m = args.Mobile;
Map map = m.Map;
int range = 12;
if ( args.Length > 0 )
range = args.GetInt32( 0 );
if ( range > 20 )
range = 20;
else if ( range < 1 )
range = 1;
m.SendMessage( "Calculating..." );
int minx, maxx;
int miny, maxy;
Point3D from = map.GetPoint( m, true );
minx = m.Location.X - range;
maxx = m.Location.X + range;
miny = m.Location.Y - range;
maxy = m.Location.Y + range;
for(int x=minx;x<=maxx;x++)
{
for (int y=miny;y<=maxy;y++)
{
{
LandTile tile = map.Tiles.GetLandTile(x, y);
ItemData id = TileData.ItemTable[tile.ID & 0x3FFF];
if (!tile.Ignored && id.Surface)
{
int z = tile.Z + id.CalcHeight;
Point3D loc = new Point3D(x, y, z);
int hue;
if (loc == m.Location)
hue = 0x35; // yellow
else if (map.LineOfSight(from, loc))
hue = 0x3F; // green
else
hue = 0x26; // red
m.Send(new LOSItemPacket(hue, loc));
}
}
StaticTile[] tiles = map.Tiles.GetStaticTiles(x, y, true);
for (int i = 0; i < tiles.Length; i++)
{
StaticTile tile = (StaticTile)tiles[i];
ItemData id = TileData.ItemTable[tile.ID & 0x3FFF];
if (id.Surface) // land doesnt use same flags, so just allow it
{
int z = tile.Z + id.CalcHeight;
Point3D loc = new Point3D(x, y, z);
int hue;
if (loc == m.Location)
hue = 0x35; // yellow
else if (map.LineOfSight(from, loc))
hue = 0x3F; // green
else
hue = 0x26; // red
m.Send(new LOSItemPacket(hue, loc));
}
}
}
}
m.SendAsciiMessage( "Completed LOS check in {0}s", (DateTime.Now-start).TotalSeconds );
}
catch ( Exception e )
{
args.Mobile.SendMessage( "CRASHED : {0}", e.Message );
}
}