|
Last change
on this file since 332 was 325, checked in by alloc, 7 years ago |
|
Code style cleanup (mostly whitespace changes, enforcing braces, using cleanup)
|
|
File size:
1.1 KB
|
| Line | |
|---|
| 1 | using System;
|
|---|
| 2 | using AllocsFixes.PersistentData;
|
|---|
| 3 |
|
|---|
| 4 | namespace AllocsFixes {
|
|---|
| 5 | public class AllocsLogFunctions {
|
|---|
| 6 | public static void RequestToSpawnPlayer (ClientInfo _cInfo, int _chunkViewDim, PlayerProfile _playerProfile) {
|
|---|
| 7 | try {
|
|---|
| 8 | Log.Out ("Player connected" +
|
|---|
| 9 | ", entityid=" + _cInfo.entityId +
|
|---|
| 10 | ", name=" + _cInfo.playerName +
|
|---|
| 11 | ", steamid=" + _cInfo.playerId +
|
|---|
| 12 | ", steamOwner=" + _cInfo.ownerId +
|
|---|
| 13 | ", ip=" + _cInfo.ip
|
|---|
| 14 | );
|
|---|
| 15 |
|
|---|
| 16 | PersistentContainer.Instance.Players [_cInfo.playerId, true].SetOnline (_cInfo);
|
|---|
| 17 | PersistentContainer.Instance.Save ();
|
|---|
| 18 | } catch (Exception e) {
|
|---|
| 19 | Log.Out ("Error in AllocsLogFunctions.RequestToSpawnPlayer: " + e);
|
|---|
| 20 | }
|
|---|
| 21 | }
|
|---|
| 22 |
|
|---|
| 23 | public static void PlayerDisconnected (ClientInfo _cInfo, bool _bShutdown) {
|
|---|
| 24 | try {
|
|---|
| 25 | Player p = PersistentContainer.Instance.Players [_cInfo.playerId, true];
|
|---|
| 26 | if (p != null) {
|
|---|
| 27 | p.SetOffline ();
|
|---|
| 28 | } else {
|
|---|
| 29 | Log.Out ("Disconnected player not found in client list...");
|
|---|
| 30 | }
|
|---|
| 31 |
|
|---|
| 32 | PersistentContainer.Instance.Save ();
|
|---|
| 33 | } catch (Exception e) {
|
|---|
| 34 | Log.Out ("Error in AllocsLogFunctions.PlayerDisconnected: " + e);
|
|---|
| 35 | }
|
|---|
| 36 | }
|
|---|
| 37 | }
|
|---|
| 38 | }
|
|---|
Note:
See
TracBrowser
for help on using the repository browser.