FaceApp服务器停了,faceapp由俄罗斯开发,现被美国fbi调查认定涉嫌威胁用户安全,已被停服。
软件工作时,是将我们的照片上传到服务器,经过云端处理再返回给我们。所以服务器停了,也就用不了了。
1 Server代码:
import javaioBufferedReader;
import javaioIOException;
import javaioInputStreamReader;
import javanetServerSocket;
import javanetSocket;
import androidappActivity;
import androidosBundle;
import androidosHandler;
import androidutilLog;
import androidwidgetTextView;
public class Server extends Activity
{
private ServerSocket serverSocket;
private Handler updateConversationHandler;
private Thread serverThread = null;
private TextView text;
public static final int SERVERPORT = 6000;
@Override
public void onCreate(Bundle savedInstanceState)
{
superonCreate(savedInstanceState);
setContentView(Rlayoutmain);
text = (TextView) findViewById(Ridtext2);
updateConversationHandler = new Handler();
thisserverThread = new Thread(new ServerThread());
thisserverThreadstart();
}
@Override
protected void onStop()
{
superonStop();
try
{
serverSocketclose();
}
catch (IOException e)
{
eprintStackTrace();
}
}
private class ServerThread implements Runnable
{
public void run()
{
Socket socket = null;
try
{
serverSocket = new ServerSocket(SERVERPORT);
}
catch (IOException e)
{
eprintStackTrace();
}
while (!ThreadcurrentThread()isInterrupted())
{
try
{
socket = serverSocketaccept(); // TODO
CommunicationThread commThread = new CommunicationThread(socket);
new Thread(commThread)start();
}
catch (IOException e)
{
Logi("liu", "socketaccept()失败");
eprintStackTrace();
}
}
}
}
private class CommunicationThread implements Runnable
{
private Socket clientSocket;
private BufferedReader input;
public CommunicationThread(Socket clientSocket)
{
thisclientSocket = clientSocket;
Logi("liu", "获取到了client的Socket");
try
{
thisinput = new BufferedReader(new InputStreamReader(thisclientSocketgetInputStream())); // TODO
}
catch (IOException e)
{
Logi("liu", "input获取失败");
eprintStackTrace();
}
}
public void run()
{
while (!ThreadcurrentThread()isInterrupted())
{
try
{
String read = inputreadLine(); // TODO
Logi("liu", read);
updateConversationHandlerpost(new updateUIThread(read));
}
catch (IOException e)
{
Logi("liu", "input读取失败");
eprintStackTrace();
}
}
}
}
private class updateUIThread implements Runnable
{
private String msg;
public updateUIThread(String str)
{
thismsg = str;
}
@Override
public void run()
{
textsetText(textgetText()toString() + "Client Says: " + msg + "\n");
}
}
}
2 Client代码:
package comjavacodegeeksandroidandroidsocketclient;
import javaioBufferedWriter;
import javaioIOException;
import javaioOutputStreamWriter;
import javaioPrintWriter;
import javanetInetAddress;
import javanetSocket;
import javanetUnknownHostException;
import androidappActivity;
import androidosBundle;
import androidutilLog;
import androidviewView;
import androidwidgetEditText;
public class Client extends Activity
{
private Socket socket;
private static final int SERVERPORT = 4000;
private static final String SERVER_IP = "10022";
@Override
public void onCreate(Bundle savedInstanceState)
{
superonCreate(savedInstanceState);
setContentView(Rlayoutmain);
new Thread(new ClientThread())start();
}
public void onClick(View view)
{
try
{
EditText et = (EditText) findViewById(RidEditText01);
String str = etgetText()toString();
Logi("liu", "点击按钮");
PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(socketgetOutputStream())), true); // TODO
outprintln(str);
}
catch (Exception e)
{
Logi("liu", "write失败");
eprintStackTrace();
}
}
class ClientThread implements Runnable
{
@Override
public void run()
{
try
{
InetAddress serverAddr = InetAddressgetByName(SERVER_IP);
socket = new Socket(serverAddr, SERVERPORT);
}
catch (UnknownHostException e1)
{
e1printStackTrace();
}
catch (IOException e1)
{
e1printStackTrace();
}
}
}
}
3 附件 是 客户端和服务端 的源码。
暴雪尝试次数过多请稍后再试解决方法
方法一:
关掉加速,直接连接,显示出验证码之后,输入,再开加速就能进去了。
方法二:
亚服登陆的用户选择欧服登陆即可,就可以正常游戏了。
方法三:
不要使用自动登陆。
方法四:
可能是服务压力过大爆掉了,需要等官方维护。
方法五:
删除客户端重装、打开时选择管理员权限。
开发背景
战网系统
1997年,为了配合《暗黑破坏神》发售,暴雪开始架设Battlenet游戏平台(俗称暴雪战网),最初的Battlenet仅仅是为《暗黑破坏神》玩家提供服务的,允许广域网的玩家进入局域网游戏,除此之外,没有任何玩家数据或者资料保存在暴雪服务器上,玩家基本上处于互相直连的状态。
这也让作弊行为变得稀松平常。1998年,暴雪发售了《星际争霸》,并且对战网玩家实行新的保护或限制措施,那就是必须使用《星际争霸》的13位有效的CDkey才能登陆Battlenet,并且加入了聊天和排名等高级系统。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)