本文整理汇总了C#中Chat类的典型用法代码示例。如果您正苦于以下问题:C# Chat类的具体用法?C# Chat怎么用?C# Chat使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Chat类属于命名空间,在下文中一共展示了Chat类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Parse
public NetworkObject Parse(Match match)
{
Chat chat = new Chat {
Now = {
Players = new List<Player>() {
new Player() {
Name = match.Groups["name"].Value,
Uid = match.Groups["uniqueid"].Value
}
},
Content = new List<String>() {
match.Groups["text"].Value.Replace("\r", "")
}
},
Origin = ChatOrigin.Player
};
if (String.Compare(match.Groups["context"].Value, "say", StringComparison.OrdinalIgnoreCase) == 0) {
chat.Scope.Groups = new GroupingList();
}
else {
// Can we get a team identifier here?
chat.Scope.Groups = new GroupingList() {
new Grouping() {
Type = Grouping.Team
}
};
}
return chat;
}
示例2: NetworkWindow
public NetworkWindow(NetworkInterface nif)
{
chat = new Chat(nif);
chat.togglePos = new Rect(0,30,togglePos.width,25);
nif.AddMessageRecipient((INetworkMessage)this);
menus.Add(new MainContent(nif,this));
}
示例3: NetworkWindow
public NetworkWindow(IGUIMessages receiver)
{
chat = new Chat(receiver);
chat.togglePos = new Rect(0,30,togglePos.width,25);
receiver.AddNetworkMessageRecipient((INetworkMessage)this);
menus.Add(new MainContent(receiver,this));
}
示例4: onChatMessage
public void onChatMessage(SocketModel model)
{
NoticeMessage.MsgChatRep msg = MsgSerializer.Deserialize<NoticeMessage.MsgChatRep>(model);
Chat chat = new Chat();
chat.uid = msg.uid;
chat.name = msg.name;
chat.type = msg.type;
chat.data = msg.data;
chat.targetUid = msg.target;
if (msg.item != null) {
chat.goods.guid = msg.item.guid;
//server changed, client not change
// chat.goods.number = msg.item.number;
}
chat.targetName = msg.tarname;
ChatManager chatManager = MonoInstancePool.getInstance<ChatManager>();
if (chat.type == (int)GlobalDef.CHAT_CHANNEL.ALL_CHANNEL)
{
chatManager.setSystemChatList(chat);
chatManager.setHaveNewSystemChat(true);
}
else if (chat.type == (int)GlobalDef.CHAT_CHANNEL.WORLD_CHANNEL)
{
chatManager.setWorldChatList(chat);
chatManager.setHaveNewWorldChat(true);
}
else if (chat.type == (int)GlobalDef.CHAT_CHANNEL.PRIVATE_CHANNEL)
{
chatManager.setPrivateChatList(chat);
chatManager.setHaveNewPrivateChat(true);
//chatManager.setTargetId(chat.uid);
}
chatManager.setIsDirty(true);
}
示例5: Start
void Start()
{
game = GameObject.Find("Networking").GetComponent<Game>();
sender = GameObject.Find("Networking").GetComponent<PacketSender>();
chat = GameObject.Find("Chat").GetComponent<Chat>();
side = GameObject.Find("SideObjects").GetComponent<SideObjects>();
}
示例6: RequestNewChat
public void RequestNewChat(string auctionId, string participant, Message message)
{
CurrentChat = new Chat(auctionId, participant);
CurrentChat.Message = message;
Chats.Add(CurrentChat);
OnChatCreated(EventArgs.Empty);
}
示例7: Awake
protected void Awake()
{
// force the twitch libraries to be loaded
Twitch.Broadcast.UnityBroadcastController.LoadTwitchLibraries();
m_Chat = new Chat(new CoreChatAPI());
}
示例8: checkKey
/// <summary>
/// Chatオブジェクトが検索keyにHITするかどうかを判定する
/// 検索keyは以下
/// 個人チャットの場合 : 相手のskype名
/// グループチャットの場合 : 会話のタイトル
/// </summary>
/// <param name="key"></param>
/// <param name="chat"></param>
/// <returns></returns>
private bool checkKey(string key, Chat chat)
{
try
{
textBox1.Text = "chat.Status: " + chat.Status + "\r\n" + textBox1.Text;
//けっこうあいまいな判定
switch (chat.Status)
{
case TChatStatus.chsDialog: //個人チャットかな~
//個人チャットの相手のskype名
if (key == chat.DialogPartner)
{
return true;
}
break;
case TChatStatus.chsMultiSubscribed://グループチャットかな~
//グループチャットの会話のタイトル
if (key == chat.Topic)
{
return true;
}
break;
default://分からん
break;
}
return false;
}
catch (Exception exp)
{
return false;
}
}
示例9: Join
public string[] Join(string name)
{
MyChat = new Chat(UserHandler);
lock (syncObj)
{
if (!Chatter.Contains(name)) //이름이 기존 채터에 있는지 검색한다.
{
//이름과 이벤트를 추가한다.
this.name = name;
Chatter.Add(name);
//사용자에게 보내 줄 채널을 설정한다.
callback = OperationContext.Current.GetCallbackChannel<IChatCallback>();
//현재 접속자 정보를 모두에게 전달
BroadcastMessage(name, "", "UserEnter");
//델리게이터 추가
List += MyChat;
//사용자리스트를 보내준다.
string[] list = new string[Chatter.Count];
lock (syncObj)
{
Chatter.CopyTo(list);
}
return list;
}
else //이미 사용자가 사용하고 있는 이름일 경우
{
return null;
}
}
}
示例10: CreateNewChat
public static Chat CreateNewChat(Visitor v, Operator o)
{
Chat c = new Chat();
c.AccountId = v.AccountId;
c.OperatorId = o.OperatorId;
c.VisitorId = v.VisitorId;
return c;
}
示例11: AddChat
public void AddChat(Chat chatRequest)
{
string sql = string.Format("INSERT INTO LiveChat_Chat "+
"(ChatId,CreateBy,CreateTime,AccountId,VisitorId,Status) "
+"VALUES('{0}','{1}','{2}','{3}','{4}','{5}')" ,
chatRequest.ChatId, chatRequest.CreateBy, chatRequest.CreateTime,chatRequest.AccountId, chatRequest.VisitorId, chatRequest.Status);
DBHelper.ExecuteCommand(sql);
}
示例12: CreateChat
public Chat CreateChat(string auctionId, string participant, IMessageListener messageListener)
{
CurrentChat = new Chat(auctionId, participant);
CurrentChat.AddIMessageListener(messageListener);
Chats.Add(CurrentChat);
OnChatCreated(EventArgs.Empty);
return CurrentChat;
}
示例13: ChatInterface
public ChatInterface()
{
m_chat = new Chat();
m_chat.Visible = true;
m_chat.OnInput += OnChatInput;
Overlay.System.Register(m_chat);
}
示例14: Accept
public void Accept(Chat chat)
{
this.chat = chat;
visitor = operatorServiceAgent.GetVisitorById(chat.VisitorId);
initChat();
operatorServiceAgent.AcceptChatRequest(chat.ChatId);
}
示例15: Awake
void Awake()
{
Instance = this;
mClient = LobbyManager.s_Singleton.client;
NetworkServer.RegisterHandler(MSG_TYPE, OnServerPostChatMessage);
}