本文整理汇总了C#中Server.Network.NetState.WriteConsole方法的典型用法代码示例。如果您正苦于以下问题:C# NetState.WriteConsole方法的具体用法?C# NetState.WriteConsole怎么用?C# NetState.WriteConsole使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Network.NetState
的用法示例。
在下文中一共展示了NetState.WriteConsole方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DisplayGumpResponse
public static void DisplayGumpResponse( NetState state, PacketReader pvSrc ) {
int serial = pvSrc.ReadInt32();
int typeID = pvSrc.ReadInt32();
int buttonID = pvSrc.ReadInt32();
foreach ( Gump gump in state.Gumps ) {
if ( gump.Serial == serial && gump.TypeID == typeID ) {
int switchCount = pvSrc.ReadInt32();
if ( switchCount < 0 || switchCount > gump.m_Switches ) {
state.WriteConsole( "Invalid gump response, disconnecting..." );
state.Dispose();
return;
}
int[] switches = new int[switchCount];
for ( int j = 0; j < switches.Length; ++j )
switches[j] = pvSrc.ReadInt32();
int textCount = pvSrc.ReadInt32();
if ( textCount < 0 || textCount > gump.m_TextEntries ) {
state.WriteConsole( "Invalid gump response, disconnecting..." );
state.Dispose();
return;
}
TextRelay[] textEntries = new TextRelay[textCount];
for ( int j = 0; j < textEntries.Length; ++j ) {
int entryID = pvSrc.ReadUInt16();
int textLength = pvSrc.ReadUInt16();
if ( textLength > 239 ) {
state.WriteConsole( "Invalid gump response, disconnecting..." );
state.Dispose();
return;
}
string text = pvSrc.ReadUnicodeStringSafe( textLength );
textEntries[j] = new TextRelay( entryID, text );
}
state.RemoveGump( gump );
GumpProfile prof = GumpProfile.Acquire( gump.GetType() );
if ( prof != null ) {
prof.Start();
}
gump.OnResponse( state, new RelayInfo( buttonID, switches, textEntries ) );
if ( prof != null ) {
prof.Finish();
}
return;
}
}
if ( typeID == 461 ) { // Virtue gump
int switchCount = pvSrc.ReadInt32();
if ( buttonID == 1 && switchCount > 0 ) {
Mobile beheld = World.FindMobile( pvSrc.ReadInt32() );
if ( beheld != null ) {
EventSink.InvokeVirtueGumpRequest( new VirtueGumpRequestEventArgs( state.Mobile, beheld ) );
}
} else {
Mobile beheld = World.FindMobile( serial );
if ( beheld != null ) {
EventSink.InvokeVirtueItemRequest( new VirtueItemRequestEventArgs( state.Mobile, beheld, buttonID ) );
}
}
}
}