本文整理汇总了C#中Server.Gumps.Gump.SendTo方法的典型用法代码示例。如果您正苦于以下问题:C# Gump.SendTo方法的具体用法?C# Gump.SendTo怎么用?C# Gump.SendTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Gumps.Gump
的用法示例。
在下文中一共展示了Gump.SendTo方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CloseAndSendGump
public static void CloseAndSendGump(NetState ns, Gump g, params Type[] types)
{
if (ns == null)
return;
for (int i = 0; i < types.Length; ++i)
ns.Send(new CloseGump(Gump.GetTypeID(types[i]), 0));
g.SendTo(ns);
/*ns.AddGump( g );
Packet[] packets = new Packet[types.Length + 1];
for ( int i = 0; i < types.Length; ++i )
packets[i] = new CloseGump( Gump.GetTypeID( types[i] ), 0 );
packets[types.Length] = (Packet) typeof( Gump ).InvokeMember( "Compile", BindingFlags.NonPublic | BindingFlags.Instance | BindingFlags.InvokeMethod, null, g, null, null );
bool compress = ns.CompressionEnabled;
ns.CompressionEnabled = false;
ns.Send( BindPackets( compress, packets ) );
ns.CompressionEnabled = compress;*/
}
示例2: SendGump
public bool SendGump( Gump g, bool throwOnOffline )
{
if ( m_NetState != null )
{
g.SendTo( m_NetState );
return true;
}
else if ( throwOnOffline )
{
throw new MobileNotConnectedException( this, "Gump could not be sent." );
}
else
{
return false;
}
}
示例3: SendGump
public bool SendGump( Gump g, bool throwOnOffline = false )
{
if ( m_Client == null )
{
if ( throwOnOffline )
throw new MobileNotConnectedException( this, "Gump could not be sent." );
return false;
}
g.SendTo( m_Client );
return true;
}