|
249 | 249 |
|
250 | 250 | log_client_to_db(tdata) // Make sure our client exists in the DB
|
251 | 251 |
|
| 252 | + // We have a holder. Inform the relevant places |
| 253 | + INVOKE_ASYNC(src, .proc/announce_join) |
| 254 | + |
252 | 255 | pai_save = new(src)
|
253 | 256 |
|
254 | 257 | // This is where we load all of the clients stuff from the DB
|
|
411 | 414 | return ..()
|
412 | 415 |
|
413 | 416 | /client/Destroy()
|
| 417 | + announce_leave() // Do not put this below |
414 | 418 | if(holder)
|
415 | 419 | holder.owner = null
|
416 | 420 | GLOB.admins -= src
|
|
428 | 432 | return QDEL_HINT_HARDDEL_NOW
|
429 | 433 |
|
430 | 434 |
|
| 435 | +/client/proc/announce_join() |
| 436 | + if(holder.rights & R_MENTOR) |
| 437 | + if(SSredis.connected) |
| 438 | + var/list/mentorcounter = staff_countup(R_MENTOR) |
| 439 | + var/msg = "**[ckey]** logged in. **[mentorcounter[1]]** mentor[mentorcounter[1] == 1 ? "" : "s"] online." |
| 440 | + var/list/data = list() |
| 441 | + data["author"] = "alice" |
| 442 | + data["source"] = GLOB.configuration.system.instance_id |
| 443 | + data["message"] = msg |
| 444 | + SSredis.publish("byond.msay.out", json_encode(data)) |
| 445 | + |
| 446 | + else if(holder.rights & R_BAN) |
| 447 | + if(SSredis.connected) |
| 448 | + var/list/admincounter = staff_countup(R_BAN) |
| 449 | + var/msg = "**[ckey]** logged in. **[admincounter[1]]** admin[admincounter[1] == 1 ? "" : "s"] online." |
| 450 | + var/list/data = list() |
| 451 | + data["author"] = "alice" |
| 452 | + data["source"] = GLOB.configuration.system.instance_id |
| 453 | + data["message"] = msg |
| 454 | + SSredis.publish("byond.asay.out", json_encode(data)) |
| 455 | + |
| 456 | +/client/proc/announce_leave() |
| 457 | + if(holder.rights & R_MENTOR) |
| 458 | + if(SSredis.connected) |
| 459 | + var/list/mentorcounter = staff_countup(R_MENTOR) |
| 460 | + var/mentor_count = mentorcounter[1] |
| 461 | + mentor_count-- // Exclude ourself |
| 462 | + var/msg = "**[ckey]** logged out. **[mentor_count]** mentor[mentor_count == 1 ? "" : "s"] online." |
| 463 | + var/list/data = list() |
| 464 | + data["author"] = "alice" |
| 465 | + data["source"] = GLOB.configuration.system.instance_id |
| 466 | + data["message"] = msg |
| 467 | + SSredis.publish("byond.msay.out", json_encode(data)) |
| 468 | + |
| 469 | + else if(holder.rights & R_BAN) |
| 470 | + if(SSredis.connected) |
| 471 | + var/list/admincounter = staff_countup(R_BAN) |
| 472 | + var/admin_count = admincounter[1] |
| 473 | + admin_count-- // Exclude ourself |
| 474 | + var/msg = "**[ckey]** logged out. **[admin_count]** admin[admin_count == 1 ? "" : "s"] online." |
| 475 | + var/list/data = list() |
| 476 | + data["author"] = "alice" |
| 477 | + data["source"] = GLOB.configuration.system.instance_id |
| 478 | + data["message"] = msg |
| 479 | + SSredis.publish("byond.asay.out", json_encode(data)) |
| 480 | + |
| 481 | + |
431 | 482 | /client/proc/donor_loadout_points()
|
432 | 483 | if(donator_level > 0 && prefs)
|
433 | 484 | prefs.max_gear_slots = GLOB.configuration.general.base_loadout_points + 5
|
|
0 commit comments