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

Last change on this file since 243 was 233, checked in by alloc, 10 years ago

Fixes for 11.4

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