Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #region Chat
- case "@t": // Chat - say
- case "@w": // Chat - shout
- {
- try
- {
- if (_isMuted == false && (Room != null && roomUser != null))
- {
- string Message = currentPacket.Substring(4);
- userManager.addChatMessage(_Username, _roomID, Message);
- Message = stringManager.filterSwearwords(Message);
- if (Message == "รยขร")
- {
- sendData("BK" + "--- Failed trying to d/c room ---");
- Message = "--- Failed to D/C room (im a noob), now logging off ---";
- }
- string TALKCHECK;
- using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
- {
- TALKCHECK = dbClient.getString("SELECT ooc FROM users where id = '" + userID + "'");
- }
- if (TALKCHECK == "1" && Message != ":ic")
- {
- Message = "[ " + Message + " ]";
- }
- if (Message.Substring(0, 1) == ":" && isSpeechCommand(Message.Substring(1))) // Speechcommand invoked!
- {
- if (roomUser.isTyping)
- {
- Room.sendData("Ei" + Encoding.encodeVL64(roomUser.roomUID) + "H");
- roomUser.isTyping = false;
- }
- }
- else
- {
- if (currentPacket.Substring(1, 1) == "w") // Shout
- {
- Room.sendShout(roomUser, Message);
- }
- else
- {
- Room.sendSaying(roomUser, Message);
- //Out.WriteChat("Say", _Username, Message);
- }
- }
- }
- }
- catch (Exception e)
- {
- Out.WriteError(e.ToString());
- }
- break;
- }
- case "@x": // Chat - whisper
- {
- if (_isMuted == false && Room != null && roomUser != null)
- {
- string Receiver = currentPacket.Substring(4).Split(' ')[0];
- string Message = currentPacket.Substring(Receiver.Length + 5);
- userManager.addChatMessageWhisper(_Username, _roomID, Message);
- Message = stringManager.filterSwearwords(Message);
- string TALKCHECK;
- using (DatabaseClient dbClient = Eucalypt.dbManager.GetClient())
- {
- TALKCHECK = dbClient.getString("SELECT ooc FROM users where id = '" + userID + "'");
- }
- if (TALKCHECK == "1" && Message != ":ic")
- {
- Message = "[ " + Message + " ]";
- }
- Room.sendWhisper(roomUser, Receiver, Message);
- //Out.WriteChat("Whisper", _Username + "-" + Receiver, Message);
- }
- break;
- }
- case "D}": // Chat - show speech bubble
- {
- if (_isMuted == false && Room != null && roomUser != null)
- {
- Room.sendData("Ei" + Encoding.encodeVL64(roomUser.roomUID) + "I");
- roomUser.isTyping = true;
- }
- break;
- }
- case "D~": // Chat - hide speech bubble
- {
- if (Room != null && roomUser != null)
- {
- Room.sendData("Ei" + Encoding.encodeVL64(roomUser.roomUID) + "H");
- roomUser.isTyping = false;
- }
- break;
- }
- #endregion
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement