Raised This Month: $453 Target: $400
 113% 

[ANY] SteamWorks


Post New Thread Reply   
 
Thread Tools Display Modes
KyleS
SourceMod Plugin Approver
Join Date: Jul 2009
Location: Segmentation Fault.
Old 04-14-2017 , 16:49   Re: [ANY] SteamWorks
Reply With Quote #541

Quote:
Originally Posted by cravenge View Post
By simply looking at the code, you're trying to make the function act like a void instead of an int as it is expecting a return value. Correct me if I'm wrong.
More then that, the dude's handling floats as ints and other weirdness... If all he had was this extension, sourcemod, metamod, and loaded it on his game it would probably work fine as it is for everyone else...
KyleS is offline
RumbleFrog
AlliedModders Donor
Join Date: Dec 2016
Location: HS
Old 04-14-2017 , 23:20   Re: [ANY] SteamWorks
Reply With Quote #542

Quote:
Originally Posted by KyleS View Post
More then that, the dude's handling floats as ints and other weirdness... If all he had was this extension, sourcemod, metamod, and loaded it on his game it would probably work fine as it is for everyone else...
Could you point it out on a specific line, it's hard for me to see my own mistake.
RumbleFrog is offline
cravenge
Veteran Member
Join Date: Nov 2015
Location: ♡ Hope's Peak Acad
Old 04-19-2017 , 08:55   Re: [ANY] SteamWorks
Reply With Quote #543

Quote:
Originally Posted by KyleS View Post
More then that, the dude's handling floats as ints and other weirdness... If all he had was this extension, sourcemod, metamod, and loaded it on his game it would probably work fine as it is for everyone else...
I've noticed it too. The coding seems really complicated to me and near to the point that it is just a bunch of junk, no offense to the coder though.

Quote:
Originally Posted by RumbleFrog View Post
Could you point it out on a specific line, it's hard for me to see my own mistake.
I think re-coding everything should help but I do not guarantee successful pinpointing of those mistakes.
__________________

Last edited by cravenge; 04-19-2017 at 08:56.
cravenge is offline
RumbleFrog
AlliedModders Donor
Join Date: Dec 2016
Location: HS
Old 04-19-2017 , 17:17   Re: [ANY] SteamWorks
Reply With Quote #544

Quote:
Originally Posted by cravenge View Post
I've noticed it too. The coding seems really complicated to me and near to the point that it is just a bunch of junk, no offense to the coder though.

I think re-coding everything should help but I do not guarantee successful pinpointing of those mistakes.
I fixed this, didn't make changes to that section.
RumbleFrog is offline
Neuro Toxin
Veteran Member
Join Date: Oct 2013
Location: { closing the void; }
Old 04-19-2017 , 17:48   Re: [ANY] SteamWorks
Reply With Quote #545

Quote:
Originally Posted by RumbleFrog View Post
I fixed this, didn't make changes to that section.
Wanna share what you did wrong after countless posts including a useless thread because you were impatient?
__________________
Neuro Toxin is offline
RumbleFrog
AlliedModders Donor
Join Date: Dec 2016
Location: HS
Old 04-20-2017 , 18:03   Re: [ANY] SteamWorks
Reply With Quote #546

Quote:
Originally Posted by Neuro Toxin View Post
Wanna share what you did wrong after countless posts including a useless thread because you were impatient?
Nah, I think I'm good, thank you for politely asking.
RumbleFrog is offline
dustinandband
Member
Join Date: May 2015
Old Yesterday , 11:07   Re: [ANY] SteamWorks
Reply With Quote #547

Hello,

Trying to get a plugin to work that uses this extention. The plugin requires Steamworks to be installed on the server. However I don't think I installed it correctly.

> Installed latest dev build from http://users.alliedmods.net/~kyles/builds/SteamWorks/
> Not sure where to install the main attached file ("SteamClient.tar.xz") since I can't find any file paths that are similar within the server.

To prevent non-group members from using our L4D2 servers (we're adding a bunch of addon maps and rayman's mutation mod), we're adding a check that on first connect - at least one client is a group member. If none is found - the server will quit (a cron job will then auto-relaunch the server when no screen session is found):

PHP Code:
//Pragma
#pragma semicolon 1
//#pragma newdecls required

//Sourcemod Includes
#include <sourcemod>
#include <sourcemod-misc>
#include <SteamWorks>

//ConVars
ConVar convar_Status;

//Globals
bool g_bIsPartOfGroup[MAXPLAYERS 1];

public 
Plugin myinfo 
{
    
name "Group Check"
    
author "Keith Warren (Drixevel)"
    
description "Checks the players if they're in a group and handles the server with the information."
    
version "1.0.0"
    
url "http://www.drixevel.com/"
};

public 
void OnPluginStart()
{
    
LoadTranslations("common.phrases");
    
    
convar_Status CreateConVar("sm_groupcheck_status""1""Status of the plugin.\n1 = on, 0 = off"FCVAR_NOTIFYtrue0.0true1.0);
    
AutoExecConfig();
    
    
HookEvent("round_freeze_end"Event_OnRoundFreezeEnd);
}

public 
void OnConfigsExecuted()
{

}

public 
void Event_OnRoundFreezeEnd(Event event, const char[] namebool dontBroadcast)
{
    if (!
GetConVarBool(convar_Status))
    {
        return;
    }
    
    
CreateTimer(2.0Timer_CheckStatus_TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action Timer_CheckStatus(Handle timer)
{
    
bool closeserver;
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && !IsFakeClient(i) && !g_bIsPartOfGroup[i])
        {
            
closeserver true;
        }
    }
    
    if (
closeserver)
    {
        
PrintToChatAll("\x06[SM] No players in session belong to steam group...");
        
        
CreateTimer(5.0Timer_Message2_TIMER_FLAG_NO_MAPCHANGE);
    }
}

public 
Action Timer_Message2(Handle timer)
{
    
PrintToChatAll("\x06Please join our steam group to use our servers:");
    
PrintToChatAll("\x06 GROUP_URL");
    
    
CreateTimer(5.0Timer_Message3_TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action Timer_Message3(Handle timer)
{
    
PrintToChatAll("\x06[SM] server shutting down in 10 seconds...");
    
    
CreateTimer(10.0Timer_Shutdown_TIMER_FLAG_NO_MAPCHANGE);
}

public 
Action Timer_Shutdown(Handle timer)
{
    
ServerCommand("_restart");
}

public 
void OnClientPutInServer(int client)
{
    if (!
GetConVarBool(convar_Status) || IsFakeClient(client))
    {
        return;
    }
    
    
SteamWorks_GetUserGroupStatus(clientGROUPID);
}

public 
int SteamWorks_OnClientGroupStatus(int authidint groupidbool isMemberbool isOfficer)
{
    
int client GetClientFromAuthId(authid);
    
    if (
client == 0)
    {
        return;
    }
    
    
g_bIsPartOfGroup[client] = isMember;
}

int GetClientFromAuthId(int authid)
{
    for (
int i 1<= MaxClientsi++)
    {
        if (
IsClientInGame(i) && authid == GetSteamAccountID(i))
        {
            return 
i;
        }
    }
    
    return 
0;

dustinandband is offline
dustinandband
Member
Join Date: May 2015
Old Yesterday , 11:36   Re: [ANY] SteamWorks
Reply With Quote #548

Sorry user error - should've at least read the code. Needs to be hooked to OnMapStart instead of round_freeze_end lol
dustinandband is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 07:01.


Powered by vBulletin®
Copyright ©2000 - 2017, vBulletin Solutions, Inc.
Theme made by Freecode