Exemple #1
0
        private bool CheckPlayer(Steamworks.CSteamID plr)
        {
            bool flag = false;

            foreach (SteamPlayer sp in Provider.clients)
            {
                if (sp.playerID.steamID == plr)
                {
                    flag = true;
                }
            }

            return(flag);
        }
Exemple #2
0
    void OnLobbyEntered(LobbyEnter_t result)
    {
        current_lobbyID = result.m_ulSteamIDLobby;

        if (result.m_EChatRoomEnterResponse == 1)
        {
            main_menu_canvas.enabled = false;
            lobby_canvas.enabled     = true;
            Debug.Log("Lobby joined!");
            lobbyID          = (Steamworks.CSteamID)current_lobbyID;
            players_in_lobby = SteamMatchmaking.GetNumLobbyMembers(lobbyID);
            update_lobby_labels();
        }
        else
        {
            Debug.Log("Failed to join lobby.");
        }
    }
        internal NetworkGamer(
            Steamworks.CSteamID id,
            NetworkSession session
            ) : base(
                id,
                Steamworks.SteamFriends.GetFriendPersonaName(id),
                Steamworks.SteamFriends.GetPlayerNickname(id)
                )
        {
            Session = session;

            // TODO: Everything below
            HasLeftSession     = false;
            HasVoice           = false;
            IsGuest            = false;
            IsMutedByLocalUser = false;
            IsPrivateSlot      = false;
            IsReady            = false;
            IsTalking          = false;
            Machine            = new NetworkMachine();
            RoundtripTime      = TimeSpan.Zero;
        }
 /// <summary>
 /// <para> Authenticate ticket ( from GetAuthSessionTicket ) from entity steamID to be sure it is valid and isnt reused</para>
 /// <para> Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )</para>
 /// </summary>
 public static EBeginAuthSessionResult BeginAuthSession(byte[] pAuthTicket, int cbAuthTicket, CSteamID steamID)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamGameServer_BeginAuthSession(CSteamGameServerAPIContext.GetSteamGameServer(), pAuthTicket, cbAuthTicket, steamID));
 }
 public static SteamAPICall_t EnumerateUserSharedWorkshopFiles(CSteamID steamId, uint unStartIndex, IList <string> pRequiredTags, IList <string> pExcludedTags)
 {
     InteropHelp.TestIfAvailableClient();
     return((SteamAPICall_t)NativeMethods.ISteamRemoteStorage_EnumerateUserSharedWorkshopFiles(CSteamAPIContext.GetSteamRemoteStorage(), steamId, unStartIndex, new InteropHelp.SteamParamStringArray(pRequiredTags), new InteropHelp.SteamParamStringArray(pExcludedTags)));
 }
 public static bool GetSocketInfo(SNetSocket_t hSocket, out CSteamID pSteamIDRemote, out int peSocketStatus, out uint punIPRemote, out ushort punPortRemote)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamGameServerNetworking_GetSocketInfo(hSocket, out pSteamIDRemote, out peSocketStatus, out punIPRemote, out punPortRemote));
 }
 public static bool AcceptP2PSessionWithUser(CSteamID steamIDRemote)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamGameServerNetworking_AcceptP2PSessionWithUser(steamIDRemote));
 }
 public static bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamGameServerNetworking_CloseP2PChannelWithUser(steamIDRemote, nChannel));
 }
 /// <summary>
 /// <para> Should be called whenever a user leaves our game server, this lets Steam internally</para>
 /// <para> track which users are currently on which servers for the purposes of preventing a single</para>
 /// <para> account being logged into multiple servers, showing who is currently on a server, etc.</para>
 /// <para> DEPRECATED!  This function will be removed from the SDK in an upcoming version.</para>
 /// <para>              Please migrate to BeginAuthSession and related functions.</para>
 /// </summary>
 public static void SendUserDisconnect_DEPRECATED(CSteamID steamIDUser)
 {
     InteropHelp.TestIfAvailableGameServer();
     NativeMethods.ISteamGameServer_SendUserDisconnect_DEPRECATED(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDUser);
 }
 /// <summary>
 /// <para> Handles receiving a new connection from a Steam user.  This call will ask the Steam</para>
 /// <para> servers to validate the users identity, app ownership, and VAC status.  If the Steam servers</para>
 /// <para> are off-line, then it will validate the cached ticket itself which will validate app ownership</para>
 /// <para> and identity.  The AuthBlob here should be acquired on the game client using SteamUser()-&gt;InitiateGameConnection()</para>
 /// <para> and must then be sent up to the game server for authentication.</para>
 /// <para> Return Value: returns true if the users ticket passes basic checks. pSteamIDUser will contain the Steam ID of this user. pSteamIDUser must NOT be NULL</para>
 /// <para> If the call succeeds then you should expect a GSClientApprove_t or GSClientDeny_t callback which will tell you whether authentication</para>
 /// <para> for the user has succeeded or failed (the steamid in the callback will match the one returned by this call)</para>
 /// <para> DEPRECATED!  This function will be removed from the SDK in an upcoming version.</para>
 /// <para>              Please migrate to BeginAuthSession and related functions.</para>
 /// </summary>
 public static bool SendUserConnectAndAuthenticate_DEPRECATED(uint unIPClient, byte[] pvAuthBlob, uint cubAuthBlobSize, out CSteamID pSteamIDUser)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamGameServer_SendUserConnectAndAuthenticate_DEPRECATED(CSteamGameServerAPIContext.GetSteamGameServer(), unIPClient, pvAuthBlob, cubAuthBlobSize, out pSteamIDUser));
 }
 /// <summary>
 /// <para> ask if any of the current players dont want to play with this new player - or vice versa</para>
 /// </summary>
 public static SteamAPICall_t ComputeNewPlayerCompatibility(CSteamID steamIDNewPlayer)
 {
     InteropHelp.TestIfAvailableGameServer();
     return((SteamAPICall_t)NativeMethods.ISteamGameServer_ComputeNewPlayerCompatibility(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDNewPlayer));
 }
 /// <summary>
 /// <para> Server clan association</para>
 /// <para> associate this game server with this clan for the purposes of computing player compat</para>
 /// </summary>
 public static SteamAPICall_t AssociateWithClan(CSteamID steamIDClan)
 {
     InteropHelp.TestIfAvailableGameServer();
     return((SteamAPICall_t)NativeMethods.ISteamGameServer_AssociateWithClan(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDClan));
 }
 /// <summary>
 /// <para> Ask if a user in in the specified group, results returns async by GSUserGroupStatus_t</para>
 /// <para> returns false if we're not connected to the steam servers and thus cannot ask</para>
 /// </summary>
 public static bool RequestUserGroupStatus(CSteamID steamIDUser, CSteamID steamIDGroup)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamGameServer_RequestUserGroupStatus(CSteamGameServerAPIContext.GetSteamGameServer(), steamIDUser, steamIDGroup));
 }
 /// <summary>
 /// <para> After receiving a user's authentication data, and passing it to SendUserConnectAndAuthenticate, use this function</para>
 /// <para> to determine if the user owns downloadable content specified by the provided AppID.</para>
 /// </summary>
 public static EUserHasLicenseForAppResult UserHasLicenseForApp(CSteamID steamID, AppId_t appID)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamGameServer_UserHasLicenseForApp(CSteamGameServerAPIContext.GetSteamGameServer(), steamID, appID));
 }
 /// <summary>
 /// <para> Stop tracking started by BeginAuthSession - called when no longer playing game with this entity</para>
 /// </summary>
 public static void EndAuthSession(CSteamID steamID)
 {
     InteropHelp.TestIfAvailableGameServer();
     NativeMethods.ISteamGameServer_EndAuthSession(CSteamGameServerAPIContext.GetSteamGameServer(), steamID);
 }
 public static bool ReadP2PPacket(byte[] pubDest, uint cubDest, out uint pcubMsgSize, out CSteamID psteamIDRemote, int nChannel = 0)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamGameServerNetworking_ReadP2PPacket(pubDest, cubDest, out pcubMsgSize, out psteamIDRemote, nChannel));
 }
 public static bool SendP2PPacket(CSteamID steamIDRemote, byte[] pubData, uint cubData, EP2PSend eP2PSendType, int nChannel = 0)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamGameServerNetworking_SendP2PPacket(steamIDRemote, pubData, cubData, eP2PSendType, nChannel));
 }
