Skip to content

Commit dcefa10

Browse files
author
geno
committed
Fix time display and update README.md
1 parent 6b5932e commit dcefa10

File tree

4 files changed

+34
-19
lines changed

4 files changed

+34
-19
lines changed

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "idlecoin"
3-
version = "0.3.3"
3+
version = "0.3.4"
44
edition = "2021"
55

66
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -40,11 +40,11 @@ The stats are written out to a file `.idlecoin` in the working directory of the
4040
[+] Miner 0x2c37118e Cps: 546 Level: 3
4141
4242
Events:
43-
[!] Miner 0x91e5e95a gained 50% CPS boost
43+
[!] Miner 0x91e5e95a gained 10% CPS boost
4444
[!] Miner 0x2c37118e leveled up
45-
[!] Miner 0xedadbfe7 gained 50% CPS boost
46-
[!] Miner 0x2c37118e gained 50% CPS boost
47-
[!] Miner 0x2c37118e gained 50% CPS boost
45+
[!] Miner 0xedadbfe7 gained 10% CPS boost
46+
[!] Miner 0x2c37118e gained 10% CPS boost
47+
[!] Miner 0x2c37118e gained 10% CPS boost
4848
4949
Logged in as: 0x7d3ce1ed74b2c05f%
5050
```
@@ -77,20 +77,20 @@ Each wallet supports at least 5 miners.
7777

7878
```
7979
Events:
80-
[!] Miner 0x91e5e95a gained 50% CPS boost
80+
[!] Miner 0x91e5e95a gained 10% CPS boost
8181
[!] Miner 0x2c37118e leveled up
82-
[!] Miner 0xedadbfe7 gained 50% CPS boost
83-
[!] Miner 0x2c37118e gained 50% CPS boost
84-
[!] Miner 0x2c37118e gained 50% CPS boost
82+
[!] Miner 0xedadbfe7 gained 10% CPS boost
83+
[!] Miner 0x2c37118e gained 10% CPS boost
84+
[!] Miner 0x2c37118e gained 10% CPS boost
8585
```
8686

8787
These events are newest on top, and only the most recent 5 are displayed.
8888

8989
These events are special random events that can happen:
9090

91-
1. Gain 10% CPS -- 0.1% chance
92-
1. Gain 1 Level -- 0.5% chance
93-
1. Lose 1 Level -- 0.1% chance
91+
1. Gain 10% CPS -- 0.01% chance
92+
1. Gain 1 Level -- 0.02% chance
93+
1. Lose 1 Level -- 0.01% chance
9494

9595

9696
## Auto-Login
@@ -100,5 +100,7 @@ To setup your terminal to auto-login in case the connection with the server is i
100100
while true; do echo <USER> |nc <SERVER> <PORT>; done
101101
```
102102

103+
*NOTE*: When logging in this way you will be unable to purchase upgrades with this miner. STDIN is not routed through `nc`.
104+
103105
When that happens the miner level and CPS will be reset to 0, just like starting a new connection.
104106

src/main.rs

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,10 @@ fn read_inputs(
305305
0,
306306
format!(
307307
" [{}] Miner 0x{:08x} bought {} Cps with {} idlecoin\n",
308-
t, c.miner.miner_id, cps, cost
308+
t.format("%Y-%m-%d %H:%M:%S"),
309+
c.miner.miner_id,
310+
cps,
311+
cost
309312
),
310313
);
311314
sub_idlecoins(w, cost);
@@ -327,7 +330,7 @@ fn read_inputs(
327330
let cost = u64::MAX / (100000 >> (w.max_miners - 5));
328331
if w.idlecoin > cost || w.supercoin > 0 {
329332
let t: DateTime<Local> = Local::now();
330-
msg.insert(0, format!(" [{}] Wallet 0x{:016x} bought a new miner license with {} idlecoin\n", t, c.miner.wallet_id, cost));
333+
msg.insert(0, format!(" [{}] Wallet 0x{:016x} bought a new miner license with {} idlecoin\n", t.format("%Y-%m-%d %H:%M:%S"), c.miner.wallet_id, cost));
331334
sub_idlecoins(w, cost);
332335
w.max_miners += 1;
333336
} else {
@@ -461,7 +464,8 @@ fn action_miners(
461464
0,
462465
format!(
463466
" [{}] Wallet 0x{:016x} was taxed 10% by the IRS!\n",
464-
t, c.miner.miner_id
467+
t.format("%Y-%m-%d %H:%M:%S"),
468+
c.miner.miner_id
465469
),
466470
);
467471
}
@@ -474,7 +478,11 @@ fn action_miners(
474478
if level != c.miner.level {
475479
msg.insert(
476480
0,
477-
format!(" [{}] Miner 0x{:08x} lost a level\n", t, c.miner.miner_id),
481+
format!(
482+
" [{}] Miner 0x{:08x} lost a level\n",
483+
t.format("%Y-%m-%d %H:%M:%S"),
484+
c.miner.miner_id
485+
),
478486
);
479487
}
480488
} else if x % 10000 <= 2 {
@@ -484,7 +492,11 @@ fn action_miners(
484492
if level != c.miner.level {
485493
msg.insert(
486494
0,
487-
format!(" [{}] Miner 0x{:08x} leveled up\n", t, c.miner.miner_id),
495+
format!(
496+
" [{}] Miner 0x{:08x} leveled up\n",
497+
t.format("%Y-%m-%d %H:%M:%S"),
498+
c.miner.miner_id
499+
),
488500
);
489501
};
490502
} else if x % 10000 <= 3 {
@@ -494,7 +506,8 @@ fn action_miners(
494506
0,
495507
format!(
496508
" [{}] Miner 0x{:08x} gained 10% CPS boost\n",
497-
t, c.miner.miner_id
509+
t.format("%Y-%m-%d %H:%M:%S"),
510+
c.miner.miner_id
498511
),
499512
);
500513
}

0 commit comments

Comments
 (0)