Topic: /admins modification
/admins only can check admin online, how i can to cek, /voponline for voice operator online ?
PvPGN Community Forums |
forums.pvpgn.pro → [EN] The Source Code → /admins modification
/admins only can check admin online, how i can to cek, /voponline for voice operator online ?
You have to add a command, similar to /admins
You have to add a command, similar to /admins
but there is no get_auth_vop ??
Then you probably have to make it.
how about change alias command to pvpgn command ?
like //doubt we changed to /doubt ?
/admins only can check admin online, how i can to cek, /voponline for voice operator online ?
/online
This my code:
static int _handle_onlinecrew_command(t_connection * c, char const *text)
{
unsigned int i;
t_elem const * curr;
t_connection * tc;
char const * nick;
std::strcpy(msgtemp,"Currently Online Crew:");
i = std::strlen(msgtemp);
LIST_TRAVERSE_CONST(connlist(),curr)
{
tc = (t_connection*)elem_get_data(curr);
if (!tc)
continue;
if (!conn_get_account(tc))
continue;
if ( (account_get_auth_master(conn_get_account(tc),NULL)==1) ||
(account_get_auth_developer(conn_get_account(tc),NULL)==1) ||
(account_get_auth_headadmin(conn_get_account(tc),NULL)==1) ||
(account_get_auth_admin(conn_get_account(tc),NULL)==1) ||
(account_get_auth_supervisor(conn_get_account(tc),NULL)==1) ||
(account_get_auth_headoperator(conn_get_account(tc),NULL)==1) ||
(account_get_auth_operator(conn_get_account(tc),NULL)==1) ||
(account_get_auth_voiceoperator(conn_get_account(tc),NULL)==1) ||
(account_get_auth_cat(conn_get_account(tc),NULL)==1) ||
(account_get_auth_te(conn_get_account(tc),NULL)==1))
{
if ((nick = conn_get_username(tc)))
{
if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */
{
message_send_text(c,message_type_info,c,msgtemp);
i = 0;
}
std::sprintf(&msgtemp[i]," %s", nick);
i += std::strlen(&msgtemp[i]);
}
}
}
if (i>0)
message_send_text(c,message_type_info,c,msgtemp);
return 0;
}
gravestar wrote:/admins only can check admin online, how i can to cek, /voponline for voice operator online ?
/online
This my code:static int _handle_onlinecrew_command(t_connection * c, char const *text) { unsigned int i; t_elem const * curr; t_connection * tc; char const * nick; std::strcpy(msgtemp,"Currently Online Crew:"); i = std::strlen(msgtemp); LIST_TRAVERSE_CONST(connlist(),curr) { tc = (t_connection*)elem_get_data(curr); if (!tc) continue; if (!conn_get_account(tc)) continue; if ( (account_get_auth_master(conn_get_account(tc),NULL)==1) || (account_get_auth_developer(conn_get_account(tc),NULL)==1) || (account_get_auth_headadmin(conn_get_account(tc),NULL)==1) || (account_get_auth_admin(conn_get_account(tc),NULL)==1) || (account_get_auth_supervisor(conn_get_account(tc),NULL)==1) || (account_get_auth_headoperator(conn_get_account(tc),NULL)==1) || (account_get_auth_operator(conn_get_account(tc),NULL)==1) || (account_get_auth_voiceoperator(conn_get_account(tc),NULL)==1) || (account_get_auth_cat(conn_get_account(tc),NULL)==1) || (account_get_auth_te(conn_get_account(tc),NULL)==1)) { if ((nick = conn_get_username(tc))) { if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */ { message_send_text(c,message_type_info,c,msgtemp); i = 0; } std::sprintf(&msgtemp[i]," %s", nick); i += std::strlen(&msgtemp[i]); } } } if (i>0) message_send_text(c,message_type_info,c,msgtemp); return 0; }
1>..\..\..\src\bnetd\command.cpp(370) : error C3646: 't_command_table_row' : unknown override specifier
1>..\..\..\src\bnetd\command.cpp(370) : error C3646: 'standard_command_table' : unknown override specifier
1>..\..\..\src\bnetd\command.cpp(370) : error C2090: function returns array
1>..\..\..\src\bnetd\command.cpp(370) : error C2272: '_handle_onlinecrew_command' : modifiers not allowed on static member functions
1>..\..\..\src\bnetd\command.cpp(370) : error C2072: 'pvpgn::bnetd::_handle_onlinecrew_command' : initialization of a function
1>..\..\..\src\bnetd\command.cpp(372) : error C2078: too many initializers
1>..\..\..\src\bnetd\command.cpp(373) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Zeloit wrote:gravestar wrote:/admins only can check admin online, how i can to cek, /voponline for voice operator online ?
/online
This my code:static int _handle_onlinecrew_command(t_connection * c, char const *text) { unsigned int i; t_elem const * curr; t_connection * tc; char const * nick; std::strcpy(msgtemp,"Currently Online Crew:"); i = std::strlen(msgtemp); LIST_TRAVERSE_CONST(connlist(),curr) { tc = (t_connection*)elem_get_data(curr); if (!tc) continue; if (!conn_get_account(tc)) continue; if ( (account_get_auth_master(conn_get_account(tc),NULL)==1) || (account_get_auth_developer(conn_get_account(tc),NULL)==1) || (account_get_auth_headadmin(conn_get_account(tc),NULL)==1) || (account_get_auth_admin(conn_get_account(tc),NULL)==1) || (account_get_auth_supervisor(conn_get_account(tc),NULL)==1) || (account_get_auth_headoperator(conn_get_account(tc),NULL)==1) || (account_get_auth_operator(conn_get_account(tc),NULL)==1) || (account_get_auth_voiceoperator(conn_get_account(tc),NULL)==1) || (account_get_auth_cat(conn_get_account(tc),NULL)==1) || (account_get_auth_te(conn_get_account(tc),NULL)==1)) { if ((nick = conn_get_username(tc))) { if (i+std::strlen(nick)+2>sizeof(msgtemp)) /* " ", name, '\0' */ { message_send_text(c,message_type_info,c,msgtemp); i = 0; } std::sprintf(&msgtemp[i]," %s", nick); i += std::strlen(&msgtemp[i]); } } } if (i>0) message_send_text(c,message_type_info,c,msgtemp); return 0; }
1>..\..\..\src\bnetd\command.cpp(370) : error C3646: 't_command_table_row' : unknown override specifier
1>..\..\..\src\bnetd\command.cpp(370) : error C3646: 'standard_command_table' : unknown override specifier
1>..\..\..\src\bnetd\command.cpp(370) : error C2090: function returns array
1>..\..\..\src\bnetd\command.cpp(370) : error C2272: '_handle_onlinecrew_command' : modifiers not allowed on static member functions
1>..\..\..\src\bnetd\command.cpp(370) : error C2072: 'pvpgn::bnetd::_handle_onlinecrew_command' : initialization of a function
1>..\..\..\src\bnetd\command.cpp(372) : error C2078: too many initializers
1>..\..\..\src\bnetd\command.cpp(373) : fatal error C1903: unable to recover from previous error(s); stopping compilation
Remember, you create code to account_wrap.cpp and account_wrap.h..
if not code on account, not work this code
example: account_get_master to creating in the account wrap file
Remember too:
static int _handle_onlinecrew_command(t_connection * c, char const * text);
{ "/online" , _handle_onlinecrew_command },
because in this code is important to working compile
forums.pvpgn.pro → [EN] The Source Code → /admins modification