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 | ", steamOwner=" + _cInfo.ownerId +
|
---|
18 | ", ip=" + _cInfo.ip
|
---|
19 | );
|
---|
20 |
|
---|
21 | PersistentContainer.Instance.Players [_cInfo.playerId, true].SetOnline (_cInfo);
|
---|
22 | PersistentData.PersistentContainer.Instance.Save ();
|
---|
23 | } catch (Exception e) {
|
---|
24 | Log.Out ("Error in AllocsLogFunctions.RequestToSpawnPlayer: " + e);
|
---|
25 | }
|
---|
26 | }
|
---|
27 |
|
---|
28 | public static void PlayerDisconnected (ClientInfo _cInfo, bool _bShutdown)
|
---|
29 | {
|
---|
30 | try {
|
---|
31 | Player p = PersistentContainer.Instance.Players [_cInfo.playerId, true];
|
---|
32 | if (p != null) {
|
---|
33 | p.SetOffline ();
|
---|
34 | } else {
|
---|
35 | Log.Out ("Disconnected player not found in client list...");
|
---|
36 | }
|
---|
37 | PersistentData.PersistentContainer.Instance.Save ();
|
---|
38 | } catch (Exception e) {
|
---|
39 | Log.Out ("Error in AllocsLogFunctions.PlayerDisconnected: " + e);
|
---|
40 | }
|
---|
41 | }
|
---|
42 | }
|
---|
43 | }
|
---|
Note:
See
TracBrowser
for help on using the repository browser.