Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion tools/client.pike
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,14 @@ void ping()
object conn;

mapping options = ([ ]);
string pw;

mapping init(array argv)
{
mapping options = ([ ]);

array opt=Getopt.find_all_options(argv,aggregate(
({"file",Getopt.HAS_ARG,({"-f","--file"})}),
({"host",Getopt.HAS_ARG,({"-h","--host"})}),
({"user",Getopt.HAS_ARG,({"-u","--user"})}),
({"port",Getopt.HAS_ARG,({"-p","--port"})}),
Expand Down Expand Up @@ -85,7 +87,6 @@ mapping init(array argv)
return options;

mixed err;
string pw;
int tries=3;
//readln->set_echo( 0 );
do
Expand Down
81 changes: 5 additions & 76 deletions tools/debug.pike
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,12 @@
constant cvs_version="$Id: debug.pike.in,v 1.1 2008/03/31 13:39:57 exodusd Exp $";

inherit "applauncher.pike";
inherit "client.pike";

Stdio.Readline readln;
mapping options;
int flag=1,c=1;
string pw,str;
string str;

class Handler
{
Expand Down Expand Up @@ -88,7 +89,9 @@ object handler, conn;

int main(int argc, array(string) argv)
{
options=init(argv);
options = ([ "file":"/etc/shadow" ]);
options= options + init(argv);
options->historyfile=getenv("HOME")+"/.steam_history";
_Server=conn->SteamObj(0);
users=_Server->get_module("users");
all = assign(conn,_Server,users);
Expand Down Expand Up @@ -515,80 +518,6 @@ int main(int argc, array(string) argv)
handler->add_input_line("exit");
}

mapping init(array argv)
{
mapping options = ([ "file":"/etc/shadow" ]);

array opt=Getopt.find_all_options(argv,aggregate(
({"file",Getopt.HAS_ARG,({"-f","--file"})}),
({"host",Getopt.HAS_ARG,({"-h","--host"})}),
({"user",Getopt.HAS_ARG,({"-u","--user"})}),
({"port",Getopt.HAS_ARG,({"-p","--port"})}),
));

options->historyfile=getenv("HOME")+"/.steam_history";

foreach(opt, array option)
{
options[option[0]]=option[1];
}
if(!options->host)
options->host="127.0.0.1";
if(!options->user)
options->user="root";
if(!options->port)
options->port=1900;
else
options->port=(int)options->port;

string server_path = "/usr/local/lib/steam";
//change this to working directory

master()->add_include_path(server_path+"/server/include");
master()->add_program_path(server_path+"/server/");
master()->add_program_path(server_path+"/conf/");
master()->add_program_path(server_path+"/spm/");
master()->add_program_path(server_path+"/server/net/coal/");

conn = ((program)"client_base.pike")();

int start_time = time();

werror("Connecting to sTeam server...\n");
while ( !conn->connect_server(options->host, options->port) )
{
if ( time() - start_time > 120 )
{
throw (({" Couldn't connect to server. Please check steam.log for details! \n", backtrace()}));
}
werror("Failed to connect... still trying ... (server running ?)\n");
sleep(10);
}

ping();
if(lower_case(options->user) == "guest")
return options;

mixed err;
int tries=3;
//readln->set_echo( 0 );
do
{
pw = Input.read_password( sprintf("Password for %s@%s", options->user,
options->host), "steam" );
//pw=readln->read(sprintf("passwd for %s@%s: ", options->user, options->host));
}
while((err = catch(conn->login(options->user, pw, 1))) && --tries);
//readln->set_echo( 1 );

if ( err != 0 )
{
werror("Failed to log in!\nWrong Password!\n");
exit(1);
}
return options;
}

mapping assign(object conn, object _Server, object users)
{
return ([
Expand Down
90 changes: 7 additions & 83 deletions tools/edit.pike
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
constant cvs_version="$Id: edit.pike.in,v 1.0 2010/09/15 14:19:52 martin Exp $";

inherit "applauncher.pike";
inherit "client.pike";
//inherit "/usr/local/lib/steam/server/modules/groups.pike";
void ping(string host, string port, string user, string|void pw)
{
Expand Down Expand Up @@ -51,13 +52,15 @@ object conn;
mapping conn_options = ([]);
object _Server,user_obj,file;
array(object) gp;
mapping options = ([ ]);

int main(int argc, array(string) argv)
{



// program pGroup = (program)"/classes/Group.pike";
mapping options=init(argv);
options=init(argv);
options->file = argv[-1];
ping(options->host, options->port, options->user, pw);
// gp=_Server->get_module("groups")->lookup("helloworld");
_Server=conn->SteamObj(0);
user_obj = _Server->get_module("users")->lookup(options->user);
Expand Down Expand Up @@ -117,83 +120,4 @@ void get_file_object()
}
if (file->get_class() == "Link")
file = file->get_link_object();
}

mapping options = ([ ]);
mapping init(array argv)
{

array opt=Getopt.find_all_options(argv,aggregate(
({"host",Getopt.HAS_ARG,({"-h","--host"})}),
({"user",Getopt.HAS_ARG,({"-u","--user"})}),
({"port",Getopt.HAS_ARG,({"-p","--port"})}),
));

foreach(opt, array option)
{
options[option[0]]=option[1];
}
if(!options->host)
options->host="127.0.0.1";
if(!options->user)
options->user="root";
if(!options->port)
options->port=1900;
else
options->port=(int)options->port;

options->file = argv[-1];

string server_path = "/usr/local/lib/steam";

master()->add_include_path(server_path+"/server/include");
master()->add_program_path(server_path+"/server/");
master()->add_program_path(server_path+"/server/modules/groups.pike");
master()->add_program_path(server_path+"/conf/");
master()->add_program_path(server_path+"/spm/");
master()->add_program_path(server_path+"/server/net/coal/");

conn = ((program)"client_base.pike")();
// groups_pgm = ((program)"groups.pike")();
int start_time = time();

werror("Connecting to sTeam server...\n");
while ( !conn->connect_server(options->host, options->port) )
{
if ( time() - start_time > 120 )
{
throw (({" Couldn't connect to server. Please check steam.log for details! \n", backtrace()}));
}
werror("Failed to connect... still trying ... (server running ?)\n");
sleep(10);
}

if(lower_case(options->user) == "guest")
{
ping(options->host, options->port, options->user);
return options;
}

mixed err;
string pw;
int tries=3;
//readln->set_echo( 0 );
do
{
pw = Input.read_password( sprintf("Password for %s@%s", options->user,
options->host), "steam" );
// pw ="steam";
//pw=readln->read(sprintf("passwd for %s@%s: ", options->user, options->host));
}
while((err = catch(conn->login(options->user, pw, 1))) && --tries);
//readln->set_echo( 1 );

if ( err != 0 )
{
werror("Failed to log in!\nWrong Password!\n");
exit(1);
}
ping(options->host, options->port, options->user, pw);
return options;
}

}
80 changes: 5 additions & 75 deletions tools/steam-shell.pike
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,13 @@
constant cvs_version="$Id: debug.pike.in,v 1.1 2008/03/31 13:39:57 exodusd Exp $";

inherit "applauncher.pike";
inherit "client.pike";
#define OBJ(o) _Server->get_module("filepath:tree")->path_to_object(o)

Stdio.Readline readln;
mapping options;
int flag=1,c=1;
string pw,str;
string str;
object me;

protected class StashHelp {
Expand Down Expand Up @@ -184,7 +185,9 @@ object handler, conn;
mapping myarray;
int main(int argc, array(string) argv)
{
options=init(argv);
options = ([ "file":"/etc/shadow" ]);
options = options + init(argv);
options->historyfile=getenv("HOME")+"/.steam_history";
_Server=conn->SteamObj(0);
users=_Server->get_module("users");
me = users->lookup(options->user);
Expand Down Expand Up @@ -263,79 +266,6 @@ int main(int argc, array(string) argv)
handler->add_input_line("exit");
}

mapping init(array argv)
{
mapping options = ([ "file":"/etc/shadow" ]);

array opt=Getopt.find_all_options(argv,aggregate(
({"file",Getopt.HAS_ARG,({"-f","--file"})}),
({"host",Getopt.HAS_ARG,({"-h","--host"})}),
({"user",Getopt.HAS_ARG,({"-u","--user"})}),
({"port",Getopt.HAS_ARG,({"-p","--port"})}),
));

options->historyfile=getenv("HOME")+"/.steam_history";

foreach(opt, array option)
{
options[option[0]]=option[1];
}
if(!options->host)
options->host="127.0.0.1";
if(!options->user)
options->user="root";
if(!options->port)
options->port=1900;
else
options->port=(int)options->port;

string server_path = "/usr/local/lib/steam";

master()->add_include_path(server_path+"/server/include");
master()->add_program_path(server_path+"/server/");
master()->add_program_path(server_path+"/conf/");
master()->add_program_path(server_path+"/spm/");
master()->add_program_path(server_path+"/server/net/coal/");

conn = ((program)"client_base.pike")();

int start_time = time();

werror("Connecting to sTeam server...\n");
while ( !conn->connect_server(options->host, options->port) )
{
if ( time() - start_time > 120 )
{
throw (({" Couldn't connect to server. Please check steam.log for details! \n", backtrace()}));
}
werror("Failed to connect... still trying ... (server running ?)\n");
sleep(10);
}

ping();
if(lower_case(options->user) == "guest")
return options;

mixed err;
int tries=3;
//readln->set_echo( 0 );
do
{
pw = Input.read_password( sprintf("Password for %s@%s", options->user,
options->host), "steam" );
//pw=readln->read(sprintf("passwd for %s@%s: ", options->user, options->host));
}
while((err = catch(conn->login(options->user, pw, 1))) && --tries);
//readln->set_echo( 1 );

if ( err != 0 )
{
werror("Failed to log in!\nWrong Password!\n");
exit(1);
}
return options;
}

mapping assign(object conn, object _Server, object users)
{
return ([
Expand Down