我正在尝试为我的游戏创建一个大厅。我需要为每个玩家设置个人资料图片,但我无法将每个玩家个人资料图片的纹理发送到服务器
anny sugestions?
我尝试过使用像这样的命令
private final ExecutorService exec = Executors.newCachedThreadPool();
public void launchCommand(String inputDir, String outputDir) {
String command = ".\\venv\\Scripts\\python.exe ./test.py -i " + inputDir + " -o " + outputDir;
Task<String> commandTask = new Task<String>() {
@Override
protected String call() {
return executeCommand(command);
}
};
commandTask.setOnSucceeded(event -> {
// this is executed on the FX Application Thread,
// so it is safe to update the UI here if you need
System.out.println(commandTask.getValue());
});
commandTask.setOnFailed(event -> {
commandTask.getException().printStackTrace();
});
exec.execute(commandTask);
}
在OnClientEnterLobby中调用命令函数
我正在使用额外的类来管理SyncList
[Command]
public void CmdPlayerProfile(byte[] test)
{
myBites.Add(test);
profileImagebyte = test;
}
}
当我使用它时,我收到一条错误消息,说我的 public class LobbyPlayerImage : NetworkBehaviour
{
public class SyncListByte : SyncList<byte[]>
{
protected override byte[] DeserializeItem(NetworkReader reader)
{
return reader.ReadBytesAndSize();
}
protected override void SerializeItem(NetworkWriter writer, byte[] item)
{
// writer.Write(item, Buffer.ByteLength(item));
writer.WriteBytesFull(item);
// writer.WriteBytesAndSize(item, Buffer.ByteLength(item));
}
}
public SyncListByte myBites = new SyncListByte();
是大