no message

This commit is contained in:
2023-11-17 20:19:32 +03:00
parent 3a83f14ad7
commit 32166efa68
2 changed files with 8 additions and 16 deletions

View File

@@ -273,13 +273,14 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
}
@Override
protected void Session() throws Exception {
DBObject dbObject = null;
Test test = null;
DBObject dbObject;
Test test;
int test_id;
switch (code) {
case PublishTestProject:
Print("Прикрепить проект к тесту " + request.arg);
System.out.println("Прикрепить проект к тесту " + request.arg);
int test_id = Integer.parseInt(request.arg);
test_id = Integer.parseInt(request.arg);
if (db.tests.containsKey(test_id)) {
test = db.tests.get(test_id);
Utils.unpackFile((byte[]) request.object, test.getArchive());
@@ -406,8 +407,9 @@ public class TestingServer extends RepositoryServer<TestsDatabase> {
//------------------------------------------->>
case DownloadTest:
Print("Отправить клиенту тест " + request.arg);
if (db.tests.containsKey(request.arg)) {
test = db.tests.get(request.arg);
test_id = Integer.parseInt(request.arg);
if (db.tests.containsKey(test_id)) {
test = db.tests.get(test_id);
response = new ServerExchangeUnit_2021(ServerCode.OK, "", Utils.packFile(test.getArchive()));
} else
throw new RepositoryRefuseException("Теста с именем " + request.arg + " не существует");