source: binary-improvements/7dtd-server-fixes/src/AllocsLogFunctions.cs@ 291

Last change on this file since 291 was 273, checked in by alloc, 9 years ago

fixes 8_10_13_1

File size: 1.2 KB
Line 
1using AllocsFixes.PersistentData;
2using System;
3using System.Collections.Generic;
4using UnityEngine;
5
6namespace 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.