diff --git a/server/apib/army-management/decorations.apib b/server/apib/army-management/decorations.apib index 65b8476..9784a29 100644 --- a/server/apib/army-management/decorations.apib +++ b/server/apib/army-management/decorations.apib @@ -63,8 +63,9 @@ Create a new decoration Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 201 (application/json; charset=utf-8) @@ -107,8 +108,9 @@ Update decoration, identified by its id Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 200 (application/json; charset=utf-8) diff --git a/server/apib/army-management/ranks.apib b/server/apib/army-management/ranks.apib index dda6133..2720b4b 100644 --- a/server/apib/army-management/ranks.apib +++ b/server/apib/army-management/ranks.apib @@ -57,8 +57,9 @@ Create a new rank Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 201 (application/json; charset=utf-8) @@ -96,8 +97,9 @@ Update rank, identified by its id Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 200 (application/json; charset=utf-8) diff --git a/server/apib/army-management/squads.apib b/server/apib/army-management/squads.apib index 3e6cd03..f24b347 100644 --- a/server/apib/army-management/squads.apib +++ b/server/apib/army-management/squads.apib @@ -51,8 +51,9 @@ Create a new squad Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 201 (application/json; charset=utf-8) @@ -90,8 +91,9 @@ Update squad, identified by its id Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 200 (application/json; charset=utf-8) diff --git a/server/apib/documentation.apib b/server/apib/documentation.apib index 64962d3..be10d7c 100644 --- a/server/apib/documentation.apib +++ b/server/apib/documentation.apib @@ -801,8 +801,9 @@ Create a new decoration Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 201 (application/json; charset=utf-8) @@ -845,8 +846,9 @@ Update decoration, identified by its id Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 200 (application/json; charset=utf-8) @@ -1053,8 +1055,9 @@ Create a new rank Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 201 (application/json; charset=utf-8) @@ -1092,8 +1095,9 @@ Update rank, identified by its id Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 200 (application/json; charset=utf-8) @@ -1166,8 +1170,9 @@ Create a new squad Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 201 (application/json; charset=utf-8) @@ -1205,8 +1210,9 @@ Update squad, identified by its id Content-Type: image/png Content-Transfer-Encoding: base64 - iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA - QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= + iVBORw0KGgoAAAANSUhEUgAAAAIAAAACCAIAAAD91JpzAAAACXBIWXMAAAsTAAALEwEAmpwYAAAA + B3RJTUUH4wIDDQIBeZj+RQAAAB1pVFh0Q29tbWVudAAAAAAAQ3JlYXRlZCB3aXRoIEdJTVBkLmUH + AAAAFklEQVQI12NgZ2f///8/w////xkZGQEq5gYTeotA1AAAAABJRU5ErkJggg== -----BOUNDARY-- + Response 200 (application/json; charset=utf-8) diff --git a/server/apib/dredd/data/tmp-resource/decoration/5abeb420b987672bb1ede643.png b/server/apib/dredd/data/tmp-resource/decoration/5abeb420b987672bb1ede643.png index c2750a2..612ce6f 100644 Binary files a/server/apib/dredd/data/tmp-resource/decoration/5abeb420b987672bb1ede643.png and b/server/apib/dredd/data/tmp-resource/decoration/5abeb420b987672bb1ede643.png differ diff --git a/server/apib/dredd/data/tmp-resource/decoration/5bcc82db107007751b76da8f.png b/server/apib/dredd/data/tmp-resource/decoration/5bcc82db107007751b76da8f.png deleted file mode 100644 index c2750a2..0000000 --- a/server/apib/dredd/data/tmp-resource/decoration/5bcc82db107007751b76da8f.png +++ /dev/null @@ -1,2 +0,0 @@ -iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA -QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= \ No newline at end of file diff --git a/server/apib/dredd/data/tmp-resource/logs/5bcc82db107007751b76da95/clean.log b/server/apib/dredd/data/tmp-resource/logs/5bcc82db107007751b76da95/clean.log deleted file mode 100644 index aecee23..0000000 --- a/server/apib/dredd/data/tmp-resource/logs/5bcc82db107007751b76da95/clean.log +++ /dev/null @@ -1,34 +0,0 @@ -2018/03/20, 20:05:43 "[OPT] (Budget) LOG: 0:00:00 --- Startbudget: NATO 4.5355e+006 - CSAT 4.22125e+006" - -2018/03/20, 20:06:45 "[OPT] (Budget) LOG: 0:01:02 --- NATO alt: 4.5355e+006 - neu: 4.1955e+006 - Differenz: -340000" - -2018/03/20, 20:10:11 "[OPT] (Abschuss) LOG: 0:04:28 --- Saxe (WEST) von: Selbstverschulden." - -2018/03/20, 20:10:11 "[OPT] (Abschuss) LOG: 0:04:28 --- Pumarang (WEST) von: Saxe (WEST)." - -2018/03/20, 20:10:13 "[OPT] (Budget) LOG: 0:04:30 --- CSAT alt: 2.38425e+006 - neu: 2.32425e+006 - Differenz: -60000" - -2018/03/20, 20:15:54 "[OPT] (Punkte) LOG: 0:10:11 --- Kein Dominator (NATO 0 | CSAT 0)" - -2018/03/20, 20:17:51 "[OPT] (Abschuss) LOG: 0:12:08 --- patze (EAST) von: Wiesl (WEST)." - -2018/03/20, 20:18:20 "[OPT] (Fahne) LOG: 0:12:37 --- CSAT Flagge erobert von Wiesl" - -2018/03/20, 20:18:38 "[OPT] (Abschuss) LOG: 0:12:55 --- Nicolas (WEST) von: Wiesl (WEST)." - -2018/03/20, 20:18:59 "[OPT] (Punkte) LOG: 0:13:16 --- NATO +1 (NATO 1 | CSAT 0)" - -2018/03/20, 20:19:38 "[OPT] (Fahne) LOG: 0:13:56 --- CSAT Flagge gesichert von ALASTOR" - -2018/03/20, 20:22:18 "[OPT] (Abschuss) LOG: 0:16:35 --- Fahrzeug: Hunter-HMG (OPT_NATO) von: Murda]X[ (EAST)." - -2018/03/20, 20:37:19 "[OPT] (Transport) LOG: 0:31:36 --- Dominik (WEST) wurde von Ponykloete (WEST) eingeflogen (8666.94 m)" - -2018/03/20, 20:41:27 "[OPT] (Revive) LOG: 0:35:44 --- Bodochecker (EAST) wurde von ALASTOR (EAST) stabilisiert." - -2018/03/20, 20:41:35 "[OPT] (Revive) LOG: 0:35:52 --- Andi-de (WEST) wurde von Wiesl (WEST) wiederbelebt." - -2018/03/20, 22:35:43 "[OPT] (Budget) LOG: 2:30:00 --- Endbudget: (NATO 1997000 | CSAT 512000)" - -2018/03/20, 22:35:43 "[OPT] (Punkte) LOG: 2:30:00 --- Endpunktestand: (NATO 34 | CSAT 25)"' - diff --git a/server/apib/dredd/data/tmp-resource/logs/5bcc82db107007751b76da95/war.log b/server/apib/dredd/data/tmp-resource/logs/5bcc82db107007751b76da95/war.log deleted file mode 100644 index 43d87c2..0000000 --- a/server/apib/dredd/data/tmp-resource/logs/5bcc82db107007751b76da95/war.log +++ /dev/null @@ -1,28 +0,0 @@ -Error: ENOENT: no such file or directory, open '\ -2018/03/20, 20:05:43 "[OPT] (Budget) LOG: 0:00:00 --- Startbudget: NATO 4.5355e+006 - CSAT 4.22125e+006" -2018/03/20, 20:06:45 "[OPT] (Budget) LOG: 0:01:02 --- NATO alt: 4.5355e+006 - neu: 4.1955e+006 - Differenz: -340000" -2018/03/20, 20:10:11 "[OPT] (Abschuss) LOG: 0:04:28 --- Saxe (WEST) von: Selbstverschulden." -2018/03/20, 20:10:11 "[OPT] (Abschuss) LOG: 0:04:28 --- Pumarang (WEST) von: Saxe (WEST)." -2018/03/20, 20:10:13 "[OPT] (Budget) LOG: 0:04:30 --- CSAT alt: 2.38425e+006 - neu: 2.32425e+006 - Differenz: -60000" -2018/03/20, 20:10:38 "[OPT] (Respawn) LOG: 0:04:55 --- Spieler: Pumarang - Kosten: 3000" -2018/03/20, 20:15:54 "[OPT] (Punkte) LOG: 0:10:11 --- Kein Dominator (NATO 0 | CSAT 0)" -2018/03/20, 20:17:51 "[OPT] (Abschuss) LOG: 0:12:08 --- patze (EAST) von: Wiesl (WEST)." -2018/03/20, 20:18:20 "[OPT] (Fahne) LOG: 0:12:37 --- CSAT Flagge erobert von Wiesl" -2018/03/20, 20:18:38 "[OPT] (Abschuss) LOG: 0:12:55 --- Nicolas (WEST) von: Wiesl (WEST)." -2018/03/20, 20:18:59 "[OPT] (Punkte) LOG: 0:13:16 --- NATO +1 (NATO 1 | CSAT 0)" -2018/03/20, 20:19:38 "[OPT] (Fahne) LOG: 0:13:56 --- CSAT Flagge gesichert von ALASTOR" -2018/03/20, 20:22:18 "[OPT] (Abschuss) LOG: 0:16:35 --- Fahrzeug: Hunter-HMG (OPT_NATO) von: Murda]X[ (EAST)." -2018/03/20, 20:37:19 "[OPT] (Transport) LOG: 0:31:36 --- Dominik (WEST) wurde von Ponykloete (WEST) eingeflogen (8666.94 m)" -2018/03/20, 20:41:27 "[OPT] (Revive) LOG: 0:35:44 --- Bodochecker (EAST) wurde von ALASTOR (EAST) stabilisiert." -2018/03/20, 20:41:35 "[OPT] (Revive) LOG: 0:35:52 --- Andi-de (WEST) wurde von Wiesl (WEST) wiederbelebt." -2018/03/20, 22:35:43 "[OPT] (Mission) LOG: 2:30:00 --- Missionzeit abgelaufen" -2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- Pumarang (WEST), PUID 76561198050321485" -2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- Mercurat (WEST), PUID 76561198278842491" -2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- KalleK (EAST), PUID 76561197977676036" -2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- MAPster (EAST), PUID 76561198009882133" -2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- LyrikEmu (WEST), PUID 76561198218910400" -2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- Philipp (EAST), PUID 76561198041792069" -2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- Wiesl (WEST), PUID 76561198059648090" -2018/03/20, 22:35:43 "[OPT] (Fraktionsuebersicht) LOG: 2:30:00 --- Murda]X[ (EAST), PUID 76561197971121630" -2018/03/20, 22:35:43 "[OPT] (Budget) LOG: 2:30:00 --- Endbudget: (NATO 1997000 | CSAT 512000)" -2018/03/20, 22:35:43 "[OPT] (Punkte) LOG: 2:30:00 --- Endpunktestand: (NATO 34 | CSAT 25)"' diff --git a/server/apib/dredd/data/tmp-resource/rank/5abeb23995cf43205225710b.png b/server/apib/dredd/data/tmp-resource/rank/5abeb23995cf43205225710b.png index c2750a2..612ce6f 100644 Binary files a/server/apib/dredd/data/tmp-resource/rank/5abeb23995cf43205225710b.png and b/server/apib/dredd/data/tmp-resource/rank/5abeb23995cf43205225710b.png differ diff --git a/server/apib/dredd/data/tmp-resource/rank/5bcc82db107007751b76da91.png b/server/apib/dredd/data/tmp-resource/rank/5bcc82db107007751b76da91.png deleted file mode 100644 index c2750a2..0000000 --- a/server/apib/dredd/data/tmp-resource/rank/5bcc82db107007751b76da91.png +++ /dev/null @@ -1,2 +0,0 @@ -iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA -QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= \ No newline at end of file diff --git a/server/apib/dredd/data/tmp-resource/signature/5ab68d42f547ed304064e5f7.png b/server/apib/dredd/data/tmp-resource/signature/5ab68d42f547ed304064e5f7.png index 1e6990c..02e19f6 100644 Binary files a/server/apib/dredd/data/tmp-resource/signature/5ab68d42f547ed304064e5f7.png and b/server/apib/dredd/data/tmp-resource/signature/5ab68d42f547ed304064e5f7.png differ diff --git a/server/apib/dredd/data/tmp-resource/signature/big/5ab68d42f547ed304064e5f7.png b/server/apib/dredd/data/tmp-resource/signature/big/5ab68d42f547ed304064e5f7.png index 726d01b..15c2d5b 100644 Binary files a/server/apib/dredd/data/tmp-resource/signature/big/5ab68d42f547ed304064e5f7.png and b/server/apib/dredd/data/tmp-resource/signature/big/5ab68d42f547ed304064e5f7.png differ diff --git a/server/apib/dredd/data/tmp-resource/squad/5abe166f8b7488392a623f12.png b/server/apib/dredd/data/tmp-resource/squad/5abe166f8b7488392a623f12.png index c2750a2..612ce6f 100644 Binary files a/server/apib/dredd/data/tmp-resource/squad/5abe166f8b7488392a623f12.png and b/server/apib/dredd/data/tmp-resource/squad/5abe166f8b7488392a623f12.png differ diff --git a/server/apib/dredd/data/tmp-resource/squad/5bcc82db107007751b76da92.png b/server/apib/dredd/data/tmp-resource/squad/5bcc82db107007751b76da92.png deleted file mode 100644 index c2750a2..0000000 --- a/server/apib/dredd/data/tmp-resource/squad/5bcc82db107007751b76da92.png +++ /dev/null @@ -1,2 +0,0 @@ -iVBORw0KGgoAAAANSUhEUgAAAAEAAAABAQMAAAAl21bKAAAAA1BMVEX/TQBcNTh/AAAAAXRSTlMA -QObYZgAAAApJREFUeJxjYgAAAAYAAzY3fKgAAAAASUVORK5CYII= \ No newline at end of file diff --git a/server/resource/decoration/591c78741ee62711cfc18f27.png b/server/resource/decoration/591c78741ee62711cfc18f27.png index 513e845..612ce6f 100644 Binary files a/server/resource/decoration/591c78741ee62711cfc18f27.png and b/server/resource/decoration/591c78741ee62711cfc18f27.png differ diff --git a/server/resource/rank/591469c9ef4a6810623ed4ea.png b/server/resource/rank/591469c9ef4a6810623ed4ea.png index fb00a9e..6f145e5 100644 Binary files a/server/resource/rank/591469c9ef4a6810623ed4ea.png and b/server/resource/rank/591469c9ef4a6810623ed4ea.png differ diff --git a/server/routes/decorations.js b/server/routes/decorations.js index e2ad4e7..5a90762 100644 --- a/server/routes/decorations.js +++ b/server/routes/decorations.js @@ -23,6 +23,7 @@ const DecorationModel = require('../models/decoration'); const AwardingsModel = require('../models/awarding'); // util +const getFileBuffer = require('../tools/util').getFileBuffer; const imageDimensionValidator = require('../middleware/validators').imageDimensionValidator; const MAX_MEDAL_IMAGE_WIDTH = 100; const MAX_MEDAL_IMAGE_HEIGHT = 150; @@ -67,7 +68,7 @@ decorationRouter.route('/') if (req.file) { const decoration = new DecorationModel(req.body); - const imageFileBuffer = req.file.buffer; + const imageFileBuffer = getFileBuffer(req.file); const err = imageDimensionValidator(imageFileBuffer, (decoration.isMedal ? MAX_MEDAL_IMAGE_WIDTH : MAX_RIBBON_IMAGE_WIDTH), (decoration.isMedal ? MAX_MEDAL_IMAGE_HEIGHT : MAX_RIBBON_IMAGE_HEIGHT)); @@ -84,11 +85,9 @@ decorationRouter.route('/') } res.status(codes.created); res.locals.items = decoration; - fs.appendFile(resourceLocation + decoration._id + '.png', - new Buffer(req.file.buffer), - (err) => { - if (err) next(err); - }); + fs.appendFile(resourceLocation + decoration._id + '.png', imageFileBuffer, (err) => { + if (err) next(err); + }); next(); }); } else { @@ -112,8 +111,7 @@ decorationRouter.route('/:id') // little bit different as in PUT. :id does not need to be in data, but if the _id and url id must // match const err = new Error( - 'id of PATCH resource and send JSON body are not equal ' + req.params.id + ' ' + - req.body._id); + `id of PATCH resource and send JSON body are not equal: ${req.params.id} vs ${req.body._id}`); err.status = codes.notfound; next(err); return; // prevent node to process this function further after next() has finished. @@ -123,12 +121,12 @@ decorationRouter.route('/:id') req.body.updatedAt = new Date(); req.body.$inc = {__v: 1}; - DecorationModel.findById(req.body._id, (err, item) => { + DecorationModel.findById(req.params.id, (err, item) => { if (err) { return next(err); } if (req.file) { - const imageFileBuffer = req.file.buffer; + const imageFileBuffer = getFileBuffer(req.file); const imageDimensionError = imageDimensionValidator(imageFileBuffer, (item.isMedal ? MAX_MEDAL_IMAGE_WIDTH : MAX_RIBBON_IMAGE_WIDTH), (item.isMedal ? MAX_MEDAL_IMAGE_HEIGHT : MAX_RIBBON_IMAGE_HEIGHT)); @@ -139,7 +137,7 @@ decorationRouter.route('/:id') const file = resourceLocation + req.params.id + '.png'; fs.unlink(file, (err) => { if (err) next(err); - fs.appendFile(file, new Buffer(req.file.buffer), (err) => { + fs.appendFile(file, imageFileBuffer, (err) => { if (err) next(err); }); }); diff --git a/server/routes/ranks.js b/server/routes/ranks.js index bf2652b..df27356 100644 --- a/server/routes/ranks.js +++ b/server/routes/ranks.js @@ -22,6 +22,7 @@ const RankModel = require('../models/rank'); // util const genericGetById = require('./_generic').genericGetById; +const getFileBuffer = require('../tools/util').getFileBuffer; const imageDimensionValidator = require('../middleware/validators').imageDimensionValidator; const MAX_IMAGE_WIDTH = 120; const MAX_IMAGE_HEIGHT = 120; @@ -57,7 +58,7 @@ ranks.route('/') .post(apiAuthenticationMiddleware, checkHl, upload.single('image'), (req, res, next) => { if (req.file) { - const imageFileBuffer = req.file.buffer; + const imageFileBuffer = getFileBuffer(req.file); const err = imageDimensionValidator(imageFileBuffer, MAX_IMAGE_WIDTH, MAX_IMAGE_HEIGHT); if (err) { return next(err); @@ -72,7 +73,7 @@ ranks.route('/') } res.status(codes.created); res.locals.items = rank; - fs.appendFile(resourceLocation + rank._id + '.png', new Buffer(imageFileBuffer), + fs.appendFile(resourceLocation + rank._id + '.png', imageFileBuffer, (err) => { next(err); }); @@ -109,7 +110,7 @@ ranks.route('/:id') req.body.$inc = {__v: 1}; if (req.file) { - const imageFileBuffer = req.file.buffer; + const imageFileBuffer = getFileBuffer(req.file); const err = imageDimensionValidator(imageFileBuffer, MAX_IMAGE_WIDTH, MAX_IMAGE_HEIGHT); if (err) { return next(err); @@ -118,7 +119,7 @@ ranks.route('/:id') const file = resourceLocation + req.params.id + '.png'; fs.unlink(file, (err) => { if (err) next(err); - fs.appendFile(file, new Buffer(imageFileBuffer), + fs.appendFile(file, imageFileBuffer, (err) => { if (err) next(err); }); diff --git a/server/routes/squads.js b/server/routes/squads.js index bb824ca..3f4296b 100644 --- a/server/routes/squads.js +++ b/server/routes/squads.js @@ -22,6 +22,7 @@ const SquadModel = require('../models/squad'); // util const genericGetById = require('./_generic').genericGetById; +const getFileBuffer = require('../tools/util').getFileBuffer; const imageDimensionValidator = require('../middleware/validators').imageDimensionValidator; const MAX_IMAGE_WIDTH = 150; const MAX_IMAGE_HEIGHT = 150; @@ -57,7 +58,7 @@ squads.route('/') const squad = new SquadModel(req.body); // timestamp and default are set automatically by Mongoose Schema Validation if (req.file) { - const imageFileBuffer = req.file.buffer; + const imageFileBuffer = getFileBuffer(req.file); const err = imageDimensionValidator(imageFileBuffer, MAX_IMAGE_WIDTH, MAX_IMAGE_HEIGHT); if (err) { return next(err); @@ -71,7 +72,7 @@ squads.route('/') } res.status(codes.created); res.locals.items = squad; - fs.appendFile(resourceLocation.concat(squad._id).concat('.png'), new Buffer(imageFileBuffer), (err) => { + fs.appendFile(resourceLocation.concat(squad._id).concat('.png'), imageFileBuffer, (err) => { next(err); }); }); @@ -106,7 +107,7 @@ squads.route('/:id') req.body.$inc = {__v: 1}; if (req.file) { - const imageFileBuffer = req.file.buffer; + let imageFileBuffer = getFileBuffer(req.file); const err = imageDimensionValidator(imageFileBuffer, MAX_IMAGE_WIDTH, MAX_IMAGE_HEIGHT); if (err) { return next(err); @@ -115,7 +116,7 @@ squads.route('/:id') .concat('.png'); fs.unlink(file, (err) => { if (err) next(err); - fs.appendFile(file, new Buffer(imageFileBuffer), (err) => { + fs.appendFile(file, imageFileBuffer, (err) => { if (err) next(err); }); }); diff --git a/server/tools/util.js b/server/tools/util.js index 86f699e..c28c609 100644 --- a/server/tools/util.js +++ b/server/tools/util.js @@ -50,8 +50,16 @@ const decimalToTimeString = (decimal) => { (seconds < 10 ? '0' + seconds : seconds); }; +const getFileBuffer = (file) => { + if (file.encoding === 'base64') { + return Buffer.from(file.buffer.toString(), file.encoding); + } + return Buffer.from(file.buffer); +}; + exports.isSteamUUID = isSteamUUID; exports.sortCollection = sortCollectionBy; exports.playerArrayContains = playerArrayContains; exports.timeStringToDecimal = timeStringToDecimal; exports.decimalToTimeString = decimalToTimeString; +exports.getFileBuffer = getFileBuffer; diff --git a/static/src/app/app.component.html b/static/src/app/app.component.html index 784f13e..1a309f5 100644 --- a/static/src/app/app.component.html +++ b/static/src/app/app.component.html @@ -110,7 +110,7 @@