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

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

fixes 8_10_13_1

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