📄 cipserver.java
字号:
import java.io.*;
import java.net.*;
import java.util.Vector;
import java.util.Calendar;
import java.util.GregorianCalendar;
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import sun.audio.*;
class Admin implements Serializable
{
String Admin="";
String YNnewAdmin="";
}
class SCMessage implements Serializable
{
String scMessage;
}
class RegSCMessage implements Serializable
{
String RegscMessage;
}
class LoginSCMessage implements Serializable
{
String LoginscMessage;
}
class GLogin implements Serializable
{
String name;
String VER;
String GLoginMessage="1";
}
class FromU238 implements Serializable
{
String ToU238Name;
String FromName;
String WhatOperation;
String U="0";
}
class U238 implements Serializable
{
String U238;
int U238N;
String FromName;
String WhatOperation;
String U="0";
String Twho="";
String YNQZTR="0";
}
class Reg implements Serializable
{
String Name;
String Pass;
String Pass2;
String Age;
String Sex;
String jhmp;
String WebURL;
String QQ;
String From;
String Other;
String IP;
}
class Login implements Serializable
{
String Name;
String Pass;
}
class Title implements Serializable
{
String fromwho;
String towho;
String Titleinformation;
String TitleXQ="";
String fromQ="";
String fromH="";
String toQ="";
String toH="";
String YNLogin="";
}
class Chat implements Serializable
{
String fromwho;
String towho;
String chatinformation;
String YNSL;
String ChatXQ="";
String fromQ="";
String fromH="";
String toQ="";
String toH="";
}
class PM implements Serializable
{
String fromwho;
String towho;
String PMinformation;
String PMXQ="";
}
class AD implements Serializable
{
String AD;
}
class Exit implements Serializable
{
String name;
}
class OnlineUser implements Serializable
{
String OnlineUserList="大家";
String newuser;
String exituser;
String operation;
String custIP;
String Q="";
String H="";
}
public class CipServer implements Runnable,ActionListener
{
JFrame frameMain;
JPanel panelMain;
JPanel panelChat;
JPanel panelOperation;
Label labelSendAD;
Label labelSendPMAll;
Label labelSendU238;
Label labelSendTR;
Label labelSendSetAdmin;
Label labelKB2;
Label labelKB;
Button buttonSendAD;
Button buttonSendPMAll;
Button buttonSendU238;
Button buttonSendTR;
Button buttonSendQZTR;
Button buttonSendQTR;
Button buttonSendSetAdmin;
Button buttonSendClsSLPM;
Button buttonSendCls;
Button buttonSendClose;
TextArea textSendAD;
TextField textSendPMAll;
TextField textSendU238;
TextField textSendTR;
TextField textSendSetAdmin;
TextArea text;
TextArea textSL;
TextArea textPM;
List list;
JPasswordField textAdminPass;
JPasswordField textSuperAdminPass;
ServerSocket server;
Socket fromClient;
Thread serverThread;
static Vector onlineuser=new Vector(1,1);
AudioStream cxajh_music_cd;
FileInputStream cxajh_mid_cd;
GridBagLayout gl;
GridBagConstraints gbc;
Calendar calendar;
String dateSystemTime;
String dateSystemDate;
static String SystemADall="欢迎大家来到【祝贺笑傲江湖】!!!祝您聊的愉快哦!!!\n本江湖的网址是:http://cxajh.126.com\n"
+"黄金广告位!有意者请发E-mail到congsoft@yahoo.com.cn";
static String Titleall="";
static String AdminAll="";
static String SystemTitleXQ="高兴地";
static String SystemTitleMessage="欢迎大家使用标题功能!";
static String SystemTitleFromName="CIP";
static String SystemTitleToName="大家";
static String SystemAdminPass="123123";
static String SystemSuperAdminPass="12345678";
static int SystemSetUsePost=1001;
public CipServer(int setUsePost,String adminAll,String adminSet,String AdminPass,String SuperAdminPass)
{
frameMain =new JFrame("【祝贺笑傲江湖】服务器测试版v1.0 By:CIP Test:CIP QYC 建议使用1024*768分辨率来执行本江湖服务器能达到最佳效果");
panelMain =new JPanel();
panelChat =new JPanel();
panelOperation =new JPanel();
labelSendAD =new Label("请输入系统公告内容:");
labelSendPMAll =new Label("请输入群千里传音内容");
labelSendU238 =new Label("请输入原子弹投给谁:");
labelSendTR =new Label("请输入要踢的人:");
labelSendSetAdmin =new Label("请输入要设置为管理员的人: (注意:以前的将被覆盖更新掉!如果有多个请用“/”分隔!谢谢!)");
labelKB2 =new Label("以下为江湖服务器管理功能!请输入管理密码或者超级管理密码:");
labelKB =new Label("警告:以下四个功能慎用!否则一切后果自负!请输入超级管理密码:");
buttonSendAD =new Button("发布系统公告");
buttonSendPMAll =new Button("发布群千里传音");
buttonSendU238 =new Button("投特大核能飞弹");
buttonSendTR =new Button("踢人");
buttonSendQZTR =new Button("强制踢人");
buttonSendQTR =new Button("群踢人");
buttonSendSetAdmin=new Button("设置江湖管理员");
buttonSendClsSLPM =new Button("清除〖私聊监视日志〗及〖千里传音监视日志〗");
buttonSendCls =new Button("清除服务器总日志");
buttonSendClose =new Button("关闭江湖服务器");
textSendAD =new TextArea("",2,38,text.SCROLLBARS_VERTICAL_ONLY);
textSendPMAll =new TextField(1);
textSendU238 =new TextField(1);
textSendTR =new TextField(1);
textSendSetAdmin =new TextField(1);
text =new TextArea("",18,38,text.SCROLLBARS_VERTICAL_ONLY);
textSL =new TextArea("",3,38,text.SCROLLBARS_VERTICAL_ONLY);
textPM =new TextArea("",3,38,text.SCROLLBARS_VERTICAL_ONLY);
list =new List(18);
textAdminPass =new JPasswordField(1);
textSuperAdminPass=new JPasswordField(1);
gl =new GridBagLayout();
gbc =new GridBagConstraints();
panelMain.setBackground(new Color(50,135,0));
text.setBackground(new Color(250,235,220));
text.setForeground(new Color(0,0,153));
textSL.setBackground(new Color(254,255,204));
textSL.setForeground(new Color(50,135,0));
textPM.setBackground(new Color(254,255,204));
textPM.setForeground(new Color(50,135,0));
//textPM.setBackground(new Color(250,235,220));
//textPM.setForeground(new Color(0,0,153));
//list.setBackground(new Color(250,235,200));
//list.setForeground(new Color(0,0,153));
list.setBackground(new Color(254,255,204));
list.setForeground(new Color(50,135,0));
SystemSetUsePost=setUsePost;
SystemAdminPass=AdminPass;
SystemSuperAdminPass=SuperAdminPass;
labelSendAD.setForeground(new Color(250,235,110));
labelSendPMAll.setForeground(new Color(250,235,110));
labelSendU238.setForeground(new Color(250,235,110));
labelSendTR.setForeground(new Color(250,235,110));
labelSendSetAdmin.setForeground(new Color(250,235,110));
labelKB2.setForeground(new Color(250,235,110));
labelKB.setForeground(new Color(250,235,110));
buttonSendAD.setBackground(new Color(250,235,110));
buttonSendPMAll.setBackground(new Color(250,235,110));
buttonSendU238.setBackground(new Color(250,235,110));
buttonSendTR.setBackground(new Color(250,235,110));
buttonSendQZTR.setBackground(new Color(250,235,110));
buttonSendSetAdmin.setBackground(new Color(250,235,110));
buttonSendQTR.setBackground(Color.red);
buttonSendQTR.setForeground(Color.yellow);
buttonSendClsSLPM.setBackground(Color.red);
buttonSendClsSLPM.setForeground(Color.yellow);
buttonSendCls.setBackground(Color.red);
buttonSendCls.setForeground(Color.yellow);
buttonSendClose.setBackground(Color.red);
buttonSendClose.setForeground(Color.yellow);
textSendAD.setBackground(new Color(254,255,204));
textSendPMAll.setBackground(new Color(254,255,204));
textSendU238.setBackground(new Color(254,255,204));
textSendTR.setBackground(new Color(254,255,204));
textSendSetAdmin.setBackground(new Color(254,255,204));
textAdminPass.setBackground(new Color(254,255,204));
textSuperAdminPass.setBackground(new Color(254,255,204));
textSendAD.setForeground(new Color(50,135,0));
textSendPMAll.setForeground(new Color(50,135,0));
textSendU238.setForeground(new Color(50,135,0));
textSendTR.setForeground(new Color(50,135,0));
textSendSetAdmin.setForeground(new Color(50,135,0));
textAdminPass.setForeground(new Color(50,135,0));
textSuperAdminPass.setForeground(new Color(50,135,0));
AdminAll=adminAll;
textSendAD.setText(SystemADall);
textSendSetAdmin.setText(adminSet);
try
{
cxajh_mid_cd=new FileInputStream("./dz/cd.mid");
cxajh_music_cd=new AudioStream(cxajh_mid_cd);
}
catch(Exception ex)
{
ex.printStackTrace();
}
calendar=new GregorianCalendar();
dateSystemTime=calendar.get(Calendar.HOUR)+":"+calendar.get(Calendar.MINUTE)+":"+calendar.get(Calendar.SECOND);
frameMain.getContentPane().add(panelMain);
panelMain.setLayout(gl);
gbc.fill=GridBagConstraints.BOTH;
gbc.anchor=GridBagConstraints.NORTHWEST;
gbc.weightx=10;
gbc.weighty=9.0;
gl.setConstraints(text,gbc);
panelMain.add(text);
gbc.gridwidth=GridBagConstraints.REMAINDER;
gl.setConstraints(list,gbc);
panelMain.add(list);
//panelMain.add(panelChat);
gbc.weightx=0;
gbc.weighty=0;
gbc.gridwidth=1;
gl.setConstraints(labelKB2,gbc);
panelMain.add(labelKB2);
gbc.gridwidth=GridBagConstraints.REMAINDER;
gl.setConstraints(textAdminPass,gbc);
panelMain.add(textAdminPass);
gbc.gridwidth=GridBagConstraints.REMAINDER;
gl.setConstraints(labelSendAD,gbc);
//panelMain.add(labelSendAD);
gbc.gridwidth=1;
gl.setConstraints(textSendAD,gbc);
panelMain.add(textSendAD);
gbc.gridwidth=GridBagConstraints.REMAINDER;
gl.setConstraints(buttonSendAD,gbc);
panelMain.add(buttonSendAD);
gbc.gridwidth=GridBagConstraints.REMAINDER;
gl.setConstraints(labelSendPMAll,gbc);
//panelMain.add(labelSendPMAll);
gbc.gridwidth=1;
gl.setConstraints(textSendPMAll,gbc);
panelMain.add(textSendPMAll);
gbc.gridwidth=GridBagConstraints.REMAINDER;
gl.setConstraints(buttonSendPMAll,gbc);
panelMain.add(buttonSendPMAll);
gbc.gridwidth=GridBagConstraints.REMAINDER;
gl.setConstraints(labelSendU238,gbc);
//panelMain.add(labelSendU238);
gbc.gridwidth=1;
gl.setConstraints(textSendU238,gbc);
panelMain.add(textSendU238);
gbc.gridwidth=GridBagConstraints.REMAINDER;
gl.setConstraints(buttonSendU238,gbc);
panelMain.add(buttonSendU238);
gbc.gridwidth=GridBagConstraints.REMAINDER;
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -