Beispiel #1
0
 protected virtual void OnLobbyChatUpdate(LobbyChatUpdateEventArgs e)
 {
     if (this.LobbyChatUpdate != null)
     {
         this.LobbyChatUpdate(this, e);
     }
 }
Beispiel #2
0
 protected override void OnLobbyChatUpdate(LobbyChatUpdateEventArgs e)
 {
     base.OnLobbyChatUpdate(e);
     if (base.SteamIDLobby == e.SteamIDLobby)
     {
         string text = string.Empty;
         if ((e.ChatMemberStateChange & LobbyChatUpdateStateChange.Entered) == LobbyChatUpdateStateChange.Entered)
         {
             text = "Entered";
             IAudioEventService service = Services.GetService <IAudioEventService>();
             service.Play2DEvent("Gui/Interface/Lobby/EnterLobby");
         }
         else if ((e.ChatMemberStateChange & LobbyChatUpdateStateChange.Left) == LobbyChatUpdateStateChange.Left)
         {
             text = "Left";
             IAudioEventService service2 = Services.GetService <IAudioEventService>();
             service2.Play2DEvent("Gui/Interface/Lobby/QuitLobby");
         }
         else if ((e.ChatMemberStateChange & LobbyChatUpdateStateChange.Disconnected) == LobbyChatUpdateStateChange.Disconnected)
         {
             text = "Disconnected";
             IAudioEventService service3 = Services.GetService <IAudioEventService>();
             service3.Play2DEvent("Gui/Interface/Lobby/QuitLobby");
         }
         else if ((e.ChatMemberStateChange & LobbyChatUpdateStateChange.Kicked) == LobbyChatUpdateStateChange.Kicked)
         {
             text = "Kicked";
             IAudioEventService service4 = Services.GetService <IAudioEventService>();
             service4.Play2DEvent("Gui/Interface/Lobby/QuitLobby");
         }
         if (!string.IsNullOrEmpty(text))
         {
             ILocalizationService service5 = Services.GetService <ILocalizationService>();
             if (service5 != null)
             {
                 string text2 = string.Format("%LobbyChat{0}", text);
                 if (e.SteamIDUserChanged == base.SteamIDUser)
                 {
                     text2 += "+";
                 }
                 string friendPersonaName = Steamworks.SteamAPI.SteamFriends.GetFriendPersonaName(e.SteamIDUserChanged);
                 string text3             = service5.Localize(text2).ToString().Replace("$Player", friendPersonaName);
                 string empty             = string.Empty;
                 if (e.SteamIDMakingChanges.IsValid)
                 {
                     Steamworks.SteamAPI.SteamFriends.GetFriendPersonaName(e.SteamIDMakingChanges);
                     text3 = text3.Replace("$ChangingPlayer", empty);
                 }
                 if (!string.IsNullOrEmpty(text3))
                 {
                     base.SendLocalChatMessage("s:/" + text3);
                 }
             }
         }
     }
 }