Anyone happen to remember what the Java Protocol API used for banning and muting users with it...? hrace009's vbox release had a forbid role plugin for pwAdmin but I don't have that release anymore.
I believe it also gets sent to gdeliveryd?
Printable View
Anyone happen to remember what the Java Protocol API used for banning and muting users with it...? hrace009's vbox release had a forbid role plugin for pwAdmin but I don't have that release anymore.
I believe it also gets sent to gdeliveryd?
I made a plugin sometime ago, using forbid role feature from iweb then imported as a pwAdmin plugin:
I hope it helps you :thumbup:Code:<%@ page language="java" pageEncoding="GB2312"%>
<%@ page import="com.goldhuman.auth.AuthFilter"%>
<%@ page import="com.goldhuman.service.interfaces.LogInfo"%>
<%@ page import="com.goldhuman.service.interfaces.SimpleRoleBean"%>
<%@ page import="com.goldhuman.service.interfaces.GMService"%>
<%@ page import="com.goldhuman.service.GMServiceImpl"%>
<%@ page import="org.apache.commons.logging.LogFactory"%>
<%@ page import="java.util.*"%>
<%@ page import="java.io.*"%>
<%
request.setCharacterEncoding("GB2312");
String userid = "";
String roleid2 = "";
String rname = "";
String biao = request.getParameter("biao");
if (biao != null && biao.equals("1")) {
userid = request.getParameter("userid");
}
if (biao != null && biao.equals("2")) {
roleid2 = request.getParameter("roleid2");
if (roleid2 != null && roleid2.trim().length() > 0) {
try {
int rid2 = Integer.parseInt(roleid2);
userid = (rid2 & 0xFFFFFFF0) + "";
} catch (Exception e) {
out.println("Please input numbers! <span class='ver_10_black'>" + e.getMessage() + "</span>");
}
}
}
if (biao != null && biao.equals("3")) {
rname = request.getParameter("roname");
if (rname != null && rname.trim().length() > 0) {
try {
GMService gs = new GMServiceImpl();
int tem = gs.getRoleIdByName(rname, new LogInfo());
userid = (tem & 0xFFFFFFF0) + "";
} catch (Exception e) {
out.println("<span class='ver_10_black'>Not!</span>");
}
}
}
if (userid == null || userid.trim().length() < 1)
userid = (String) request.getAttribute("userid");
else
request.setAttribute("userid", userid);
String fbdtype = request.getParameter("fbdtype");
String forbidtime = request.getParameter("forbidtime");
String roleid = request.getParameter("roleid");
//String reason = reason = request.getParameter("reason");
String reason = request.getParameter("reason");
if (fbdtype == null)
fbdtype = "";
if (forbidtime == null)
forbidtime = "";
if (roleid == null)
roleid = "";
if (reason == null)
reason = "";
if (userid == null)
userid = "";
LogInfo info = null;
int uid = -1;
int rid = -1;
GMService gs = new GMServiceImpl();
String message = "<br>";
boolean allowed = false;
if(request.getSession().getAttribute("ssid") == null)
{
message = "<br><font color=\"#ee0000\"><b>Login to use Forbid Role Operations...</b></font>";
}
else
{
allowed = true;
}
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Role Management</title>
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="cache-control" content="no-cache">
<link rel="shortcut icon" href="../../include/fav.ico">
<link rel="stylesheet" type="text/css" href="../../include/style.css">
</head>
<body>
<table width="800" border="0" cellspacing="0">
<tr><td colspan="2"> </td></tr>
<% if(allowed){ %>
<tr><td colspan="2" class="ver_12_black_b"><b>Forbid Role Operations</b></td></tr>
<tr><td colspan="2"> </td></tr>
<tr>
<td width="3%"> </td>
<td width="97%"" align="left">
<!-- code: start -->
<form name="form1" action="index.jsp" method="post">
<table border="0" cellspacing="0" cellpadding="3">
<tr>
<td class="ver_10_black">
Check any user roles list
</td>
</tr>
<tr>
<td class="ver_10_black">
<input type="radio" name="biao" value="1" onclick="show(1)" checked="checked">Enter User ID:
</td>
<td>
<div id="uid" style="display:">
<input type="text" name="userid" value="<%=userid%>" size="16" maxlength="10" class="text_field"/>
</div>
</td>
</tr>
<tr>
<td class="ver_10_black">
<input type="radio" name="biao" value="2" onclick="show(2)">Enter Role ID:
</td>
<td>
<div id="rid2" style="display:none">
<input type="text" name="roleid2" value="<%=roleid2%>" size="16" maxlength="10" class="text_field"/>
</div>
</td>
</tr>
<tr>
<td class="ver_10_black">
<input type="radio" name="biao" value="3" onclick="show(3)">Enter Role Name:
</td>
<td class="ver_10_black">
<div id="rname" style="display:none">
<input type="text" name="roname" value="<%=rname%>" size="16" maxlength="10" class="text_field"/>
</div>
</td>
</tr>
<td></td>
<td class="ver_10_black"><input type="image" src="../../include/btn_submit.jpg" style="border: 0;"></input></td>
</tr>
</table>
</form>
</td>
</tr>
<%
if (userid != null && userid.trim().length() > 0) { %>
<tr>
<td> </td>
<td align="left">
<table border="0" cellspacing="1" cellpadding="3" bgcolor="#000000">
<tr>
<td class="ver_10_white">Role ID</td>
<td class="ver_10_white">Role Name</td>
<td class="ver_10_white">Role Level</td>
</tr>
<% try {
uid = Integer.parseInt(userid);
} catch (Exception ee) { %>
<span class="ver_10_black">Please input a number for User ID.</span> <span class="ver_10_red"><%=ee.getMessage()%></span>
<%
}
info = new LogInfo(uid, "", "List of Users");
Vector v = gs.getRolelist(uid, info);
if (v != null) {
for (int i = 0; i < v.size(); i++) {
SimpleRoleBean bean = (SimpleRoleBean) v.get(i);
%>
<tr bgcolor="#FFFFFF">
<td class="ver_10_black"><%=bean.roleid%></td>
<td class="ver_10_black"><%=bean.rolename%></td>
<td class="ver_10_black"><%=bean.level%></td>
</tr>
<% }
} %>
</table>
</td>
</tr>
<%
}%>
<tr>
<td> </td>
<td align="left">
<!-- class="ver_12_black_b-->
<form name="form2" action="index.jsp" method="post">
<table align="left" border="0" cellpadding="2" cellspacing="1">
<tr>
<td class="ver_10_black">
Parameters
</td>
</tr>
<tr>
<td align="left" class="ver_10_black">Forbidden Role ID:</td>
<td><input type="text" name="roleid" value="<%=roleid%>" size="20" maxlength="20" class="text_field"></td>
</tr>
<tr>
<td align="left" class="ver_10_black">Forbidden Type:</td>
<td>
<select name="fbdtype">
<option value="100">Forbid Sign In</option>
<option value="101">Forbid Talking</option>
<option value="102">Forbid Trade Among Players</option>
<option value="103">Forbid Selling Items</option>
</select>
</td>
</tr>
<tr>
<td align="left" class="ver_10_black">Forbid Time(in mins):</td>
<td class="ver_10_black">
<input type="text" name="forbidtime" value="<%=forbidtime%>" size="16" maxlength="10" class="text_field"/>
</td>
</tr>
<tr>
<td class="ver_10_black">Reason:</td>
<td>
<input type="text" name="reason" value="<%=reason%>" size="20" maxlength="20" class="text_field"/>
</td>
</tr>
<tr>
<td></td>
<td class="ver_10_black">
<input type="image" src="../../include/btn_submit.jpg" style="border: 0;"></input>
</td>
</tr>
</table>
</form>
</td>
</tr>
<tr>
<td> </td>
<td align="left">
<%
/*
* @param fbd_type : ·â½ûÀàÐÍ. 100:½ûÖ¹µÇ½; 101:½ûÑÔ; 102:½ûÖ¹Íæ¼Ò½»Ò×; 103:½ûÂô
* @param gmroleid : GM½ÇÉ«ID
* @param localsid : session ID,¿ÉÒÔºöÂÔ
* @param dstroleid : ±»·â½û½ÇÉ«ID
* @param forbid_time : ·â½ûʱ¼ä,µ¥Î»:Ãë
* @param reason : ·â½ûÔÒò
* @param loginfo : µ÷ÓÃÕßÐÅÏ¢
*/
int gmroleid = -1;
int localsid = -1;
int forbid_time = -1;
byte fbd_type = -1;
if (roleid != null && roleid.trim().length() > 0) { %>
<br>
<%
try {
rid = Integer.parseInt(roleid);
} catch (Exception e) {%>
<span class="ver_10_black">Please input a number for Role ID.</span> <span class="ver_10_red"><%=e.getMessage()%></span>
<%
}
try {
fbd_type = Byte.parseByte(fbdtype);
} catch (Exception ex) { %>
<span class="ver_10_black">Please input numbers.</span> <span class="ver_10_red"><%=ex.getMessage()%></span>
<%
}
try {
forbid_time = Integer.parseInt(forbidtime);
forbid_time = forbid_time * 60;
} catch (Exception exp) { %>
<span class="ver_10_black">Please input a number for Block Type.</span> <span class="ver_10_red"><%=exp.getMessage()%></span>
<%
}
info = new LogInfo(rid, "", "Forbid Role");
int flag = gs.forbidRole(fbd_type, gmroleid, localsid, rid,forbid_time, reason, info);
String result = null;
switch (flag) {
case -1:
result = "Failed";
break;
default:
result = flag + "";
}
String fbdType = "";
switch (fbd_type) {
case 100:
fbdType = "Forbid Sign in";
break;
case 101:
fbdType = "Forbid Talking";
break;
case 102:
fbdType = "Forbid Trade Among Players";
break;
case 103:
fbdType = "Forbid Selling";
}
%>
<br><br>
<table width="90%" align="left" border="0" cellpadding="2" cellspacing="1" bgcolor="#000000">
<tr>
<td class="ver_10_white">Forbidden Role ID</td>
<td class="ver_10_white">GM Role ID</td>
<td class="ver_10_white">Session ID</td>
<td class="ver_10_white">Forbid Type</td>
<td class="ver_10_white">Forbid Sign</td>
<td class="ver_10_white">Forbid Time</td>
<td class="ver_10_white">Reason</td>
</tr>
<tr bgcolor="#FFFFFF">
<td class="ver_10_black"><%=rid%></td>
<td class="ver_10_black"><%=gmroleid%></td>
<td class="ver_10_black"><%=localsid%></td>
<td class="ver_10_black"><%=fbdType%></td>
<td class="ver_10_black"><%=result%></td>
<td class="ver_10_black"><%=forbid_time%> secs</td>
<td class="ver_10_black"><%=reason%></td>
</tr>
</table>
<%}%>
<!-- code: end -->
</td>
</tr>
<% }
else {
out.print(message);
}
%>
<tr><td colspan="2"> </td></tr>
</table>
</td>
</tr>
</table>
<script language="javascript">
<!--
function show(t){
if(t==1)
document.getElementById("uid").style.display="";
else
document.getElementById("uid").style.display="none";
if(t==2)
document.getElementById("rid2").style.display="";
else
document.getElementById("rid2").style.display="none";
if(t==3)
document.getElementById("rname").style.display="";
else
document.getElementById("rname").style.display="none";
}
//-->
</script>
</body>
</html>
Romulan & Hrace009 please me
vbox how do I move the server to the local server ....??
only that I do not understand.
I wear PWServer Hrace009.