first commit
This commit is contained in:
62
scripts/stalker_core/BmmoClient.cs
Normal file
62
scripts/stalker_core/BmmoClient.cs
Normal file
@ -0,0 +1,62 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BallanceStalkerCore {
|
||||
|
||||
public enum BmmoClientStatus : UInt32 {
|
||||
Ready,
|
||||
Initializing,
|
||||
Running,
|
||||
Stopping,
|
||||
Stopped
|
||||
}
|
||||
|
||||
public struct VxVector {
|
||||
float x, y, z;
|
||||
}
|
||||
public struct VxQuaternion {
|
||||
float x, y, z, w;
|
||||
}
|
||||
public struct VxBallState {
|
||||
UInt32 player_id;
|
||||
VxVector pos;
|
||||
VxQuaternion quad;
|
||||
}
|
||||
|
||||
public class PlayerEntity {
|
||||
public string mPlayerName;
|
||||
public UInt32 mPlayerGnsUid;
|
||||
public bool mPlayerCheated;
|
||||
}
|
||||
|
||||
public class BmmoClient {
|
||||
public BmmoClient(LogManager logger) {
|
||||
mLogger = logger;
|
||||
}
|
||||
|
||||
// receive message in godot, you should use call_defer functions to
|
||||
// reflact data delivered by event on engine
|
||||
#region event system
|
||||
public event Action<VxBallState[]> EventBallState;
|
||||
public event Action<string, string> EventChat;
|
||||
|
||||
public event Action<PlayerEntity> EventPlayerConnect;
|
||||
public event Action<UInt32> EventPlayerDisconnect;
|
||||
#endregion
|
||||
|
||||
private LogManager mLogger;
|
||||
private Dictionary<UInt32, PlayerEntity> mPlayersDict;
|
||||
|
||||
public void Start(string host, UInt16 port) {
|
||||
|
||||
}
|
||||
|
||||
public void Stop() {
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
10
scripts/stalker_core/LogManager.cs
Normal file
10
scripts/stalker_core/LogManager.cs
Normal file
@ -0,0 +1,10 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BallanceStalkerCore {
|
||||
public class LogManager {
|
||||
}
|
||||
}
|
21
scripts/stalker_core/StalkerManager.cs
Normal file
21
scripts/stalker_core/StalkerManager.cs
Normal file
@ -0,0 +1,21 @@
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace BallanceStalkerCore {
|
||||
|
||||
public class StalkerManager {
|
||||
public static StalkerManager Singleton = new StalkerManager();
|
||||
private StalkerManager() {
|
||||
|
||||
}
|
||||
|
||||
public BmmoClient mBmmoClient;
|
||||
public LogManager mLogger;
|
||||
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user