| Line | |
|---|
| 1 | using AllocsFixes.PersistentData;
|
|---|
| 2 | using System;
|
|---|
| 3 | using System.Collections.Generic;
|
|---|
| 4 | using UnityEngine;
|
|---|
| 5 |
|
|---|
| 6 | namespace AllocsFixes
|
|---|
| 7 | {
|
|---|
| 8 | public class AllocsLogFunctions
|
|---|
| 9 | {
|
|---|
| 10 | public static void RequestToSpawnPlayer (ClientInfo _cInfo, int _chunkViewDim, PlayerProfile _playerProfile)
|
|---|
| 11 | {
|
|---|
| 12 | try {
|
|---|
| 13 | Log.Out ("Player connected" +
|
|---|
| 14 | ", entityid=" + _cInfo.entityId +
|
|---|
| 15 | ", name=" + _cInfo.playerName +
|
|---|
| 16 | ", steamid=" + _cInfo.playerId +
|
|---|
| 17 | ", ip=" + _cInfo.ip
|
|---|
| 18 | );
|
|---|
| 19 |
|
|---|
| 20 | PersistentContainer.Instance.Players [_cInfo.playerId, true].SetOnline (_cInfo);
|
|---|
| 21 | PersistentData.PersistentContainer.Instance.Save ();
|
|---|
| 22 | } catch (Exception e) {
|
|---|
| 23 | Log.Out ("Error in AllocsLogFunctions.RequestToSpawnPlayer: " + e);
|
|---|
| 24 | }
|
|---|
| 25 | }
|
|---|
| 26 |
|
|---|
| 27 | public static void PlayerDisconnected (ClientInfo _cInfo, bool _bShutdown)
|
|---|
| 28 | {
|
|---|
| 29 | try {
|
|---|
| 30 | Player p = PersistentContainer.Instance.Players [_cInfo.playerId, true];
|
|---|
| 31 | if (p != null) {
|
|---|
| 32 | p.SetOffline ();
|
|---|
| 33 | } else {
|
|---|
| 34 | Log.Out ("Disconnected player not found in client list...");
|
|---|
| 35 | }
|
|---|
| 36 | PersistentData.PersistentContainer.Instance.Save ();
|
|---|
| 37 | } catch (Exception e) {
|
|---|
| 38 | Log.Out ("Error in AllocsLogFunctions.PlayerDisconnected: " + e);
|
|---|
| 39 | }
|
|---|
| 40 | }
|
|---|
| 41 | }
|
|---|
| 42 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.