本文整理汇总了C#中Server.Engines.Chat.ChatUser.SendAsciiMessage方法的典型用法代码示例。如果您正苦于以下问题:C# ChatUser.SendAsciiMessage方法的具体用法?C# ChatUser.SendAsciiMessage怎么用?C# ChatUser.SendAsciiMessage使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.Engines.Chat.ChatUser
的用法示例。
在下文中一共展示了ChatUser.SendAsciiMessage方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddUser
public bool AddUser( ChatUser user, string password )
{
if ( Contains( user ) )
{
user.SendAsciiMessage( 46, m_Name ); // You are already in the conference '%1'.
return true;
}
else if ( IsBanned( user ) )
{
user.SendAsciiMessage( 64 ); // You have been banned from this conference.
return false;
}
else if ( !ValidatePassword( password ) )
{
user.SendAsciiMessage( 34 ); // That is not the correct password.
return false;
}
else
{
if ( user.CurrentChannel != null )
user.CurrentChannel.RemoveUser( user ); // Remove them from their current channel first
ChatSystem.SendCommandTo( user.Mobile, ChatCommand.JoinedChannel, m_Name );
SendCommand( ChatCommand.AddUserToChannel, user.GetColorCharacter() + user.Username );
m_Users.Add( user );
user.CurrentChannel = this;
if ( user.Mobile.AccessLevel >= AccessLevel.GameMaster || (!m_AlwaysAvailable && m_Users.Count == 1) )
AddModerator( user );
SendUsersTo( user );
return true;
}
}
示例2: AddVoiced
public void AddVoiced( ChatUser user, ChatUser moderator )
{
if ( !ValidateModerator( moderator ) )
return;
if ( !IsBanned( user ) && !IsModerator( user ) && !IsVoiced( user ) )
{
m_Voices.Add( user );
if ( moderator != null )
user.SendAsciiMessage( 54, moderator.Username ); // %1, a conference moderator, has granted you speaking priviledges in this conference.
SendAsciiMessage( 52, user, user.Username ); // %1 now has speaking privileges in this conference.
SendCommand( ChatCommand.AddUserToChannel, user, user.GetColorCharacter() + user.Username );
}
}
示例3: ChannelMessage
public static void ChannelMessage( ChatUser from, Channel channel, string param )
{
if ( channel.CanTalk( from ) )
channel.SendIgnorableMessage( 57, from, from.GetColorCharacter() + from.Username, param ); // %1: %2
else
from.SendAsciiMessage( 36 ); // The moderator of this conference has not given you speaking priviledges.
}
示例4: AddModerator
public void AddModerator( ChatUser user, ChatUser moderator )
{
if ( !ValidateModerator( moderator ) )
return;
if ( IsBanned( user ) || IsModerator( user ) )
return;
if ( IsVoiced( user ) )
m_Voices.Remove( user );
m_Moderators.Add( user );
if ( moderator != null )
user.SendAsciiMessage( 50, moderator.Username ); // %1 has made you a conference moderator.
SendAsciiMessage( 48, user, user.Username ); // %1 is now a conference moderator.
SendCommand( ChatCommand.AddUserToChannel, user.GetColorCharacter() + user.Username );
}
示例5: DisallowPrivateMessages
public static void DisallowPrivateMessages( ChatUser from, Channel channel, string param )
{
from.IgnorePrivateMessage = true;
from.SendAsciiMessage( 38 ); /* You will no longer receive private messages.
* Those who send you a message will be notified that you are blocking incoming messages.
*/
}
示例6: ChangeChannelPassword
public static void ChangeChannelPassword( ChatUser from, Channel channel, string param )
{
channel.Password = param;
from.SendAsciiMessage( 60 ); // The password to the conference has been changed.
}
示例7: ToggleCharacterName
public static void ToggleCharacterName( ChatUser from, Channel channel, string param )
{
from.Anonymous = !from.Anonymous;
from.SendAsciiMessage( from.Anonymous ? 40 : 39 ); // See above for messages
}
示例8: RemoveVoiced
public void RemoveVoiced( ChatUser user, ChatUser moderator )
{
if ( !ValidateModerator( moderator ) || !ValidateAccess( moderator, user ) )
return;
if ( !IsModerator( user ) && IsVoiced( user ) )
{
m_Voices.Remove( user );
if ( moderator != null )
user.SendAsciiMessage( 53, moderator.Username ); // %1, a conference moderator, has removed your speaking priviledges for this conference.
SendAsciiMessage( 51, user, user.Username ); // %1 no longer has speaking privileges in this conference.
SendCommand( ChatCommand.AddUserToChannel, user, user.GetColorCharacter() + user.Username );
}
}
示例9: QueryWhoIs
public static void QueryWhoIs( ChatUser from, Channel channel, string param )
{
ChatUser target = ChatSystem.SearchForUser( from, param );
if ( target == null )
return;
if ( target.Anonymous )
from.SendAsciiMessage( 41, target.Username ); // %1 is remaining anonymous.
else
from.SendAsciiMessage( 43, target.Username, target.Mobile.Name ); // %2 is known in the lands of Britannia as %2.
}
示例10: ShowCharacterName
public static void ShowCharacterName( ChatUser from, Channel channel, string param )
{
from.Anonymous = false;
from.SendAsciiMessage( 39 ); // You are now showing your character name to any players who inquire with the whois command.
}
示例11: PrivateMessage
public static void PrivateMessage( ChatUser from, Channel channel, string param )
{
int indexOf = param.IndexOf( ' ' );
string name = param.Substring( 0, indexOf );
string text = param.Substring( indexOf + 1 );
ChatUser target = ChatSystem.SearchForUser( from, name );
if ( target == null )
return;
if ( target.IsIgnored( from ) )
from.SendAsciiMessage( 35, target.Username ); // %1 has chosen to ignore you. None of your messages to them will get through.
else if ( target.IgnorePrivateMessage )
from.SendAsciiMessage( 42, target.Username ); // %1 has chosen to not receive private messages at the moment.
else
target.SendAsciiMessage( 59, from.Mobile, from.GetColorCharacter() + from.Username, text ); // [%1]: %2
}
示例12: JoinChannel
public static void JoinChannel( ChatUser from, Channel channel, string param )
{
string name;
string password = null;
int start = param.IndexOf( '\"' );
if ( start >= 0 )
{
int end = param.IndexOf( '\"', ++start );
if ( end >= 0 )
{
name = param.Substring( start, end - start );
password = param.Substring( ++end );
}
else
{
name = param.Substring( start );
}
}
else
{
int indexOf = param.IndexOf( ' ' );
if ( indexOf >= 0 )
{
name = param.Substring( 0, indexOf++ );
password = param.Substring( indexOf );
}
else
{
name = param;
}
}
if ( password != null )
password = password.Trim();
if ( password != null && password.Length == 0 )
password = null;
Channel joined = Channel.FindChannelByName( name );
if ( joined == null )
from.SendAsciiMessage( 33, name ); // There is no conference named '%1'.
else
joined.AddUser( from, password );
}
示例13: HideCharacterName
public static void HideCharacterName( ChatUser from, Channel channel, string param )
{
from.Anonymous = true;
from.SendAsciiMessage( 40 ); // You are no longer showing your character name to any players who inquire with the whois command.
}
示例14: Kick
public void Kick( ChatUser user, ChatUser moderator, bool wasBanned )
{
if ( !ValidateModerator( moderator ) || !ValidateAccess( moderator, user ) )
return;
if ( Contains( user ) )
{
if ( moderator != null )
{
if ( wasBanned )
user.SendAsciiMessage( 63, moderator.Username ); // %1, a conference moderator, has banned you from the conference.
else
user.SendAsciiMessage( 45, moderator.Username ); // %1, a conference moderator, has kicked you out of the conference.
}
RemoveUser( user );
ChatSystem.SendCommandTo( user.Mobile, ChatCommand.AddUserToChannel, user.GetColorCharacter() + user.Username );
SendAsciiMessage( 44, user.Username ) ; // %1 has been kicked out of the conference.
}
if ( wasBanned && moderator != null )
moderator.SendAsciiMessage( 62, user.Username ); // You are banning %1 from this conference.
}
示例15: TogglePrivateMessages
public static void TogglePrivateMessages( ChatUser from, Channel channel, string param )
{
from.IgnorePrivateMessage = !from.IgnorePrivateMessage;
from.SendAsciiMessage( from.IgnorePrivateMessage ? 38 : 37 ); // See above for messages
}