gameServer2/src/utils.rs
changeset 13775 5fb40c8e5542
parent 13500 5359ff75da3a
--- a/gameServer2/src/utils.rs	Fri Sep 07 04:16:05 2018 +0300
+++ b/gameServer2/src/utils.rs	Sun Sep 09 01:20:35 2018 +0300
@@ -20,4 +20,48 @@
     tmp.push(msg.clone().count() as u8);
     tmp.extend(msg);
     encode(&tmp)
+}
+
+pub fn protocol_version_string(protocol_number: u16) -> &'static str {
+    match protocol_number {
+        17 => "0.9.7-dev",
+        19 => "0.9.7",
+        20 => "0.9.8-dev",
+        21 => "0.9.8",
+        22 => "0.9.9-dev",
+        23 => "0.9.9",
+        24 => "0.9.10-dev",
+        25 => "0.9.10",
+        26 => "0.9.11-dev",
+        27 => "0.9.11",
+        28 => "0.9.12-dev",
+        29 => "0.9.12",
+        30 => "0.9.13-dev",
+        31 => "0.9.13",
+        32 => "0.9.14-dev",
+        33 => "0.9.14",
+        34 => "0.9.15-dev",
+        35 => "0.9.14.1",
+        37 => "0.9.15",
+        38 => "0.9.16-dev",
+        39 => "0.9.16",
+        40 => "0.9.17-dev",
+        41 => "0.9.17",
+        42 => "0.9.18-dev",
+        43 => "0.9.18",
+        44 => "0.9.19-dev",
+        45 => "0.9.19",
+        46 => "0.9.20-dev",
+        47 => "0.9.20",
+        48 => "0.9.21-dev",
+        49 => "0.9.21",
+        50 => "0.9.22-dev",
+        51 => "0.9.22",
+        52 => "0.9.23-dev",
+        53 => "0.9.23",
+        54 => "0.9.24-dev",
+        55 => "0.9.24",
+        56 => "0.9.25-dev",
+        _ => "Unknown"
+    }
 }
\ No newline at end of file