本文整理汇总了C#中Server.Engines.Chat.ChatUser类的典型用法代码示例。如果您正苦于以下问题:C# ChatUser类的具体用法?C# ChatUser怎么用?C# ChatUser使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
ChatUser类属于Server.Engines.Chat命名空间,在下文中一共展示了ChatUser类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: EmoteMessage
public static void EmoteMessage( ChatUser from, Channel channel, string param )
{
if ( channel.CanTalk( from ) )
channel.SendIgnorableMessage( 58, from, from.GetColorCharacter() + from.Username, param ); // %1 %2
else
from.SendMessage( 36 ); // The moderator of this conference has not given you speaking priviledges.
}
示例2: AddVoice
public static void AddVoice( ChatUser from, Channel channel, string param )
{
ChatUser target = ChatSystem.SearchForUser( from, param );
if ( target != null )
channel.AddVoiced( target, from );
}
示例3: AddIgnore
public static void AddIgnore( ChatUser from, Channel channel, string param )
{
ChatUser target = ChatSystem.SearchForUser( from, param );
if ( target == null )
return;
from.AddIgnored( target );
}
示例4: RemoveChatUser
public static void RemoveChatUser( ChatUser user )
{
if ( user == null )
return;
if ( m_Users.Contains( user ) )
{
ChatSystem.SendCommandTo( user.Mobile, ChatCommand.CloseChatWindow );
if ( user.m_Channel != null )
user.m_Channel.RemoveUser( user );
m_Users.Remove( user );
m_Table.Remove( user.m_Mobile );
}
}
示例5: AddChatUser
public static ChatUser AddChatUser( Mobile from )
{
ChatUser user = GetChatUser( from );
if ( user == null )
{
user = new ChatUser( from );
m_Users.Add( user );
m_Table[from] = user;
Channel.SendChannelsTo( user );
}
return user;
}
示例6: RemoveUser
public void RemoveUser( ChatUser user )
{
if ( Contains( user ) )
{
m_Users.Remove( user );
user.CurrentChannel = null;
SendCommand( ChatCommand.RemoveUserFromChannel, user, user.Username );
ChatSystem.SendCommandTo( user.Mobile, ChatCommand.LeaveChannel, String.Format( "{{{0}}}", m_Name ) );
ChatSystem.SendCommandTo( user.Mobile, ChatCommand.LeftChannel, m_Name );
ChatLogging.LogLeave( this.Name, user.Username );
if ( m_Users.Count == 0 && !m_AlwaysAvailable )
RemoveChannel( this );
}
}
示例7: 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.SendMessage( 35, target.Username ); // %1 has chosen to ignore you. None of your messages to them will get through.
else if ( target.IgnorePrivateMessage )
from.SendMessage( 42, target.Username ); // %1 has chosen to not receive private messages at the moment.
else
target.SendMessage( 59, from.Mobile, from.GetColorCharacter() + from.Username, text ); // [%1]: %2
}
示例8: 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;
}
}
CreateAndJoin( from, name );
}
示例9: AddUser
public void AddUser( ChatUser user )
{
if ( Contains( user ) )
{
user.SendMessage( 46, m_Name ); // You are already in the conference '%1'.
}
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;
SendUsersTo( user );
ChatLogging.LogJoin( this.Name, user.Username );
}
}
示例10: IsIgnored
public bool IsIgnored( ChatUser check )
{
return m_Ignored.Contains( check );
}
示例11: RemoveChatUser
public static void RemoveChatUser( ChatUser user )
{
if ( user == null )
return;
for ( int i = 0; i < user.m_Ignoring.Count; ++i )
((ChatUser)user.m_Ignoring[i]).RemoveIgnored( user );
if ( m_Users.Contains( user ) )
{
ChatSystem.SendCommandTo( user.Mobile, ChatCommand.CloseChatWindow );
if ( user.m_Channel != null )
user.m_Channel.RemoveUser( user );
m_Users.Remove( user );
m_Table.Remove( user.m_Mobile );
}
}
示例12: GlobalSendCommand
public static void GlobalSendCommand( ChatCommand command, ChatUser initiator, string param1 )
{
GlobalSendCommand( command, initiator, param1, null );
}
示例13: AddChatUser
public static ChatUser AddChatUser( Mobile from )
{
ChatUser user = GetChatUser( from );
if ( user == null )
{
user = new ChatUser( from );
m_Users.Add( user );
m_Table[from] = user;
Channel.SendChannelsTo( user );
ArrayList list = Channel.Channels;
for ( int i = 0; i < list.Count; ++i )
{
Channel c = (Channel)list[i];
if ( c.AddUser( user ) )
break;
}
//ChatSystem.SendCommandTo( user.m_Mobile, ChatCommand.AddUserToChannel, user.GetColorCharacter() + user.Username );
}
return user;
}
示例14: IsVoiced
public bool IsVoiced( ChatUser user )
{
return m_Voices.Contains( user );
}
示例15: CanTalk
public bool CanTalk( ChatUser user )
{
return ( !m_VoiceRestricted || m_Voices.Contains( user ) || m_Moderators.Contains( user ) );
}