Exemple #18
0
 /// <summary>
 /// <para> Authenticate ticket from entity steamID to be sure it is valid and isnt reused</para>
 /// <para> Registers for callbacks if the entity goes offline or cancels the ticket ( see ValidateAuthTicketResponse_t callback and EAuthSessionResponse )</para>
 /// </summary>
 public static EBeginAuthSessionResult BeginAuthSession(byte[] pAuthTicket, int cbAuthTicket, CSteamID steamID)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamUser_BeginAuthSession(pAuthTicket, cbAuthTicket, steamID));
 }
 public static SNetSocket_t CreateP2PConnectionSocket(CSteamID steamIDTarget, int nVirtualPort, int nTimeoutSec, bool bAllowUseOfPacketRelay)
 {
     InteropHelp.TestIfAvailableGameServer();
     return((SNetSocket_t)NativeMethods.ISteamGameServerNetworking_CreateP2PConnectionSocket(steamIDTarget, nVirtualPort, nTimeoutSec, bAllowUseOfPacketRelay));
 }
Exemple #20
0
 /// <summary>
 /// <para> Stop tracking started by BeginAuthSession - called when no longer playing game with this entity</para>
 /// </summary>
 public static void EndAuthSession(CSteamID steamID)
 {
     InteropHelp.TestIfAvailableClient();
     NativeMethods.ISteamUser_EndAuthSession(steamID);
 }
 public static bool GetP2PSessionState(CSteamID steamIDRemote, out P2PSessionState_t pConnectionState)
 {
     InteropHelp.TestIfAvailableGameServer();
     return(NativeMethods.ISteamGameServerNetworking_GetP2PSessionState(steamIDRemote, out pConnectionState));
 }
