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

Last change on this file since 344 was 325, checked in by alloc, 6 years ago

Code style cleanup (mostly whitespace changes, enforcing braces, using cleanup)

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