⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 cipclient.java

📁 笑傲江湖用JAVA开发的网络小游戏采用CS开发模式开发的
💻 JAVA
📖 第 1 页 / 共 5 页
字号:
		choiceAdmin.setForeground(Color.red);
		textOperationToName.setBackground(new Color(250,235,220));
		textOperationToName.setForeground(new Color(0,0,153));
		textOperationMessageSend.setBackground(new Color(254,255,204));
		textOperationMessageSend.setForeground(new Color(50,135,0));
		textOperationMessagePM.setBackground(new Color(250,235,220));
		
		buttonLoginOK.setBackground(new Color(250,235,110));
		buttonLoginReg.setBackground(new Color(250,235,110));
		buttonLoginCancel.setBackground(new Color(255,0,0));
		buttonLoginCancel.setForeground(new Color(250,235,110));
		buttonOperationSL.setBackground(new Color(250,235,110));
		buttonOperationSend.setBackground(new Color(250,235,110));
		buttonOperationRe.setBackground(new Color(250,235,110));
		buttonOperationPlayM.setBackground(new Color(250,235,110));
		buttonOperationStopM.setBackground(new Color(250,235,110));
		buttonOperationCls.setBackground(new Color(250,235,110));
		buttonOperationClsMe.setBackground(new Color(250,235,110));
		buttonOperationPM.setBackground(new Color(250,235,110));
		
		//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));
		
		labelLoginName.setForeground(new Color(250,235,110));
		labelLoginPass.setForeground(new Color(250,235,110));
		labelOperationTo.setForeground(new Color(250,235,110));
		
		//textChatMessage.setEnabled(false);
		textOperationFromName.setEnabled(false);
		choiceOperationXQ.setEnabled(false);
		choiceOperationCYGN.setEnabled(false);
		choiceOperationGLGN.setEnabled(false);
		choiceOperationMPGL.setEnabled(false);
		choiceAdmin.setEnabled(false);
		labelOperationTo.setEnabled(false);
		textOperationToName.setEnabled(false);
		textOperationMessageSend.setEnabled(false);
		textOperationMessagePM.setEnabled(false);
		
		//list.setEnabled(false);
		labelLoginName.setEnabled(false);
		labelLoginPass.setEnabled(false);
		buttonOperationSL.setEnabled(false);
		buttonOperationSend.setEnabled(false);
		buttonOperationRe.setEnabled(false);
		buttonOperationPlayM.setEnabled(false);
		buttonOperationStopM.setEnabled(false);
		buttonOperationCls.setEnabled(false);
		buttonOperationClsMe.setEnabled(false);
		buttonOperationPM.setEnabled(false);

		textLoginName.setEnabled(false);
		textLoginPass.setEnabled(false);
		buttonLoginOK.setEnabled(false);
		buttonLoginReg.setEnabled(false);
		//buttonLoginCancel.setEnabled(false);
		
		textOperationFromName.setEditable(false);
		textOperationToName.setEditable(false);
		textOperationMessageSend.setEditable(false);
		textOperationMessagePM.setEditable(false);
		textChatMessageAD.setEditable(false);
		textChatMessageTitle.setEditable(false);
		textChatMessage.setEditable(false);
		textChatMessageMe.setEditable(false);
		//list.setEditable(false);
		
		textLoginName.setEditable(false);
		textLoginPass.setEditable(false);
		
		textLoginName.addActionListener(this);
		textLoginPass.addActionListener(this);
		buttonLoginOK.addActionListener(this);
		buttonLoginReg.addActionListener(this);
		buttonLoginCancel.addActionListener(this);
		textOperationMessageSend.addActionListener(this);
		textOperationMessagePM.addActionListener(this);
		buttonOperationSL.addActionListener(this);
		//buttonOperationSL.addItemListener(this);
		list.addActionListener(this);
		buttonOperationSend.addActionListener(this);
		buttonOperationRe.addActionListener(this);
		buttonOperationPlayM.addActionListener(this);
		buttonOperationStopM.addActionListener(this);
		buttonOperationCls.addActionListener(this);
		buttonOperationClsMe.addActionListener(this);
		buttonOperationPM.addActionListener(this);
		
		choiceOperationCYGN.addItemListener(this);
		choiceOperationGLGN.addItemListener(this);
		
		frameMain.setSize(680,700);//x/y
		frameMain.setVisible(true);
		
		
		frameMain.setResizable(false);
	
		//frameMain.setDefaultCloseOperation(frameMain.EXIT_ON_CLOSE);
		frameMain.setDefaultCloseOperation(0);
		
		InetAddress address;
		GLogin objGLogin=new GLogin();
		objGLogin.VER="v1.21";
		try
		{
			calendar=new GregorianCalendar();
			dateSystemTime=calendar.get(Calendar.HOUR)+":"+calendar.get(Calendar.MINUTE)+":"+calendar.get(Calendar.SECOND);
			textChatMessage.append("【江湖消息】"+"["+dateSystemTime+"]"+"正在连接远程服务器 "+ServerIP+" 当中... 请稍等!谢谢!"+"\n");
			textChatMessageMe.append("【江湖消息】"+"["+dateSystemTime+"]"+"正在连接远程服务器 "+ServerIP+" 当中... 请稍等!谢谢!"+"\n");
			toServer=new Socket(ServerIP,ServerPOST);
			objectOut=new ObjectOutputStream(toServer.getOutputStream());
			objectIn=new ObjectInputStream(toServer.getInputStream());
			address=InetAddress.getLocalHost();
			objGLogin.name=address.getHostAddress();
			objectOut.writeObject(objGLogin);
		}
		catch(ConnectException e)
		{
			textChatMessage.setText("");
			textChatMessageMe.setText("");
			System.out.println("服务器不存在!或连服务器超时!请重新选择其它服务器!谢谢!"+"\n"+e);
			calendar=new GregorianCalendar();
			dateSystemTime=calendar.get(Calendar.HOUR)+":"+calendar.get(Calendar.MINUTE)+":"+calendar.get(Calendar.SECOND);
			textChatMessage.append("【江湖消息】"+"["+dateSystemTime+"]"+"远程服务器 "+ServerIP+" 未找到!或者还没有启动!或者连接超时!请重新连接其它服务器!谢谢!"+"\n");
			textChatMessageMe.append("【江湖消息】"+"["+dateSystemTime+"]"+"远程服务器 "+ServerIP+" 未找到!或者还没有启动!或者连接超时!请重新连接其它服务器!谢谢!"+"\n");
			SD1();
			return;
		}
		catch(IOException e)
		{
			System.out.println("99999999 IOException"+"\n"+e);
			SD1();
			return;
		}
		catch(Exception e)
		{
			try
			{
				toServer.close();
				objectOut.close();
				objectIn.close();
				System.out.println(e);
			}
			catch(IOException e1)
			{
				System.out.println("IOException"+"\n"+e1);
			}
			SD1();
			return;
		}
		clientThread=new Thread(this);
		clientThread.start();
		
		JS1();
		textChatMessage.setText("");
		textChatMessageMe.setText("");
		calendar=new GregorianCalendar();
		dateSystemTime=calendar.get(Calendar.HOUR)+":"+calendar.get(Calendar.MINUTE)+":"+calendar.get(Calendar.SECOND);
		textChatMessage.append("【江湖消息】"+"["+dateSystemTime+"]"+"欢迎您!IP地址为:"+objGLogin.name+" 的用户!连接服务器 "+ServerIP+" 成功!如果是老用户请直接输入用户名与密码登陆!如果是新用户请先注册!谢谢!"+"\n");
		textChatMessageMe.append("【江湖消息】"+"["+dateSystemTime+"]"+"欢迎您!IP地址为:"+objGLogin.name+" 的用户!连接服务器 "+ServerIP+" 成功!如果是老用户请直接输入用户名与密码登陆!如果是新用户请先注册!谢谢!"+"\n");
	}
	public void run()
	{
		while(true)
		{
			//music();
			try
			{
				System.out.println("8");
				Object objIn=objectIn.readObject();
				System.out.println("9");
				System.out.println("objIn.getClass().getName()"+objIn.getClass().getName());
				if (objIn.getClass().getName().compareTo("U238")==0)
				{
					System.out.println("进入发射场...");
					U238 u238=(U238)objIn;
					System.out.println("u238.U"+u238.U);
					calendar=new GregorianCalendar();
					dateSystemTime=calendar.get(Calendar.HOUR)+":"+calendar.get(Calendar.MINUTE)+":"+calendar.get(Calendar.SECOND);
					if (u238.WhatOperation.equals("原子弹"))
					{
						if (u238.U.equals("1"))
						{
							if (this.textOperationFromName.getText().equals(u238.FromName))
							{
								if (u238.FromName.length()==0)
								{
									textChatMessage.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门CIP向"+textOperationFromName.getText()+"投下了1枚威力极其强大的〖特大核能飞弹〗!炸的"+textOperationFromName.getText()+"尸骨无存!真是凄惨啊!大家为"+textOperationFromName.getText()+"默哀1分钟~~~\n");
									textChatMessageMe.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门CIP向"+textOperationFromName.getText()+"投下了1枚威力极其强大的〖特大核能飞弹〗!炸的"+textOperationFromName.getText()+"尸骨无存!真是凄惨啊!大家为"+textOperationFromName.getText()+"默哀1分钟~~~\n");
								}
								else
								{
									if (u238.FromName.equals("cip"))
									{
										textChatMessage.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门〖"+u238.FromName+"〗向"+u238.U238+"投下了1枚威力极其强大的〖特大核能飞弹〗!炸的"+u238.U238+"尸骨无存!真是凄惨啊!大家为"+u238.U238+"默哀1分钟~~~\n");
										textChatMessageMe.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门〖"+u238.FromName+"〗向"+u238.U238+"投下了1枚威力极其强大的〖特大核能飞弹〗!炸的"+u238.U238+"尸骨无存!真是凄惨啊!大家为"+u238.U238+"默哀1分钟~~~\n");
									}
									else
									{
										textChatMessage.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门弟子〖"+u238.FromName+"〗向"+u238.U238+"投下了1枚威力极其强大的〖特大核能飞弹〗!炸的"+u238.U238+"尸骨无存!真是凄惨啊!大家为"+u238.U238+"默哀1分钟~~~\n");
										textChatMessageMe.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门弟子〖"+u238.FromName+"〗向"+u238.U238+"投下了1枚威力极其强大的〖特大核能飞弹〗!炸的"+u238.U238+"尸骨无存!真是凄惨啊!大家为"+u238.U238+"默哀1分钟~~~\n");
									}
								}
							}
							else if (this.textOperationFromName.getText().equals(u238.U238))
							{
								if (u238.FromName.length()==0)
								{
									textChatMessage.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门CIP向"+textOperationFromName.getText()+"投下了1枚威力极其强大的〖特大核能飞弹〗!炸的〖"+textOperationFromName.getText()+"〗尸骨无存!真是凄惨啊!大家为〖"+textOperationFromName.getText()+"〗默哀1分钟~~~\n");
									textChatMessageMe.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门CIP向"+textOperationFromName.getText()+"投下了1枚威力极其强大的〖特大核能飞弹〗!炸的〖"+textOperationFromName.getText()+"〗尸骨无存!真是凄惨啊!大家为〖"+textOperationFromName.getText()+"〗默哀1分钟~~~\n");			
								}
								else
								{
									if (u238.FromName.equals("cip"))
									{
										textChatMessage.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门"+u238.FromName+"向〖"+u238.U238+"〗投下了1枚威力极其强大的〖特大核能飞弹〗!炸的〖"+u238.U238+"〗尸骨无存!真是凄惨啊!大家为〖"+u238.U238+"〗默哀1分钟~~~\n");
										textChatMessageMe.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门"+u238.FromName+"向〖"+u238.U238+"〗投下了1枚威力极其强大的〖特大核能飞弹〗!炸的〖"+u238.U238+"〗尸骨无存!真是凄惨啊!大家为〖"+u238.U238+"〗默哀1分钟~~~\n");
									}
									else
									{
										textChatMessage.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门弟子"+u238.FromName+"向〖"+u238.U238+"〗投下了1枚威力极其强大的〖特大核能飞弹〗!炸的〖"+u238.U238+"〗尸骨无存!真是凄惨啊!大家为〖"+u238.U238+"〗默哀1分钟~~~\n");
										textChatMessageMe.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门弟子"+u238.FromName+"向〖"+u238.U238+"〗投下了1枚威力极其强大的〖特大核能飞弹〗!炸的〖"+u238.U238+"〗尸骨无存!真是凄惨啊!大家为〖"+u238.U238+"〗默哀1分钟~~~\n");
									}
								}
							}
							else
							{
								if (u238.FromName.length()==0)
								{
									textChatMessage.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门CIP向"+textOperationFromName.getText()+"投下了1枚威力极其强大的〖特大核能飞弹〗!炸的"+textOperationFromName.getText()+"尸骨无存!真是凄惨啊!大家为"+textOperationFromName.getText()+"默哀1分钟~~~\n");
								}
								else
								{
									textChatMessage.append("【投特大核能飞弹】"+"["+dateSystemTime+"]"+"刚才六扇门弟子"+u238.FromName+"向"+u238.U238+"投下了1枚威力极其强大的〖特大核能飞弹〗!炸的"+u238.U238+"尸骨无存!真是凄惨啊!大家为"+u238.U238+"默哀1分钟~~~\n");
								}
							}
						}
						else
						{
							if (this.textOperationFromName.getText().equals(u238.FromName))
							{
								if (u238.FromName.length()==0)
								{
									textChatMessage.append("【投原子弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门CIP向"+textOperationFromName.getText()+"投下了"+u238.U238N+"颗原子弹!炸的"+textOperationFromName.getText()+"东躲西藏!真是可怜啊!大家为"+textOperationFromName.getText()+"阿门一句:阿门~~~\n");
									textChatMessageMe.append("【投原子弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门CIP向"+textOperationFromName.getText()+"投下了"+u238.U238N+"颗原子弹!炸的"+textOperationFromName.getText()+"东躲西藏!真是可怜啊!大家为"+textOperationFromName.getText()+"阿门一句:阿门~~~\n");
								}
								else
								{
									if (u238.FromName.equals("cip"))
									{
										textChatMessage.append("【投原子弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门〖"+u238.FromName+"〗向"+u238.U238+"投下了"+u238.U238N+"颗原子弹!炸的"+u238.U238+"东躲西藏!真是可怜啊!大家为"+u238.U238+"阿门一句:阿门~~~\n");
										textChatMessageMe.append("【投原子弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门〖"+u238.FromName+"〗向"+u238.U238+"投下了"+u238.U238N+"颗原子弹!炸的"+u238.U238+"东躲西藏!真是可怜啊!大家为"+u238.U238+"阿门一句:阿门~~~\n");
									}
									else
									{
										textChatMessage.append("【投原子弹】"+"["+dateSystemTime+"]"+"刚才六扇门弟子〖"+u238.FromName+"〗向"+u238.U238+"投下了"+u238.U238N+"颗原子弹!炸的"+u238.U238+"东躲西藏!真是可怜啊!大家为"+u238.U238+"阿门一句:阿门~~~\n");
										textChatMessageMe.append("【投原子弹】"+"["+dateSystemTime+"]"+"刚才六扇门弟子〖"+u238.FromName+"〗向"+u238.U238+"投下了"+u238.U238N+"颗原子弹!炸的"+u238.U238+"东躲西藏!真是可怜啊!大家为"+u238.U238+"阿门一句:阿门~~~\n");
									}
								}
							}
							else if (this.textOperationFromName.getText().equals(u238.U238))
							{
								if (u238.FromName.length()==0)
								{
									textChatMessage.append("【投原子弹】"+"["+dateSystemTime+"]"+"刚才六扇门掌门CIP向"+textOperationFromName.getText()+"投下了"+u238.U238N+"颗原子弹!炸的〖"+textOperationFromName.getText()+"〗东躲西藏!真是可怜啊!大家为〖"+textOperationFromName.getText()+"〗阿门一句:阿门~~~\n");

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -