Exemple #1
0
 // For Steam private messages
 public CommandTarget(SteamChat steamChat, SteamPersona sender)
 {
     PrivateChat = steamChat;
     Persona = sender;
 }
Exemple #2
0
 // For Steam rooms
 public CommandTarget(Room room, SteamPersona sender)
 {
     Room = room;
     Persona = sender;
 }
Exemple #3
0
        private void HandleMessage(SteamChat chat, SteamPersona user, string message)
        {
            _lastMessage.Restart();

            var senderName = user.DisplayName;
            var senderId = user.Id.ConvertToUInt64().ToString("D");
            var inGame = user.Playing != null && user.Playing.ToUInt64() != 0;

            var line = new ChatLine(Util.GetCurrentTimestamp(), RoomInfo.ShortName, "Steam", senderName, senderId, "", message, inGame);
            SendLine(line);

            Command.Handle(new CommandTarget(this, user.Id), message, "~");
        }
Exemple #4
0
        private void HandleLeave(SteamChat chat, SteamPersona user, SteamChatLeaveReason reason, SteamPersona sourceUser)
        {
            _lastMessage.Restart();

            var message = user.DisplayName;
            switch (reason)
            {
                case SteamChatLeaveReason.Left:
                    message += " left chat.";
                    break;
                case SteamChatLeaveReason.Disconnected:
                    message += " disconnected.";
                    break;
                case SteamChatLeaveReason.Kicked:
                    message += string.Format(" was kicked by {0}.", sourceUser.DisplayName);
                    break;
                case SteamChatLeaveReason.Banned:
                    message += string.Format(" was banned by {0}.", sourceUser.DisplayName);
                    break;
            }

            var by = sourceUser != null ? sourceUser.DisplayName : "";
            var byId = sourceUser != null ? sourceUser.Id.ConvertToUInt64().ToString("D") : "0";
            var byType = sourceUser != null ? "Steam" : "";

            var line = new StateLine(Util.GetCurrentTimestamp(), RoomInfo.ShortName, reason.ToString(), user.DisplayName, user.Id.ConvertToUInt64().ToString("D"), "Steam", by, byId, byType, message);
            SendLine(line);
        }
Exemple #5
0
        private void HandleEnter(SteamChat chat, SteamPersona user)
        {
            _lastMessage.Restart();

            var message = user.DisplayName + " entered chat.";

            var line = new StateLine(Util.GetCurrentTimestamp(), RoomInfo.ShortName, "Enter", user.DisplayName, user.Id.ConvertToUInt64().ToString("D"), "Steam", "", "0", "", message);
            SendLine(line);
        }
Exemple #6
0
 public Member(SteamPersona persona, EClanPermission rank)
 {
     Persona = persona;
     Rank = rank;
 }