Exemple #22
0
 /// <summary>
 /// <para> After receiving a user's authentication data, and passing it to BeginAuthSession, use this function</para>
 /// <para> to determine if the user owns downloadable content specified by the provided AppID.</para>
 /// </summary>
 public static EUserHasLicenseForAppResult UserHasLicenseForApp(CSteamID steamID, AppId_t appID)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamUser_UserHasLicenseForApp(steamID, appID));
 }
        public static bool GetUGCDetails(UGCHandle_t hContent, out AppId_t pnAppID, out string ppchName, out int pnFileSizeInBytes, out CSteamID pSteamIDOwner)
        {
            InteropHelp.TestIfAvailableClient();
            IntPtr ppchName2;
            bool   flag = NativeMethods.ISteamRemoteStorage_GetUGCDetails(CSteamAPIContext.GetSteamRemoteStorage(), hContent, out pnAppID, out ppchName2, out pnFileSizeInBytes, out pSteamIDOwner);

            ppchName = (flag ? InteropHelp.PtrToStringUTF8(ppchName2) : null);
            return(flag);
        }
Exemple #24
0
 /// <summary>
 /// <para> set data to be replicated to friends so that they can join your game</para>
 /// <para> CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client</para>
 /// <para> uint32 unIPServer, uint16 usPortServer - the IP address of the game server</para>
 /// </summary>
 public static void AdvertiseGame(CSteamID steamIDGameServer, uint unIPServer, ushort usPortServer)
 {
     InteropHelp.TestIfAvailableClient();
     NativeMethods.ISteamUser_AdvertiseGame(steamIDGameServer, unIPServer, usPortServer);
 }
