本文整理汇总了C#中Server.Server类的典型用法代码示例。如果您正苦于以下问题:C# Server类的具体用法?C# Server怎么用?C# Server使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Server类属于Server命名空间,在下文中一共展示了Server类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
/// <summary>
/// Serialization
/// </summary>
protected override void Serialize( Server.GenericWriter writer )
{
base.Serialize(writer);
writer.Write((int)1); //version
writer.Write(Ambush);
}
示例2: OnResponse
public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
{
int val, type, index;
DecodeButtonId(info.ButtonID, out val, out type, out index);
if( val < 0 )
return;
switch( type )
{
case 1:
{
switch( index )
{
case 0: //purchase
{
Market.BuyItem(sender.Mobile, _entry);
break;
}
case 1: //go back
{
sender.Mobile.CloseGump(typeof(MarketDetailsGump));
break;
}
}
break;
}
}
}
示例3: OnResponse
public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
{
Mobile pm = ( Mobile )sender.Mobile;
if( pm == null )
return;
switch (info.ButtonID)
{
case 2:
{
TextRelay text = info.GetTextEntry( 1 );
if (text == null || text.Text == "")
{
pm.CloseGump(typeof(AccountSearch));
pm.SendGump(new AccountSearch());
return;
}
ArrayList authors = new ArrayList();
if (ForumCore.AuthorExists( out authors, text.Text))
{
pm.CloseGump( typeof(AccountListingGump));
pm.SendGump( new AccountListingGump( authors, 0 ) );
}
else
{
pm.SendMessage("Either that player does not exist, or no posts have been made by that player.");
}
break;
}
}
}
示例4: OnResponse
public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
{
switch ( info.ButtonID )
{
case 0: // Close Gump
{
MessagesTitle = "Delete Entry";
Messages = "You have chosen not to delete the entry.";
SetArgsList();
gumpMobile.SendGump( new EditSpawnGump( gumpMobile, ArgsList ) );
break;
}
case 1: // Delete Entry
{
if ( CheckProcess() )
break;
MSEGCheckBoxesList.RemoveAt( index );
megaSpawner.DeleteEntry( index );
MessagesTitle = "Delete Entry";
Messages = "Entry has been removed.";
SetArgsList();
gumpMobile.SendGump( new MegaSpawnerEditGump( gumpMobile, ArgsList ) );
break;
}
}
}
示例5: OnResponse
public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
{
if ( info.ButtonID == 1 )
{
AuctionSystem.ForceDelete( sender.Mobile );
}
}
示例6: ObjectWindow
public ObjectWindow(Server.Objects.Object objct)
{
InitializeComponent();
this.objct = objct;
this.Text = "View " + objct.Id;
refresher.RefreshTick += new EventHandler(refresher_RefreshTick);
}
示例7: OnResponse
public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
{
switch ( info.ButtonID )
{
case 0: // Close Gump
{
MessagesTitle = "Delete Account";
Messages = "You have chosen not to delete the account.";
SetArgsList();
gumpMobile.SendGump( new EditAccountGump( gumpMobile, ArgsList ) );
break;
}
case 1: // Delete Account
{
MC.AccountsList.RemoveAt( index );
MC.AccessList.RemoveAt( index );
MC.AdminMenuAccessList.RemoveAt( index );
MC.AccountEditors.RemoveAt( index );
MC.SaveAccountsAccess();
MessagesTitle = "Delete Account";
Messages = "Account has been removed.";
SetArgsList();
gumpMobile.SendGump( new AccountsManagementGump( gumpMobile, ArgsList ) );
break;
}
}
}
示例8: OnResponse
public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
{
Mobile m_Player = ( Mobile )sender.Mobile;
if( m_Player == null )
return;
switch( info.ButtonID )
{
case 1:
{
ForumCore.AutoCleanup = true;
m_Player.CloseGump( typeof( AdministrationGump ) );
m_Player.SendGump( new AdministrationGump( ) );
break;
}
case 2:
{
ForumCore.AutoCleanup = false;
m_Player.CloseGump( typeof( AdministrationGump ) );
m_Player.SendGump( new AdministrationGump( ) );
break;
}
}
}
示例9: OnResponse
public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
{
if ( ! m_Buttons.Contains( info.ButtonID ) )
{
Console.WriteLine( @"The auction system located a potential exploit.
Player {0} (Acc. {1}) tried to press an unregistered button in a gump of type: {2}",
sender.Mobile != null ? sender.Mobile.ToString() : "Unkown",
sender.Mobile != null && sender.Mobile.Account != null ? ( sender.Mobile.Account as Server.Accounting.Account ).Username : "Unkown",
this.GetType().Name );
return;
}
if ( ! AuctionSystem.Running )
{
sender.Mobile.SendMessage( AuctionSystem.MessageHue, AuctionSystem.ST[ 15 ] );
return;
}
switch ( info.ButtonID )
{
case 0: // Exit
break;
case 1: // Create auction
AuctionSystem.AuctionRequest( sender.Mobile );
break;
case 2: // View all auctions
sender.Mobile.SendGump( new AuctionListing(
sender.Mobile,
AuctionSystem.Auctions,
true,
true ) );
break;
case 3: // View your auctions
sender.Mobile.SendGump( new AuctionListing(
sender.Mobile, AuctionSystem.GetAuctions( sender.Mobile ), true, true ) );
break;
case 4: // View your bids
sender.Mobile.SendGump( new AuctionListing(
sender.Mobile, AuctionSystem.GetBids( sender.Mobile ), true, true ) );
break;
case 5: // View pendencies
sender.Mobile.SendGump( new AuctionListing(
sender.Mobile, AuctionSystem.GetPendencies( sender.Mobile ), true, true ) );
break;
}
}
示例10: OnResponse
public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
{
string web = null;
switch ( info.ButtonID )
{
case 1 : web = "http://www.chessvariants.com/d.chess/chess.html";
break;
case 2 : web = "http://www.chessvariants.com/d.chess/faq.html";
break;
case 3 : web = "http://www.chessvariants.com/d.chess/matefaq.html";
break;
case 4 : web = "http://www.chessvariants.com/d.chess/castlefaq.html";
break;
case 5 : web = "http://www.chessvariants.com/d.chess/enpassant.html";
break;
case 6 : web = "http://www.chessvariants.com/d.chess/pawnfaq.html";
break;
case 7 : web = "http://www.chessvariants.com/d.chess/knightfaq.html";
break;
case 8 : web = "http://www.chessvariants.com/d.chess/queenfaq.html";
break;
case 9 : web = "http://www.chessvariants.com/d.chess/kingfaq.html";
break;
}
if ( web != null )
{
sender.Mobile.LaunchBrowser( web );
sender.Mobile.SendGump( this );
}
}
示例11: OnResponse
public override void OnResponse( Server.Network.NetState sender, RelayInfo info )
{
if( info.ButtonID == 0 )
{
_from.SendLocalizedMessage( 501235, "", 0x35 ); //Help request aborted.
return;
}
else
{
TextRelay txtEntry = info.GetTextEntry( 0 );
string text = (txtEntry == null ? "" : txtEntry.Text);
if( text.Length == 0 )
{
_from.SendMessage( 0x35, "You must enter a description of your problem." );
_from.SendGump( new PagePromptGump( _from, _type ) );
}
else
{
_from.SendMessage( 0x35, "The next available staff member will be with you as soon as possible. If your issue is resolved early, please revoke it from the page queue. To check the statue of your page, type \'[CheckPage\'." );
PageQueue.AddNewPage( new PageEntry( _from, text, _type ) );
}
}
}
示例12: ClearGuildListeners_OnCommand
public static void ClearGuildListeners_OnCommand( Server.Commands.CommandEventArgs args )
{
if( _table.ContainsKey( args.Mobile ) )
_table.Remove( args.Mobile );
args.Mobile.SendMessage( "You are no longer listening to any private guild chat." );
}
示例13: Main
static void Main(string[] args)
{
var server = new Server();
server.LoadConfig();
server.Run();
Console.ReadLine();
}
示例14: FindRunes_OnCommand
public static void FindRunes_OnCommand( Server.Commands.CommandEventArgs e )
{
foreach ( Item item in World.Items.Values )
{
if ( item is RecallRune )
{
RecallRune rune = (RecallRune)item;
if ( rune.Marked && rune.TargetMap != null && IsBad( rune.Target, rune.TargetMap ) )
{
object root = item.RootParent;
if ( root is Mobile )
{
if ( ((Mobile)root).AccessLevel < AccessLevel.GameMaster )
e.Mobile.SendAsciiMessage( "Rune: '{4}' {0} [{1}]: {2} ({3})", item.GetWorldLocation(), item.Map, root.GetType().Name, ((Mobile)root).Name, rune.Description );
}
else
{
e.Mobile.SendAsciiMessage( "Rune: '{3}' {0} [{1}]: {2}", item.GetWorldLocation(), item.Map, root==null ? "(null)" : root.GetType().Name, rune.Description );
}
}
}
}
}
示例15: OnResponse
public override void OnResponse(Server.Network.NetState sender, RelayInfo info)
{
if ( m_IsOwner )
{
if ( info.ButtonID == 3 )
{
// Switch the allow spectators flag
m_Game.AllowSpectators = !m_AllowSpectators;
sender.Mobile.SendGump( new StartGameGump( sender.Mobile, m_Game, m_IsOwner, !m_AllowSpectators ) );
}
else if ( info.ButtonID == 2 )
{
m_Game.CancelGameStart( sender.Mobile );
}
else if ( info.ButtonID == 1 )
{
sender.Mobile.Target = new ChessTarget( m_Game, sender.Mobile, "Please select your partner...",
new ChessTargetCallback( m_Game.ChooseOpponent ) );
sender.Mobile.SendGump( new StartGameGump( sender.Mobile, m_Game, m_IsOwner, m_AllowSpectators ) );
}
}
else
{
if ( info.ButtonID == 2 )
{
m_Game.CancelGameStart( sender.Mobile );
}
else if ( info.ButtonID == 1 )
{
m_Game.AcceptGame( sender.Mobile );
}
}
}