本文整理匯總了C#中Server.Network.PacketReader.ReadUnicodeString方法的典型用法代碼示例。如果您正苦於以下問題:C# PacketReader.ReadUnicodeString方法的具體用法?C# PacketReader.ReadUnicodeString怎麽用?C# PacketReader.ReadUnicodeString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.Network.PacketReader
的用法示例。
在下文中一共展示了PacketReader.ReadUnicodeString方法的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: ChatAction
public static void ChatAction( NetState state, PacketReader pvSrc )
{
if ( !m_Enabled )
return;
try
{
Mobile from = state.Mobile;
ChatUser user = ChatUser.GetChatUser( from );
if ( user == null )
return;
/*string lang = */pvSrc.ReadStringSafe( 4 );
int actionID = pvSrc.ReadInt16();
string param = pvSrc.ReadUnicodeString();
ChatActionHandler handler = ChatActionHandlers.GetHandler( actionID );
if ( handler != null )
{
Channel channel = user.CurrentChannel;
if ( handler.RequireConference && channel == null )
{
user.SendMessage( 31 ); /* You must be in a conference to do this.
* To join a conference, select one from the Conference menu.
*/
}
else if ( handler.RequireModerator && !user.IsModerator )
{
user.SendMessage( 29 ); // You must have operator status to do this.
}
else
{
handler.Callback( user, channel, param );
}
}
else
{
log.Warn(String.Format("Client: {0}: Unknown chat action 0x{1:X}: {2}",
state, actionID, param));
}
}
catch ( Exception e )
{
log.Error( e );
}
}
示例2: ChatAction
public static void ChatAction( NetState state, PacketReader pvSrc )
{
if ( !Enabled )
return;
try
{
Mobile from = state.Mobile;
ChatUser user = ChatUser.GetChatUser( from );
if ( user == null )
return;
string lang = pvSrc.ReadStringSafe( 4 );
int actionId = pvSrc.ReadInt16();
string param = pvSrc.ReadUnicodeString();
ChatActionHandler handler = ChatActionHandlers.GetHandler( actionId );
if ( handler != null )
{
Channel channel = user.CurrentChannel;
if ( handler.RequireConference && channel == null )
{
/* You must be in a conference to do this.
* To join a conference, select one from the Conference menu.
*/
user.SendMessage( 31 );
}
else
{
handler.Callback( user, channel, param );
}
}
else
{
Console.WriteLine( "Client: {0}: Unknown chat action 0x{1:X}: {2}", state, actionId, param );
}
}
catch ( Exception e )
{
Console.WriteLine(e.ToString());
}
}
示例3: ProfileReq
public static void ProfileReq( NetState state, PacketReader pvSrc )
{
int type = pvSrc.ReadByte();
Serial serial = pvSrc.ReadInt32();
Mobile beholder = state.Mobile;
Mobile beheld = World.FindMobile( serial );
if ( beheld == null )
return;
switch ( type )
{
case 0x00: // display request
{
EventSink.InvokeProfileRequest( new ProfileRequestEventArgs( beholder, beheld ) );
break;
}
case 0x01: // edit request
{
pvSrc.ReadInt16(); // Skip
int length = pvSrc.ReadUInt16();
if ( length > 511 )
return;
string text = pvSrc.ReadUnicodeString( length );
EventSink.InvokeChangeProfileRequest( new ChangeProfileRequestEventArgs( beholder, beheld, text ) );
break;
}
}
}
示例4: DisplayWaipoint3D
// UOSA
public static void DisplayWaipoint3D(NetState state, PacketReader pvSrc)
{
int size = pvSrc.ReadInt16();
int obj_serial = pvSrc.ReadInt32();
int x = pvSrc.ReadInt16();
int y = pvSrc.ReadInt16();
int z = pvSrc.ReadSByte();
int mapID = pvSrc.ReadByte();
int obj_type = pvSrc.ReadInt16();
int ignore_obj_type = pvSrc.ReadByte();
int obj_cliloc = pvSrc.ReadInt32();
string obj_cliloc_args = pvSrc.ReadUnicodeString();
int unk1 = pvSrc.ReadInt16();
//no complete
if (ignore_obj_type == 1)
{
}
}
示例5: ChatAction
public static void ChatAction(NetState state, PacketReader pvSrc)
{
/*if ( !m_Enabled )
return;
*/
if (state == null || state.Mobile == null || state.Account == null)
return;
try
{
/*
ChatUser user = ChatUser.GetChatUser( from );
if ( user == null )
return;
*/
string lang = pvSrc.ReadStringSafe(4);
int actionID = pvSrc.ReadInt16();
string param = pvSrc.ReadUnicodeString();
/*
ChatActionHandler handler = ChatActionHandlers.GetHandler( actionID );
if ( handler != null )
{
Channel channel = user.CurrentChannel;
if ( handler.RequireConference && channel == null )
{
user.SendMessage( 31 ); // You must be in a conference to do this.
// To join a conference, select one from the Conference menu.
}
else if ( handler.RequireModerator && !user.IsModerator )
{
user.SendMessage( 29 ); // You must have operator status to do this.
}
else
{
handler.Callback( user, channel, param );
}
}
else
{
Console.WriteLine( "Client: {0}: Unknown chat action 0x{1:X}: {2}", state, actionID, param );
}*/
// CUSTOM CODE for uoforever--Chat b/w mobs with the same teamflags
Mobile from = state.Mobile;
List<XmlTeam> fromTeams = XmlAttach.GetTeams(from);
if (fromTeams != null)
{
List<NetState> states = NetState.Instances;
foreach (NetState nextstate in states)
{
if (nextstate.Mobile == null) continue;
if (nextstate.Mobile.AccessLevel >= AccessLevel.GameMaster)
{
// just get the first team
nextstate.Mobile.SendMessage(101, "[" + fromTeams[0].TeamVal + "] " + from.Name + ": " + param);
}
else
{
if (nextstate.Mobile.CustomTeam)
{
List<XmlTeam> toTeams = XmlAttach.GetTeams(nextstate.Mobile);
if (XmlTeam.SameTeam(fromTeams, toTeams))
{
nextstate.Mobile.SendMessage(101, from.Name + ": " + param);
}
}
}
}
}
else if (from.AccessLevel >= AccessLevel.Counselor
|| CreaturePossession.HasAnyPossessPermissions(from))
{
List<NetState> states = NetState.Instances;
Mobile sourceMobile = from;
if (from is BaseCreature)
{
sourceMobile = state.Account.GetPseudoSeerLastCharacter();
}
if (sourceMobile != null)
{
foreach (NetState nextstate in states)
{
if (nextstate.Mobile == null) continue;
if (nextstate.Mobile.AccessLevel >= AccessLevel.Counselor
|| CreaturePossession.HasAnyPossessPermissions(nextstate.Mobile))
{
// just get the first team
nextstate.Mobile.SendMessage(101, sourceMobile.Name + ": " + param);
}
else if (nextstate.Mobile is BaseCreature)
{
//.........這裏部分代碼省略.........