Exemple #25
0
        private void Events_OnPlayerDeath(UnturnedPlayer player, EDeathCause cause, ELimb limb, Steamworks.CSteamID murderer)
        {
            var killer = UnturnedPlayer.FromCSteamID(murderer);

            var headshot = Translate("headshot_death_message");

            if (cause.ToString() == "GUN")
            {
                if (limb == ELimb.SKULL)
                {
                    UnturnedChat.Say(Translate("gun_headshot_death_message", killer.DisplayName, player.DisplayName, headshot, UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName), Config.DeathMessage);
                }
                else
                {
                    UnturnedChat.Say(Translate("gun_death_message", killer.DisplayName, player.DisplayName, UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName), Config.DeathMessage);
                }
            }
            else if (cause.ToString() == "MELEE")
            {
                if (limb == ELimb.SKULL)
                {
                    UnturnedChat.Say(Translate("melee_headshot_death_message", killer.DisplayName, player.DisplayName, headshot, UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName), Config.DeathMessage);
                }
                else
                {
                    UnturnedChat.Say(Translate("melee_death_message", killer.DisplayName, player.DisplayName, UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName), Config.DeathMessage);
                }
            }
            else if (cause.ToString() == "PUNCH")
            {
                if (limb == ELimb.SKULL)
                {
                    UnturnedChat.Say(Translate("punch_headshot_death_message", killer.DisplayName, player.DisplayName, headshot), Config.DeathMessage);
                }
                else
                {
                    UnturnedChat.Say(Translate("punch_death_message", killer.DisplayName, player.DisplayName), Config.DeathMessage);
                }
            }
            else if (cause.ToString() == "SHRED")
            {
                UnturnedChat.Say(Translate("shred_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "ZOMBIE")
            {
                UnturnedChat.Say(Translate("zombie_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "ANIMAL")
            {
                UnturnedChat.Say(Translate("animal_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "ROADKILL")
            {
                UnturnedChat.Say(Translate("roadkill_death_message", killer.DisplayName, player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "SPARK")
            {
                UnturnedChat.Say(Translate("spark_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "VEHICLE")
            {
                UnturnedChat.Say(Translate("vehicle_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "FOOD")
            {
                UnturnedChat.Say(Translate("food_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "WATER")
            {
                UnturnedChat.Say(Translate("water_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "INFECTION")
            {
                UnturnedChat.Say(Translate("infection_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "BLEEDING")
            {
                UnturnedChat.Say(Translate("bleeding_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "LANDMINE")
            {
                UnturnedChat.Say(Translate("landmine_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "BREATH")
            {
                UnturnedChat.Say(Translate("breath_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "KILL")
            {
                UnturnedChat.Say(Translate("kill_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "FREEZING")
            {
                UnturnedChat.Say(Translate("freezing_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "SENTRY")
            {
                UnturnedChat.Say(Translate("sentry_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "CHARGE")
            {
                UnturnedChat.Say(Translate("charge_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "MISSILE")
            {
                UnturnedChat.Say(Translate("missile_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "BONES")
            {
                UnturnedChat.Say(Translate("bones_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "SPLASH")
            {
                UnturnedChat.Say(Translate("splash_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "ACID")
            {
                UnturnedChat.Say(Translate("acid_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "SPIT")
            {
                UnturnedChat.Say(Translate("spit_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "BURNING")
            {
                UnturnedChat.Say(Translate("burning_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "BURNER")
            {
                UnturnedChat.Say(Translate("burner_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "BOULDER")
            {
                UnturnedChat.Say(Translate("boulder_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "ARENA")
            {
                UnturnedChat.Say(Translate("arena_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "GRENADE")
            {
                UnturnedChat.Say(Translate("grenade_death_message", player.DisplayName), Config.DeathMessage);
            }
            else if (cause.ToString() == "SUICIDE" && Configuration.Instance.SuicideMessages)
            {
                UnturnedChat.Say(Translate("suicide_death_message", player.DisplayName), Config.DeathMessage);
            }
        }
Exemple #26
0
 /// <summary>
 /// <para> Multiplayer Authentication functions</para>
 /// <para> InitiateGameConnection() starts the state machine for authenticating the game client with the game server</para>
 /// <para> It is the client portion of a three-way handshake between the client, the game server, and the steam servers</para>
 /// <para> Parameters:</para>
 /// <para> void *pAuthBlob - a pointer to empty memory that will be filled in with the authentication token.</para>
 /// <para> int cbMaxAuthBlob - the number of bytes of allocated memory in pBlob. Should be at least 2048 bytes.</para>
 /// <para> CSteamID steamIDGameServer - the steamID of the game server, received from the game server by the client</para>
 /// <para> CGameID gameID - the ID of the current game. For games without mods, this is just CGameID( &lt;appID&gt; )</para>
 /// <para> uint32 unIPServer, uint16 usPortServer - the IP address of the game server</para>
 /// <para> bool bSecure - whether or not the client thinks that the game server is reporting itself as secure (i.e. VAC is running)</para>
 /// <para> return value - returns the number of bytes written to pBlob. If the return is 0, then the buffer passed in was too small, and the call has failed</para>
 /// <para> The contents of pBlob should then be sent to the game server, for it to use to complete the authentication process.</para>
 /// </summary>
 public static int InitiateGameConnection(byte[] pAuthBlob, int cbMaxAuthBlob, CSteamID steamIDGameServer, uint unIPServer, ushort usPortServer, bool bSecure)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamUser_InitiateGameConnection(pAuthBlob, cbMaxAuthBlob, steamIDGameServer, unIPServer, usPortServer, bSecure));
 }
 /// <summary>
 /// <para> downloads stats for the user</para>
 /// <para> returns a GSStatsReceived_t callback when completed</para>
 /// <para> if the user has no stats, GSStatsReceived_t.m_eResult will be set to k_EResultFail</para>
 /// <para> these stats will only be auto-updated for clients playing on the server. For other</para>
 /// <para> users you'll need to call RequestUserStats() again to refresh any data</para>
 /// </summary>
 public static SteamAPICall_t RequestUserStats(CSteamID steamIDUser)
 {
     InteropHelp.TestIfAvailableGameServer();
     return((SteamAPICall_t)NativeMethods.ISteamGameServerStats_RequestUserStats(CSteamGameServerAPIContext.GetSteamGameServerStats(), steamIDUser));
 }
Exemple #28
0
 public static void GetTicketSteamID(byte[] rgubTicketDecrypted, uint cubTicketDecrypted, out CSteamID psteamID)
 {
     InteropHelp.TestIfPlatformSupported();
     NativeMethods.GetTicketSteamID(rgubTicketDecrypted, cubTicketDecrypted, out psteamID);
 }
Exemple #29
0
        private void OnPlayerDeath(UnturnedPlayer player, EDeathCause cause, ELimb limb, Steamworks.CSteamID murderer)
        {
            UnturnedPlayer killer = UnturnedPlayer.FromCSteamID(murderer);

            string headshot = Translate("headshot");
            {
                if (cause.ToString() == "GUN")
                {
                    if (limb == ELimb.SKULL)
                    {
                        UnturnedChat.Say(Translate("gun_headshot", killer.DisplayName, player.DisplayName, headshot, Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString()), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                    }
                    else
                    {
                        UnturnedChat.Say(Translate("gun", killer.DisplayName, player.DisplayName, Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString()), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                    }
                }
                else if (cause.ToString() == "MELEE")
                {
                    if (limb == ELimb.SKULL)
                    {
                        UnturnedChat.Say(Translate("melee_headshot", killer.DisplayName, player.DisplayName, headshot, Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString()), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                    }
                    else
                    {
                        UnturnedChat.Say(Translate("melee", killer.DisplayName, player.DisplayName, Rocket.Unturned.Player.UnturnedPlayer.FromCSteamID(murderer).Player.equipment.asset.itemName.ToString()), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                    }
                }
                else if (cause.ToString() == "PUNCH")
                {
                    if (limb == ELimb.SKULL)
                    {
                        UnturnedChat.Say(Translate("punch_headshot", killer.DisplayName, player.DisplayName, headshot), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                    }
                    else
                    {
                        UnturnedChat.Say(Translate("punch", killer.DisplayName, player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                    }
                }
                else if (cause.ToString() == "SHRED")
                {
                    UnturnedChat.Say(Translate("shred", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "ZOMBIE")
                {
                    UnturnedChat.Say(Translate("zombie", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "ANIMAL")
                {
                    UnturnedChat.Say(Translate("animal", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "ROADKILL")
                {
                    UnturnedChat.Say(Translate("roadkill", killer.DisplayName, player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "SPARK")
                {
                    UnturnedChat.Say(Translate("spark", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "VEHICLE")
                {
                    UnturnedChat.Say(Translate("vehicle", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "FOOD")
                {
                    UnturnedChat.Say(Translate("food", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "WATER")
                {
                    UnturnedChat.Say(Translate("water", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "INFECTION")
                {
                    UnturnedChat.Say(Translate("infection", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "BLEEDING")
                {
                    UnturnedChat.Say(Translate("bleeding", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "LANDMINE")
                {
                    UnturnedChat.Say(Translate("landmine", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "BREATH")
                {
                    UnturnedChat.Say(Translate("breath", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "KILL")
                {
                    UnturnedChat.Say(Translate("kill", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "FREEZING")
                {
                    UnturnedChat.Say(Translate("freezing", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "SENTRY")
                {
                    UnturnedChat.Say(Translate("sentry", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "CHARGE")
                {
                    UnturnedChat.Say(Translate("charge", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "MISSILE")
                {
                    UnturnedChat.Say(Translate("missile", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "BONES")
                {
                    UnturnedChat.Say(Translate("bones", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "SPLASH")
                {
                    UnturnedChat.Say(Translate("splash", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "ACID")
                {
                    UnturnedChat.Say(Translate("acid", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "SPIT")
                {
                    UnturnedChat.Say(Translate("spit", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "BURNING")
                {
                    UnturnedChat.Say(Translate("burning", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "BURNER")
                {
                    UnturnedChat.Say(Translate("burner", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "BOULDER")
                {
                    UnturnedChat.Say(Translate("boulder", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "ARENA")
                {
                    UnturnedChat.Say(Translate("arena", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "SUICIDE" && Configuration.Instance.ShowSuicideMSG)
                {
                    UnturnedChat.Say(Translate("suicide", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
                else if (cause.ToString() == "GRENADE")
                {
                    UnturnedChat.Say(Translate("grenade", player.DisplayName), UnturnedChat.GetColorFromName(Configuration.Instance.DeathMessagesColor, Color.green));
                }
            }
        }
Exemple #30
0
 /// <summary>
 /// <para> call CloseP2PChannelWithUser() when you're done talking to a user on a specific channel. Once all channels</para>
 /// <para> open channels to a user have been closed, the open session to the user will be closed and new data from this</para>
 /// <para> user will trigger a P2PSessionRequest_t callback</para>
 /// </summary>
 public static bool CloseP2PChannelWithUser(CSteamID steamIDRemote, int nChannel)
 {
     InteropHelp.TestIfAvailableClient();
     return(NativeMethods.ISteamNetworking_CloseP2PChannelWithUser(CSteamAPIContext.GetSteamNetworking(), steamIDRemote, nChannel));
 }